fetch_vdj | R Documentation |
Fetch per-chain V(D)J data from object. Within the object meta.data, each row represents a single cell and can include information for multiple chains. This function can return a data.frame where each row represents a single chain. This is useful for plotting per-chain metrics such as CDR3 length or the number of insertions/deletions.
fetch_vdj(
input,
data_cols = NULL,
clonotype_col = NULL,
filter_cells = FALSE,
per_chain = TRUE,
unnest = TRUE,
sep = global$sep
)
input |
Single cell object or data.frame containing V(D)J data. If a data.frame is provided, the cell barcodes should be stored as row names. |
data_cols |
meta.data columns containing per-chain V(D)J data to unnest. If NULL, V(D)J data are automatically selected by identifying columns that have NAs in the same rows as clonotype_col. |
clonotype_col |
meta.data column containing clonotype IDs. This column is used to determine which columns have V(D)J data. If both clonotype_col and data_cols are NULL, all columns are included. |
filter_cells |
Remove cells that do not have V(D)J data, clonotype_col must be provided to determine which cells to filter. |
per_chain |
If |
unnest |
If |
sep |
Separator used for storing per cell V(D)J data. This is used to identify columns containing per-chain data that can be unnested. |
data.frame containing V(D)J data
# Fetch per-chain V(D)J data
fetch_vdj(vdj_sce)
# To increase performance, specify which columns to return per-chain data,
# per-cell data will be returned for all other columns
fetch_vdj(
vdj_sce,
data_cols = c("chains", "reads")
)
# Only include cells that have V(D)J data
# clonotype_col must be specified to identify cells with V(D)J data
fetch_vdj(
vdj_sce,
filter_cells = TRUE,
clonotype_col = "clonotype_id"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.