GappedReads-class {ShortRead}R Documentation

GappedReads objects

Description

The GappedReads class extends the GAlignments class defined in the GenomicRanges package. A GappedReads object contains all the information contained in a GAlignments object plus the sequences of the queries. Those sequences can be accessed via the qseq accessor.

Constructor

readGappedReads(file, format="BAM", use.names=FALSE, ...): Read a file as a GappedReads object. Like with the readGAlignments 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 readGappedReadsFromBam function defined in the Rsamtools package. See ?readGappedReadsFromBam for more information (you might need to install and load the Rsamtools package first).

Accessors

In the code snippets below, x is a GappedReads object.

qseq(x): Extracts the sequences of the queries as a DNAStringSet object.

Author(s)

H. Pages and P. Aboyoun

References

http://samtools.sourceforge.net/

See Also

GAlignments-class, readGappedReadsFromBam

Examples

greads_file <- system.file("extdata", "ex1.bam", package="Rsamtools")
greads <- readGappedReads(greads_file)
greads
qseq(greads)

[Package ShortRead version 1.20.0 Index]