Skip to content
Prev 3351 / 21312 Next

[Bioc-devel] Can not import gapped bam, Rsamtools bug or my parameters?

On 04/28/2012 07:23 PM, Martin Morgan wrote:
Sorry, looking at your code a little more closely...

                  ranges<-IRanges(
                          start=bam[[rangeName]][["pos"]],
                          width=bam[[rangeName]][["qwidth"]]
                  )

isn't correct -- qwidth is the width of the query (short read), not the 
width of the alignment. The width of the alignment needs to be 
calculated using the cigar; see GenomicRanges::cigarToWidth. But 
readGappedAlignments (also readBamGappedAlignments / readBamGappedReads) 
will do this work for you.

Martin