View source: R/getInsertSizeDistFromBam.R
getInsertSizeDistFromBam | R Documentation |
Read and tabulate the insert sizes from paired-end alignments
contained in one or several bam files. By default, all properly aligned
read pairs are included. Optionally, alignments can be restricted to
those in a specific genomic region (regions
argument) or the number
of alignments read can be limited (nmax
argument).
getInsertSizeDistFromBam(
fname,
regions = NULL,
nmax = NA_integer_,
isizemax = 800,
exclude = c("chrM", "chrY", "chrX")
)
fname |
|
regions |
|
nmax |
|
isizemax |
|
exclude |
|
integer
vector with the number of insert sizes. The element at
position i
gives the observed number of alignment pairs with an
insert size of i
. The number of insert sizes greater than
isizemax
that were set to isizemax
are reported in the
attribute "ncapped"
.
Michael Stadler
scanBam
used to read alignments.
if (requireNamespace("Rsamtools", quietly = TRUE)) {
bamf <- system.file("extdata", "getInsertSizeDistFromBam", "atac_mm10.bam",
package = "swissknife")
isize <- getInsertSizeDistFromBam(bamf)
attr(isize, "ncapped")
plot(isize, type = "l",
xlab = "Insert size (bp)", ylab = "Number of fragments")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.