[BioC] finding out which tags are in a bam-file

Martin Morgan mtmorgan at fhcrc.org
Fri Nov 18 23:09:23 CET 2011

On 11/18/2011 06:51 AM, Hubert Rehrauer wrote:
> Hi everybody
> I want to load bam-files from different sources into GappedAlignments,
> but don't know which tags are actually available in the bam-File.
> With scanBam this is no problem, if the tag was not in the bam it just
> puts NULL in that place. The readGappedAlignments method however fails.

If I understand correctly,

 > example(scanBam)
 > readBamGappedAlignments(fl,param=ScanBamParam(tag="FO"))
Error in rep.int(NA, count) : incorrect type for second argument

which is probably a bug and will be fixed.

> Now the question: Is there a method to find out which tags are actually
> present in a bam-file?????

I don't think so; the bam file would have to be parsed for this. Could 
be a feature to be added...


> regards,
> hubert
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor

Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793

More information about the Bioconductor mailing list