Resort bam from another bam header
1
0
Entering edit mode
10.6 years ago

I've got two bam files I want to compare, A and B, but bam B comes in a different order of chromosomes as the ones in A. What is the best tool to resort bam B in the same order of chromosomes as the one in bam A?

bam • 2.7k views
ADD COMMENT
1
Entering edit mode
10.6 years ago

The closest tool I can think of is the ReorderSam function from picard tools.

ADD COMMENT
0
Entering edit mode
ADD REPLY
0
Entering edit mode

Don't the sort orders needed to be the same for ReplaceSamHeader (like samtools reheader)? If they aren't you'd end up messing up all of the alignments, since chromosomes aren't actually stored in the alignments in BAM files (just an index into the header).

ADD REPLY
0
Entering edit mode

Yes, you are right, I've been bitten by that before and still forgot about it.

ADD REPLY

Login before adding your answer.

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