countBarcodedReads {karyotapR} | R Documentation |
Get read counts from barcoded reads
Description
countBarcodedReads()
and countBarcodedReadsFromContig()
match exogenous DNA barcode sequences to their associated
cell barcodes and saves them to the colData
(cell barcode metadata) of TapestriExperiment
.
countBarcodedReads()
is a shortcut for countBarcodedReadsFromContig()
, allowing the user to specify 'gRNA' or 'barcode'
to use the grnaCounts
or barcodeCounts
altExp
slots.
The entries in the barcode.lookup
table do not have to be present in the sample,
allowing users to keep one master table/file of available barcode sequences for use in all experiments.
The Rsamtools
and Biostrings
packages must be installed to use these functions.
Usage
countBarcodedReads(
TapestriExperiment,
bam.file,
barcode.lookup,
probe,
return.table = FALSE,
max.mismatch = 2,
with.indels = FALSE,
...
)
countBarcodedReadsFromContig(
bam.file,
barcode.lookup,
contig,
cell.barcode.tag = "RG",
max.mismatch = 2,
with.indels = FALSE
)
Arguments
TapestriExperiment |
|
bam.file |
File path of BAM file. |
barcode.lookup |
|
probe |
Character, either "gRNA" or "barcode" to parse counts from |
return.table |
Logical, if |
max.mismatch |
Numeric, the maximum and minimum number of mismatching letters allowed. Default 2. |
with.indels |
If |
... |
Arguments to pass on to |
contig |
Character, contig or chromosome name to search for barcodes in. Can be a vector of more than one contig to expand search space. |
cell.barcode.tag |
Character of length 2, indicates cell barcode field in BAM, specified by Tapestri pipeline (currently "RG"). Default "RG". |
Value
TapestriExperiment
with barcoded read counts added to colData
.
A data.frame of read counts for each specified barcode.
See Also
Examples
## Not run:
counts <- countBarcodedReads(
TapestriExperiment,
bam.file, barcode.lookup, "gRNA"
)
## End(Not run)
## Not run:
counts <- countBarcodedReadsFromContig(bam.file, barcode.lookup, "virus_ref2")
## End(Not run)