Description Usage Arguments Details Value Examples
gAlignmentsToSppTags
converts a GAlignments
object to
spp
tags, for the purpose of passing GAlignments
objects
to functions of the spp
package.
1 | gAlignmentsToSppTags(reads)
|
reads |
|
spp
uses a custom format to represent tags (see read.bam.tags
).
This helper function converts GAlignments
objects to this custom
format. The GAlignments
class is more versatile than the custom tag
format of spp
. If several metrics shall be calculated on the same BAM
file, then it makes sense to load it only once into memory as a
GAlignments
object and convert it to spp
tags for
spp
-related metrics, instead of loading the BAM file again just to
have it in spp
tag format. Note that the GAlignments
object
should contain the NM
flag (number of mismatches). Otherwise, the
quality
attribute of spp
tags cannot be populated with values.
The spp
function select.informative.tags
simply accepts all
tags, when the quality
attribute is missing. Create the
GAlignments
object using
readGAlignments(..., param=ScanBamParam(tag="NM"))
to include the number of mismatches in the GAlignments
object.
spp
tags which are compatible with the output of read.bam.tags
1 2 3 4 5 6 | # the following three lines essentially perform the same as read.bam.tags()
# but a GAlignments object is more versatile and serves as input to many
# functions
library(GenomicAlignments)
chipSample <- readGAlignments("IP.bam", param=ScanBamParam(tag="NM"))
sppTags <- gAlignmentsToSppTags(chipSample)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.