countGenes {alakazam} | R Documentation |
Tabulates V(D)J allele, gene or family usage.
Description
Determines the count and relative abundance of V(D)J alleles, genes or families within groups.
Usage
countGenes(
data,
gene,
groups = NULL,
copy = NULL,
clone = NULL,
fill = FALSE,
mode = c("gene", "allele", "family", "asis"),
remove_na = TRUE
)
Arguments
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 |
mode |
one of |
remove_na |
removes rows with |
Value
A data.frame summarizing family, gene or allele counts and frequencies with columns:
-
gene
: name of the family, gene or allele. -
seq_count
: total number of sequences for the gene. -
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 thecopy
column. for each gene. Only present if thecopy
argument is specified. -
copy_freq
: frequency of the gene as a fraction of the total copy number within each group. Only present if thecopy
argument is specified. -
clone_count
: total number of clones for the gene. Only present if theclone
argument is specified. -
clone_freq
: frequency of the gene as a fraction of the total number of clones within each grouping. Only present if theclone
argument is specified.
Additional columns defined by the groups
argument will also be present.
Examples
# 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)