Skip to content

Commit

Permalink
update vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
sheridar committed Nov 4, 2022
1 parent 12843cb commit 434ebfc
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions vignettes/import_vdj.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ so_vdj <- so %>%
`import_vdj()` adds a variety of per-chain metrics to the object meta.data. Information for each chain identified for the cell is separated by a semicolon. The separator used for storing and parsing per-chain V(D)J data can be specified using the `sep` argument included for most djvdj functions. `NA`s will be included for cells that lack V(D)J data.

```{r}
so_vdj@meta.data %>%
slot(so_vdj, "meta.data") %>%
head(2)
```

Expand Down Expand Up @@ -206,12 +206,29 @@ so_vdj <- so %>%
The additional columns added to the meta.data will include the number of insertions, deletions, and mismatches (ending in 'ins', 'del', or 'mis') for each V(D)J segment (prefixed with 'v', 'd', 'j', or 'c'). Columns containing junction information will be prefixed with either 'vd' or 'dj'. Columns ending in 'freq' show the event frequency which is calculated as the number of events divided by the length of the region.

```{r}
so_vdj@meta.data %>%
slot(so_vdj, "meta.data") %>%
head(2)
```

<br>

## Loading additional sequence information

By default the only sequence information loaded by `import_vdj()` will be for the CDR3 region. Newer versions of Cell Ranger will include additional sequences in the filtered_contig_annotations.csv file. This includes the FWR1, CDR1, FWR2, CDR2, FWR3, and FWR4 regions. These additional sequences can be loaded using the `data_cols` argument.

```{r}
so_vdj <- so %>%
import_vdj(
vdj_dir = vdj_dirs,
data_cols = c("cdr1", "cdr1_nt", "cdr2", "cdr2_nt")
)
slot(so_vdj, "meta.data") %>%
head(3)
```

<br>

## Loading TCR and BCR data

To add both BCR and TCR data to the object, run `import_vdj()` separately for each data type. To distinguish between columns containing BCR or TCR data, use the `prefix` argument to add unique column names.
Expand All @@ -235,7 +252,7 @@ so_vdj <- so %>%
This results in two sets of new columns being added to the meta.data. When performing downstream analysis using other djvdj functions, be sure to specify the correct columns, i.e. 'bcr_clonotype_id' or 'tcr_clonotype_id'.

```{r}
so_vdj@meta.data %>%
slot(so_vdj, "meta.data") %>%
head(3)
```

Expand Down

0 comments on commit 434ebfc

Please sign in to comment.