Description Usage Arguments Details Value Author(s) Examples
View source: R/summarizeAlignment.R
This function summarized the results from an alignment by reading through the corresponding BAM file and counting the number of uniquely aligned or multi-mapped reads.
1 | summarizeAlignment( x, index=character(), sbp=ScanBamParam( what=c( "flag", "mapq" ), tag=c( "NH", "HI" ) ), yieldSize=1e+6, v=FALSE )
|
x |
The file name of the BAM file to summarize. |
index |
The file name of the index file for the BAM (usually the BAM
filename with suffix |
sbp |
The |
yieldSize |
The number of entries that should be sequentially processed. |
v |
verbosity. |
This function scans throught the full BAM file and records the number of uniquely or multi-aligned reads along with their mapping quality.
A list with 3 elements:
flag
a list of 3 matrices no_algn
, unique_algn
and
multi_algn
with rows corresponding to the BAM flags and
(one) column with the number of reads for a certain flag.
mapq
a list of 3 matrices no_algn
, unique_algn
and
multi_algn
with 256 rows corresponding to all possible
mapping qualities (Sanger Phred encoded; from 0 to 255) and
(one) column with the number of reads with a certain map quality.
counts
a list of 3 numeric values no_algn
, unique_algn
and
multi_algn
representing the total number of non-,
unique- or mult-mapping reads, respectively.
Johannes Rainer
1 2 3 4 5 | dirpath <- system.file( package="SeqUtils", "extdata" )
bamfile <- dir( dirpath, "example.bam", full=TRUE )
Res <- summarizeAlignment( bamfile )
Res$counts
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.