I’m sure this is probably straightforward, but I can’t figure out how to access the read group information on a per-read basis within a BAM file. I can get it from the header, but I can’t determine how to use aux or any other record method to get that info. I realize this might change after issues #170 and #209 are implemented, but what’s the current approach for this?
jlboat
2 Answers:
Assuming the read group information is stored in RG:Z:
fields, it can be accessed via bam::record::Record::aux(b"RG")
. This method should return a Aux::String(<&'a [u8]>)
containing the read group information as raw bytes.
jch-13
Thank you! I thought I had tried that, but it’s working for me now so I’m not complaining.
jlboat
Read more here: Source link