View source: R/bioinfo_sequences.R
coverageBams | R Documentation |
Calculate the breadth (fraction of the genome that is covered by reads) and depth (average number of times each position in the genome has been sequenced) of coverage from a set of BAM file(s) (see Molnar & Ilie (2015)). Results are identical to those from samtools depth
.
coverageBams(
bamFiles,
yieldSize = 10^4,
seq.ids = NULL,
out.file = NULL,
max.depth = 10^4,
min.base.quality = 1,
min.mapq = 5,
min.nucleotide.depth = 1,
distinguish.strands = FALSE,
distinguish.nucleotides = FALSE,
ignore.query.Ns = FALSE,
include.deletions = FALSE,
include.insertions = FALSE,
is.paired = NA,
is.proper.pair = NA,
is.unmapped.query = FALSE,
has.unmapped.mate = NA,
is.minus.strand = NA,
is.mate.minus.strand = NA,
is.first.mate.read = NA,
is.second.mate.read = NA,
is.secondary.align = FALSE,
is.not.passing.qc = FALSE,
is.dupl = FALSE,
verbose = 1,
nb.cores = 1
)
bamFiles |
vector of paths to BAM file(s), each of them having an index file with the same name but finishing by ".bai"; if there are several BAM files, all of them should contain reads aligned on the same set of sequences (i.e. the same reference genome) |
yieldSize |
number of records to yield each time the file is read from (see |
seq.ids |
sequence identifier(s) to focus on, e.g. "chr2" or c("chr2","chr5"); if NULL, all of them |
out.file |
if not NULL, the output will be transformed into a data.frame and written into the given file |
max.depth |
see |
min.base.quality |
see |
min.mapq |
see |
min.nucleotide.depth |
see |
distinguish.strands |
see |
distinguish.nucleotides |
see |
ignore.query.Ns |
see |
include.deletions |
see |
include.insertions |
see |
is.paired |
see |
is.proper.pair |
see |
is.unmapped.query |
see |
has.unmapped.mate |
see |
is.minus.strand |
see |
is.mate.minus.strand |
see |
is.first.mate.read |
see |
is.second.mate.read |
see |
is.secondary.align |
see |
is.not.passing.qc |
see |
is.dupl |
see |
verbose |
verbosity level (0/1/2) |
nb.cores |
the number of cores to use to parallelize over bamFiles, i.e. at most how many child processes will be run simultaneously (not on Windows) |
list with one component per BAM file, each being a matrix with columns "nb.bases", "mapped.bases", "count.sum", "breadth", "depth" and "depth.map" (corresponding to the depth at positions with at least one mapped read)
Timothee Flutre (with the help of Martin Morgan)
freadBedtoolsCoverageHist
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.