filter_vdj | R Documentation |
Remove V(D)J data for chains/cells that do not satisfy the provided condition
filter_vdj(
input,
filt,
data_cols = NULL,
clonotype_col = "clonotype_id",
sep = global$sep,
per_chain = TRUE
)
input |
Single cell object or data.frame containing V(D)J data. If a data.frame is provided, cell barcodes should be stored as row names. |
filt |
Condition to use for filtering V(D)J data. To allow for filtering of per-chain V(D)J data, the data for each cell is converted into a vector, e.g. 'IGH;IGK' is equivalent to c('IGH', 'IGK'). This allows R vector operations to be performed on the per-chain values. The filtering condition must return TRUE/FALSE for each chain or a single TRUE/FALSE for each cell. Data can be filtered based on cell barcodes by referring to the '.cell_id' column. |
data_cols |
meta.data columns containing V(D)J data to use for filtering. 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 contain V(D)J data. |
sep |
Separator used for storing per cell V(D)J data. |
per_chain |
If |
Object with filtered meta.data
# Only include V(D)J data for productive chains
res <- filter_vdj(vdj_sce, productive)
# Only include V(D)J data for cells with paired chains
res <- filter_vdj(vdj_sce, paired)
# Only include V(D)J data for cells with at least one heavy and one light
# chain
res <- filter_vdj(
vdj_sce,
"IGH" %in% chains && any(c("IGK", "IGL") %in% chains)
)
# Only include V(D)J data for cells that have an IGH, IGK, and IGL chain
res <- filter_vdj(
vdj_sce,
all(c("IGH", "IGK", "IGL") %in% chains)
)
# Only include V(D)J data for heavy chains
res <- filter_vdj(vdj_sce, chains == "IGH")
# Remove chains that only have 1 UMI for support
res <- filter_vdj(vdj_sce, umis > 1)
# Filter based on cell barcode
res <- filter_vdj(vdj_sce, .cell_id == "1_ACGGAGACATGCTGGC-1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.