Expand the rows of a RangedSummarizedExperiment to single base resolution.
Source: R/expandSEToBaseSpace.R
expandSEToBaseSpace.RdExpand the rows of a RangedSummarizedExperiment to single base resolution.
Usage
expandSEToBaseSpace(
se,
region = NULL,
seqinfo = NULL,
keepAssays = .getReadLevelAssayNames(se),
ignore.strand = TRUE
)Arguments
- se
RangedSummarizedExperimentobject to be expanded to single base resolution.- region
A
GRangesobject with a single region defining the range for expandingse. Alternatively, the region can be specified as a character scalar (e.g. "chr1:1200-1300") that can be coerced into aGRangesobject. IfNULL(the default),regionis set to the range of the data inse.- seqinfo
NULLor aSeqinfoobject containing information about the set of genomic sequences (chromosomes). Alternatively, a named numeric vector with genomic sequence names and lengths. Used to convert a characterregionto aGRangesobject.- keepAssays
Character vector indicating which (read-level) assays to expand to base space. Only these assays will be present in the returned object.
- ignore.strand
A logical scalar defining whether to ignore the strand of the
rowRanges(se).
Value
A single-base resolution RangedSummarizedExperiment
corresponding to se.
Examples
modbamfile <- system.file("extdata", "6mA_1_10reads.bam",
package = "SingleMoleculeGenomicsIO")
se <- readModBam(bamfiles = modbamfile, regions = "chr1:6940000-6955000",
modbase = "a", verbose = TRUE,
BPPARAM = BiocParallel::SerialParam())
#> ℹ extracting base modifications from modBAM files
#> ℹ finding unique genomic positions...
#> ✔ finding unique genomic positions... [27ms]
#>
#> ℹ collapsed 11300 positions to 4772 unique ones
#> ✔ collapsed 11300 positions to 4772 unique ones [201ms]
#>
se_exp <- expandSEToBaseSpace(se)
dim(se)
#> [1] 4772 1
dim(se_exp)
#> [1] 15802 1