Biostar Beta. Not for public use.
How To Reorder Bam File Contigs For The Gatk Pipeline
1
Entering edit mode
21 months ago
win • 810
India

i have a sorted & read group added bam file and when i try to run the following GATK command on it

java -jar GenomeAnalysisTK.jar -T RealignerTargetCreator -R hg19.fa -o read.bam.list -I read.sorted.bam

I get the following message

input file reads and reference have incompatible contigs

i can see that in my bam file the contig order is as follows chr1,.......chrX,.......chr18,.......chrY,.....chr22,.....chrM whereas the reference contig order is chr1,chr2........chr22,chrX,chrY,chrM

does sorting the bam file not take care of this issue?

any ideas how this can issue can be fixed?

thanks in advance.

bam contigs • 5.2k views
ADD COMMENTlink
5
Entering edit mode
13 months ago
National Institutes of Health, Bethesda…

You'll need to use a FASTA reference file that includes the same chromosome names and orders as your BAM file. If they differ, as yours do, you'll need to use a tool like picard ReorderSam:

http://picard.sourceforge.net/command-line-overview.shtml#ReorderSam

Note that sorting and ordering are two related but different topics. A BAM file can be sorted but not in the correct order; this is the case you have.

ADD COMMENTlink
0
Entering edit mode

Does that mean if I have chr1, chr2 ... in my reference file, but chr1, chr3 in my BAM file. The file could be sorted by position but not ordered correctly?

ADD REPLYlink
0
Entering edit mode
21 months ago
win • 810
India

Thanks. I did try and run ReorderSam, it runs for sometime and then stops, the bam file contains nothing. Any ideas?

ADD COMMENTlink
0
Entering edit mode

I have no idea what your problem might be. I recommend that you find a local bioinformatics collaborator who can work through the first dataset with you.

ADD REPLYlink
0
Entering edit mode

the issue is sorted for now, it started working when i changed the TMP_DIR value in picard. I'll try and finish rest of the analysis and post here.

ADD REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.1