This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Difference In Number Of Reads Using Samtools View And Igv

Hi

I extracted reads from a specific region from tophat alignment (bam files) using samtools view. The number of reads I get is 20. When I checked the region using IGV, the only subset of reads actually pass thorough the region. There are few reads that clearly end before the start of the region that I specified. I am very perplexed with this. Someone please enlighten me. Thanks

igv samtools rna-seq

5 answers

IGV ocassionally shows crazy things if it starts to run out of memory. Make sure that is not the case.

In general trust samtools first. You can verify from the coordinates whether the selection is correct.

Perhaps IGV is only showing reads flagged as primary alignments (the 0x100 bit in the FLAG) and samtools is showing all?

Are your reads trimmed or soft-clipped? If so, it's possible that one program is respecting that and the other is not.

IGV will hide soft-clipped base pairs by default. You can turn on "show soft clipped reads" in IGV's preferences panel and see if the result matches with samtools.

I think that igv only shows the reads that passed QC, try using samtools view -F"0x200" to check if you get the same reads.

Log in to answer this question.