addVDJtoSCE | R Documentation |
Matches CellRanger V(D)J data to paired data in an existing
SingleCellExperiment
object.
addVDJtoSCE(samples, sce, ...)
## S4 method for signature 'SplitDataFrameList,SingleCellExperiment'
addVDJtoSCE(samples, sce, sample.names = NULL, barcode = "Barcode")
## S4 method for signature 'character,SingleCellExperiment'
addVDJtoSCE(samples, sce, sample.names = names(samples), barcode = "Barcode")
samples |
A character vector containing one or more directory names,
each corresponding to a 10X sample. Each directory should contain a file
named |
sce |
A |
... |
additional arguments. |
sample.names |
A character vector of length equal to |
barcode |
The column name from the |
Matching cell barcodes between data objects can cause problems,
because different methods have different ways of ensuring barcodes are
unique across all samples. This function and readVDJcontigs
follow the naming conventions of read10xCounts
,
where the sample index (in the samples
vector) is appended to each
cell barcode, to ensure that each barcode is unique, across all samples. If
sce
was created by a different method, such as conversion from a
Seurat
object, you may need to check the barcode naming convention.
A SingleCellExperiment
object
with an element named "contigs"
added to the colData
,
representing the V(D)J data.
# load example V(D)J data
data('contigs')
# make SCE object with matching barcodes and sample IDs
ncells <- 24
u <- matrix(rpois(1000 * ncells, 5), ncol = ncells)
barcodes <- vapply(contigs[,'barcode'], function(x){ x[1] }, 'A')
samples <- vapply(contigs[,'sample'], function(x){ x[1] }, 'A')
sce <- SingleCellExperiment::SingleCellExperiment(assays = list(counts = u),
colData = data.frame(Barcode = barcodes,
sample = samples))
sce <- addVDJtoSCE(contigs, sce)
sce$contigs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.