splitClonotypes: Split cell-level clonotype counts by sample

splitClonotypesR Documentation

Split cell-level clonotype counts by sample

Description

Takes a matrix of cell-level clonotype counts and splits them into a list of group-specific counts (typically samples).

Usage

splitClonotypes(x, by, ...)

## S4 method for signature 'Matrix'
splitClonotypes(x, by)

## S4 method for signature 'matrix'
splitClonotypes(x, by)

## S4 method for signature 'SingleCellExperiment'
splitClonotypes(x, by, contigs = "contigs", clonoStats = "clonoStats")

## S4 method for signature 'clonoStats'
splitClonotypes(x, by)

Arguments

x

A Matrix of cell-level clonotype assignments (cells-by-clonotypes) or a SingleCellExperiment object with such a matrix stored in the clono slot of the colData.

by

A character vector or factor by which to split the clonotype counts. If x is a SingleCellExperiment object, this can also be a character, giving the name of the column from the colData to use as this variable. Similar to the group argument for clonoStats.

...

additional arguments.

contigs

character. If x is a SingleCellExperiment, the name of the SplitDataFrameList in the colData of x containing contig information.

clonoStats

character. If x is a SingleCellExperiment, the name of the element in the metadata of x that contains the output of clonoStats. Must include cell-level clonotype assignments (ie. assignment = TRUE).

Value

A list of Matrix objects providing the cell-level clonotype assignments for each unique value of by (if by denotes sample labels, each matrix in the list will contain the cells from a single sample).

Examples

example(addVDJtoSCE)
x <- clonoStats(contigs, assignment = TRUE)
splitClonotypes(x, by = sce$sample)


kstreet13/VDJdive documentation built on May 31, 2024, 1:26 p.m.