| countGenes | R Documentation |
Determines the count and relative abundance of V(D)J alleles, genes or families within groups. If sequences from multiple loci are present, the frequency is calculated within each locus.
countGenes(
data,
gene,
groups = NULL,
copy = NULL,
clone = NULL,
fill = FALSE,
first = TRUE,
collapse = TRUE,
mode = c("gene", "allele", "family", "asis"),
cell_id = "cell_id",
remove_na = TRUE
)
data |
data.frame with AIRR-format or Change-O style columns. |
gene |
column containing allele assignments. Only the first allele in the
column will be considered when |
groups |
columns containing grouping variables. If |
copy |
name of the |
clone |
name of the |
fill |
logical of |
first |
if TRUE return only the first allele/gene/family call for computing the frequency; if FALSE return all calls delimited by commas. |
collapse |
if TRUE check for duplicates and return only unique allele/gene/family assignments per sequence; if FALSE return all assignments (faster). Has no effect if first=TRUE. |
mode |
one of |
cell_id |
name of the |
remove_na |
removes rows with |
A data.frame summarizing family, gene or allele counts and frequencies with columns:
locus: locus of the gene (IGH, IGK, IGL, TRA, TRB, TRD, TRG). Note that frequencies are calculated within each locus.
gene: name of the family, gene or allele.
seq_count: total number of sequences for the gene in the locus.
locus_count: total number of sequences in the locus.
seq_freq: frequency of the gene as a fraction of the total
number of sequences within each grouping.
copy_count: sum of the copy counts in the copy column.
for each gene. Only present if the copy
argument is specified.
locus_copy_count: sum of the copy counts in the copy column.
for all gene in the locus. Only present if the
copy argument is specified.
copy_freq: frequency of the gene as a fraction of the total
copy number within each group. Only present if
the copy argument is specified.
clone_count: total number of clones for the gene. Only present if
the clone argument is specified.
clone_freq: frequency of the gene as a fraction of the total
number of clones within each grouping. Only present if
the clone argument is specified.
Additional columns defined by the groups argument will also be present.
# Without copy numbers
genes <- countGenes(ExampleDb, gene = "v_call", groups = "sample_id", mode = "family")
genes <- countGenes(ExampleDb, gene = "v_call", groups = "sample_id", mode = "gene")
genes <- countGenes(ExampleDb, gene = "v_call", groups = "sample_id", mode = "allele")
# With copy numbers and multiple groups
genes <- countGenes(ExampleDb,
gene = "v_call", groups = c("sample_id", "c_call"),
copy = "duplicate_count", mode = "family"
)
# Count by clone
genes <- countGenes(ExampleDb,
gene = "v_call", groups = c("sample_id", "c_call"),
clone = "clone_id", mode = "family"
)
# Count absent genes
genes <- countGenes(ExampleDb,
gene = "v_call", groups = "sample_id",
mode = "allele", fill = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.