| GappedReads-class {ShortRead} | R Documentation |
The GappedReads class extends the GappedAlignments
class defined in the GenomicRanges package.
A GappedReads object contains all the information contained in a
GappedAlignments object plus the sequences
of the queries. Those sequences can be accessed via the qseq
accessor.
readGappedReads(file, format="BAM", use.names=FALSE, ...):
Read a file as a GappedReads object.
Like with the readGappedAlignments
constructor, by default (i.e. use.names=FALSE) the resulting
object has no names. If use.names is TRUE, then the
names are constructed from the query template names (QNAME field in
a SAM/BAM file).
Note that this function is just a front-end that delegates to the
format-specific back-end function specified via the format
argument. The use.names argument and any extra argument are
passed to the back-end function.
Only the BAM format is supported for now. Its back-end is the
readBamGappedReads function defined
in the Rsamtools package.
See ?readBamGappedReads for more information
(you might need to install and load the Rsamtools package first).
In the code snippets below, x is a GappedReads object.
qseq(x):
Extracts the sequences of the queries as a
DNAStringSet object.
H. Pages and P. Aboyoun
http://samtools.sourceforge.net/
GappedAlignments-class,
readBamGappedReads
greads_file <- system.file("extdata", "ex1.bam", package="Rsamtools")
greads <- readGappedReads(greads_file)
greads
qseq(greads)