I searched briefly for this but did not find an answer -- is there a way to access tag type 'B' data using Rsamtools?
I searched briefly for this but did not find an answer -- is there a way to access tag type 'B' data using Rsamtools?
See ?ScanBamParam, specifically the section on 'tags' and 'tagFilter' in the examples. If this doesn't answer your question please give an example of what you're trying to do.
Valerie
Thanks for replying so quickly.
I have custom SAM tags of types i, Z, and B. For example:
# Tag "MM" of type i
# Tag "NM" of type Z
# Tag "NY" of type B,C
# Tag "CY" of type B,f
BAM file name stored as bamFile. The following lines are OK:
param = ScanBamParam( what = scanBamWhat(), tag = c("MM", "NM") ) bam = scanBam( bamFile, param = param )
But if I try the following:
param = ScanBamParam( what = scanBamWhat(), tag = c("MM", "NM", "NY") ) bam = scanBam( bamFile, param = param )
or
param = ScanBamParam( what = scanBamWhat(), tag = c("MM", "NM", "CY") ) bam = scanBam( bamFile, param = param )
then I get the following error:
Error in value[[3L]](cond) : unknown tag type 'B'
Is there a simple way to be able to access the tags that are not of type i or Z using Rsamtools?
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
The current parser does not support type B, but if you provide a small example sam or bam file (just a few records, to martin.morgan at roswellpark dot org, or point me to a publicly available example) then I'll be happy to implement this.
Thank you so much for your kindness. I sent a few example files with a few records each.