countGenes: 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

1
2
countGenes(data, gene, groups = NULL, copy = NULL, clone = NULL,
  mode = c("gene", "allele", "family"))

Arguments

data

data.frame with Change-O style columns.

gene

column containing allele assignments. Only the first allele in the column will be considered.

groups

columns containing grouping variables. If NULL do not group.

copy

name of the data column containing copy numbers for each sequence. If this value is specified, then total copy abundance is determined by the sum of copy numbers within each gene. This argument is ignored if clone is specified.

clone

name of the data column containing clone identifiers for each sequence. If this value is specified, then genes will be counted only once for each clone. Note, this is accomplished by using the most common gene within each clone identifier. As such, ambiguous alleles within a clone will not be accurately represented.

mode

one of c("gene", "family", "allele") defining the degree of specificity regarding allele calls. Determines whether to return counts for genes, families or alleles.

Value

A data.frame summarizing family, gene or allele counts and frequencies with columns:

Additional columns defined by the groups argument will also be present.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Without copy numbers
genes <- countGenes(ExampleDb, gene="V_CALL", groups="SAMPLE", mode="family")
genes <- countGenes(ExampleDb, gene="V_CALL", groups="SAMPLE", mode="gene")
genes <- countGenes(ExampleDb, gene="V_CALL", groups="SAMPLE", mode="allele")

# With copy numbers and multiple groups
genes <- countGenes(ExampleDb, gene="V_CALL", groups=c("SAMPLE", "ISOTYPE"), 
                    copy="DUPCOUNT", mode="family")

# Count by clone
genes <- countGenes(ExampleDb, gene="V_CALL", groups=c("SAMPLE", "ISOTYPE"), 
                    clone="CLONE", mode="family")

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.