RC an entire bam file?
2
0
Entering edit mode
2.1 years ago

Hello everyone,

I've been trying for ages to get IGV to show me reverse complemented reads, but I only find the button to RC the reference track and corresponding genes track.

I'm trying to prepare a screenshot for a poster presentation and the gene whose mutation I'm interested in showing is on the reverse strand so IGV is showing the RC of the mutation, which is confusing...

Is there a more elegant solution than what I'm considering?

Thanks in advance and merry weekend! Joel

sam genome complement viewer alignment bam Reverse • 1.2k views
ADD COMMENT
3
Entering edit mode
2.1 years ago

Pull out the reads that aligned, realign them to a smaller ref that runs the right way.

ADD COMMENT
0
Entering edit mode

Or to be thorough, re-do the alignments with an index of complementary strand of original reference.

ADD REPLY
0
Entering edit mode

I am trying this, let's see how it works out :-] Thanks!

ADD REPLY
0
Entering edit mode
2.1 years ago

You can get IGV to color alignments by strand.

If you need full separation then filter your SAM file and create a distinct alignment file for each strand.

samtools view -b -F 16 all.bam > fwd.bam
samtools view -b -f 16 all.bam > rev.bam
ADD COMMENT
0
Entering edit mode

This will not fix the problem I think. Regardless of strandedness, the reads were aligned to the reference genome and will show a G instead of a C. :(

ADD REPLY
0
Entering edit mode

The BAM format, by definition, was designed to refer to both positions and bases on the forward strand.

Inside the BAM file, alignments on the reverse strand will store a reverse complemented version of the original read and only the flag indicates that the read originally came from the reverse strand.

This is so that you can easily compare two reads that overlap on the same region in different directions. The main use-case was variation detection and validation by visual inspection.

What exactly is your use case? Perhaps there is a different solution to it.

ADD REPLY
0
Entering edit mode

My use case is that I need the reads to be RC'd, so that the mutation I need to screenshot and put on my poster for presentation shows the right base. Now it shows a G, but it should show a C. What do you think of swbarnes2's suggestion? It should work...

ADD REPLY
0
Entering edit mode

my suggestion is to avoid displaying an IGV screenshot that shows mutations the "wrong" and "unnatural" way.

it would confuse everyone that knows how IGV works and would mislead everyone else that does not know how IGV works, then when they load their data is backwards,

olor the reads by strand, then it is immediately apparent how many reads carry the same mutation.

that is the whole point of showing the same mutation, it is much easier to the consistency across strands when the base is the same,

compare

CCCCCCCTC to CCCGCCGCTG

ADD REPLY
0
Entering edit mode

I was unclear, I meant that ALL the reads would be rc'd, or, equivalently, the reference genome rc'd before mapping. I tried this and it works. :-]

ADD REPLY

Login before adding your answer.

Traffic: 1817 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