getMT: grab the mitochondrial reads from a BAM & estimate their...

Description Usage Arguments Value Examples

View source: R/getMT.R

Description

This purely a convenience function, and an incredibly convenient one at that.

Usage

1
getMT(bam, filter = FALSE, parallel = FALSE, plotMAPQ = FALSE, ...)

Arguments

bam

a BAM filename, or DataFrame/SummarizedExperiment with $BAM

filter

filter on bam$mtCovg? (default is FALSE, don't filter)

parallel

load multiple BAMs in parallel, if possible? (FALSE)

plotMAPQ

plot distribution of mitochondrial mapping quality? (FALSE)

...

additional args to pass scanBamParam(), such as mapqFilter

Value

an MAlignments or MAlignmentsList object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(MTseekerData)
BAMdir <- system.file("extdata", "BAMs", package="MTseekerData")
BAMs <- paste0(BAMdir, "/", list.files(BAMdir, pattern=".bam$"))
(mal <- getMT(BAMs[1]))
class(mal) 

targets <- data.frame(BAM=BAMs, stringsAsFactors=FALSE) 
rownames(targets) <- sapply(strsplit(basename(BAMs), "\\."), `[`, 1)
(mall <- getMT(targets))
class(mall) 

MTseeker documentation built on Oct. 31, 2019, 3:20 a.m.