Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo in first vignette #55

Merged
merged 6 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ jobs:

- uses: r-lib/actions/setup-pandoc@v2

- name: Cache R packages
uses: actions/cache@v4
with:
path: /home/runner/work/_temp/Library
key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-${{ steps.BIOC.outputs.version}}-r-${{ steps.R.outputs.version}}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-${{ steps.BIOC.outputs.version}}-r-${{ steps.R.outputs.version}}-

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/vignette.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ jobs:

- uses: r-lib/actions/setup-pandoc@v2

- name: Cache R packages
uses: actions/cache@v4
with:
path: /home/runner/work/_temp/Library
key: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-${{ steps.BIOC.outputs.version}}-r-${{ steps.R.outputs.version}}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ matrix.config.os }}-biocversion-${{ steps.BIOC.outputs.version}}-r-${{ steps.R.outputs.version}}-

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: pkgdown
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dandelionR
Title: Single-cell Immune Repertoire Trajectory Analysis in R
Version: 0.99.3
Version: 0.99.4
Authors@R:
c(person(given="Jiawei", family="Yu", email = "[email protected]", role = c("aut"), comment = c(ORCID = "0009-0005-9170-7881")),
person(given="Nicholas", family="Borcherding", email = "[email protected]", role = c("aut"), comment = c(ORCID = "0000-0003-1427-6342")),
Expand Down
26 changes: 22 additions & 4 deletions vignettes/vignette_from_scRepertoire.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ data(demo_sce)
data(demo_airr)
```

We will set the seed so that the plots and results are consistent.
```{r}
set.seed(123)
```
### Use `scRepertoire` to load the VDJ data
For the trajectory analysis work here, we are focusing on the main productive TCR chains. Therefore we will flag `filterMulti = TRUE`, which will keep the selection of the 2 corresponding chains with the highest expression for a single barcode. For more details, refer to `scRepertoire`'s [documentation](https://www.borch.dev/uploads/screpertoire/reference/combinetcr).

Expand Down Expand Up @@ -121,6 +125,11 @@ sce <- setupVdjPseudobulk(sce,
)
```

The main output of this function is a `SingleCellExperiment` object with the relevant VDJ information appended to the `colData`, particularly the columns with the `_main` suffix e.g. `v_call_abT_VJ_main`, `j_call_abT_VJ_main` etc.
```{r}
head(colData(sce))
```

Visualise the UMAP of the filtered data.
```{r}
plotUMAP(sce, color_by = "anno_lvl_2_final_clean")
Expand Down Expand Up @@ -152,12 +161,16 @@ plotUMAP(milo_object, color_by = "anno_lvl_2_final_clean", dimred = "UMAP_knngra
Next, we will construct the pseudobulked VDJ feature space using the neighbourhood graph constructed above. We will also run PCA on the pseudobulked VDJ feature space.
```{r}
pb.milo <- vdjPseudobulk(milo_object, mode_option = "abT", col_to_take = "anno_lvl_2_final_clean")
```

pb.milo <- runPCA(pb.milo, assay.type = "Feature_space", ncomponents = 20)
Inspect the newly created `pb.milo` object.
```{r}
pb.milo
```

We can visualise the PCA of the pseudobulked VDJ feature space.
We can compute and visualise the PCA of the pseudobulked VDJ feature space.
```{r}
pb.milo <- runPCA(pb.milo, assay.type = "Feature_space", ncomponents = 20)
plotPCA(pb.milo, color_by = "anno_lvl_2_final_clean")
```

Expand All @@ -183,7 +196,7 @@ library(destiny)
dm <- DiffusionMap(t(pca), n_pcs = 10, n_eigs = 10)
```

### Compute diffussion pseudotime on diffusion map
### Compute diffusion pseudotime on diffusion map
```{r}
dif.pse <- DPT(dm, tips = c(root, branch.tips), w_width = 0.1)
```
Expand All @@ -199,7 +212,7 @@ plotPCA(pb.milo, color_by = "pseudotime") + scale_colour_gradientn(colours = pal
```

### Markov chain construction on the pseudobulk VDJ feature space

This step will compute the Markov chain probabilities on the pseudobulk VDJ feature space. It will return the branch probabilities in the `colData` and the column name corresponds to the branch tips defined earlier.
```{r}
pb.milo <- markovProbability(
milo = pb.milo,
Expand All @@ -211,6 +224,11 @@ pb.milo <- markovProbability(
)
```

Inspect the `pb.milo` object to see the newly added columns.
```{r}
head(colData(pb.milo))
```

### Visualising branch probabilities

With the Markov chain probabilities computed, we can visualise the branch probabilities towards CD4+ or CD8+ T-cell fate on the PCA plot.
Expand Down
Loading