View source: R/calc-gene-usage.R
calc_gene_usage | R Documentation |
Quantify the usage of different V(D)J segments for each cell cluster. The usage of two V(D)J segments can also be calculated for a single chain. For example, calc_gene_usage() can calculate the frequency that different heavy chain V and J segments appear together.
calc_gene_usage(
input,
data_cols,
cluster_col = NULL,
chain = NULL,
chain_col = global$chain_col,
prefix = paste0(data_cols[1], "_"),
return_df = FALSE,
sep = global$sep
)
input |
Object containing V(D)J data. If a data.frame is provided, the cell barcodes should be stored as row names. |
data_cols |
meta.data column(s) containing V(D)J genes identified for each clonotype. If multiple columns are provided, paired usage of genes will be calculated. |
cluster_col |
meta.data column containing cell clusters to use when calculating gene usage |
chain |
Chain(s) to use for calculating gene usage. Set to |
chain_col |
meta.data column containing chains for each cell |
prefix |
Prefix to add to new columns |
return_df |
Return results as a data.frame. If |
sep |
Separator used for storing per cell V(D)J data |
data.frame containing gene usage summary
plot_gene_usage()
, calc_gene_pairs()
, plot_gene_pairs()
# Calculate V(D)J segment usage for all cells
calc_gene_usage(
vdj_sce,
data_cols = "v_gene"
)
# Calculate gene usage separately for cell clusters
calc_gene_usage(
vdj_sce,
data_cols = "v_gene",
cluster_col = "orig.ident"
)
# Calculate gene usage for a specific chain(s)
calc_gene_usage(
vdj_sce,
data_cols = "v_gene",
chain = c("IGK", "IGL")
)
# Calculate paired usage of V(D)J segments
calc_gene_usage(
vdj_sce,
data_cols = c("v_gene", "j_gene"),
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.