Rsamtools and BAM file discordance
1
0
Entering edit mode
7.5 years ago
biomagician ▴ 410

Hi,

I have this read in my BAM file. It maps on chromosome I.

I open this BAM file in IGV, and I can see the alignment on chromosome I.

But when I open this file in R with Rsamtools:

bamContigsCel <- Rsamtools::scanBam('output/alignment/pacbio/bwa/ref/bristolAssemblySorted.bam', param = Rsamtools::ScanBamParam(what = Rsamtools::scanBamWhat(), flag = Rsamtools::scanBamFlag(isMinusStrand = FALSE), tag = bamTags))[[1]]

I then check if the read maps to chromosome I in my R object but I cannot find it.

bamContigsCel$rname[bamContigsCel$qname == '000000F|arrow']
[1] II II IV
Levels: I II III IV MtDNA V X

But if I look at the BAM file, it's there. Why isn't Rsamtools importing my read into R?

samtools view bristolAssemblySorted.bam | grep -n '000000F' | head -c80
000000F|arrow   2064    I   336331  7   2926310H260M1774267H    *   0   0   GAAGCTGTCTAAACTTTGGC

Thanks. Best, C.

igv rsamtools samtools bam reads • 2.0k views
ADD COMMENT
3
Entering edit mode
7.5 years ago

Cross-posted elsewhere where I already answered.

ADD COMMENT

Login before adding your answer.

Traffic: 1541 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6