clonoStats  R Documentation 
Assign clonotype labels to cells and produce two summary tables:
the clonotypes x samples
table of abundances and the counts x
samples
table of clonotype frequencies.
clonoStats(x, ...)
## S4 method for signature 'SplitDataFrameList'
clonoStats(
x,
group = "sample",
type = NULL,
assignment = FALSE,
method = "EM",
lang = c("cpp", "r"),
thresh = 0.01,
iter.max = 1000,
BPPARAM = SerialParam()
)
## S4 method for signature 'SingleCellExperiment'
clonoStats(x, contigs = "contigs", group = "sample", ...)
## S4 method for signature 'clonoStats'
clonoStats(x, group = NULL, lang = c("cpp", "r"))
x 
A 
... 
additional arguments. 
group 
character. The name of the column in 
type 
character. The type of VDJ data (one of 
assignment 
logical. Whether or not to return the full 
method 
character. Which method to use for assigning celllevel
clonotypes. Options are 
lang 
character. Indicates which implementation of certain methods to
use. The EM algorithm is implemented in both pure R ( 
thresh 
Numeric threshold for convergence of the EM algorithm.
Indicates the maximum allowable deviation in a count between updates. Only
used if 
iter.max 
Maximum number of iterations for the EM algorithm. Only used
if 
BPPARAM 
A BiocParallelParam object specifying the
parallel backend for distributed clonotype assignment operations (split by

contigs 
character. When 
Assign cells (with at least one V(D)J contig) to clonotypes and
produce summary tables that can be used for downstream analysis. Clonotype
assignment can be handled in multiple ways depending on the choice of
"method"
:
"EM"
: Cells are assigned probabilistically to their most
likely clonotype(s) with the ExpectationMaximization (EM) algorithm. For
ambiguous cells, this leads to proportional (noninteger) assignment across
multiple clonotypes and a frequency table of (noninteger) expected
counts.
"unique"
: Cells are assigned a clonotype if (and only if)
they can be uniquely assigned a single clonotype. For a T cell, this means
having exactly one alpha chain and one beta chain.
"CellRanger"
: Clonotype labels are taken from contig data
and matched across samples.
column name in contig data
: Similar to "unique"
, but
additionally, cells with multiples of a particular chain are assigned a
"dominant" clonotype based on which contig has the higher value in this
column (typical choices being "umis"
or "reads"
).
type of chain in contig data
: Clonotypes are based entirely
on this type of chain (eg. "TRA"
or "TRB"
) and cells may be
assigned to multiple clonotypes, if multiples of that chain are present.
The "EM"
, "unique"
, and UMI/readbased quantification
methods all define a clonotype as a pair of specific chains (alpha and beta
for T cells, heavy and light for B cells). Unlike other methods, the EM
algorithm assigns clonotypes probabilistically, which can lead to
noninteger counts for cells with ambiguous information (ie. only an alpha
chain, or two alphas and one beta chain).
We highly recommend providing information on each cell's sample of origin, as this can speed up computation and provide more accurate results. This is particularly important for the EM algorithm, which shares information across cells in the same group, so splitting by sample can improve accuracy by removing extraneous clonotypes from the set of possibilities for a particular cell.
Returns an object of class clonoStats
, containing grouplevel
clonotype summaries. May optionally include a sparse matrix of celllevel
assignment information, if assignment = TRUE
. If x
is a
SingleCellExperiment
object, this output is added to the metadata.
clonoStats
data('contigs')
clonoStats(contigs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.