GATK variant calling on multiple bam files
0
0
Entering edit mode
3.6 years ago
User000 ▴ 700

Hello,

I am trying to do variant calling using GATK on a list of several hundreds of bam files like this:

bob.dup.bam
smith.dup.bam
will.dup.bam

This is the command line:

java -jar /Tools/gatk-4.1.9.0/gatk-package-4.1.9.0-local.jar HaplotypeCaller -L chr1:1-2096 -R ref.fasta -I bam/bam_list --min-base-quality-score 20 -O output.out

I get this error:

A USER ERROR has occurred: Input files reference and reads have incompatible contigs: No overlapping contigs found.
  reference contigs = [chr1, chr2, chr3, chr4, chrUn]
  reads contigs = []

However, if I run for a single bam file separately it works.

java -jar /Tools/gatk-4.1.9.0/gatk-package-4.1.9.0-local.jar HaplotypeCaller -L chr1:1-2096 -R ref.fasta -I bam/bob.dup.bam --min-base-quality-score 20 -O output.out

What is the problem and how to solve this?

gatk bam • 2.6k views
ADD COMMENT
0
Entering edit mode

At least one of the BAMs has incompatible contigs in its header. Look through the headers of each BAM to find the incompatible one(s).

ADD REPLY
0
Entering edit mode

I checked the header, it is ok, also because when I run all of them a as single bam files all of them work (for now I am working with 5 files to check). I suspect it is not recognizing the list of bam files?

ADD REPLY
1
Entering edit mode

You're right, -I doesn't seem to take a file, just a string of BAM names. Try either a comma separated list of names or a glob (like *.bam).

ADD REPLY
1
Entering edit mode

I'm not sure the latest version of HC is able to read a '*.list' suffix (this would be a bug)

can you please try

(..) `awk '{printf(" -I %s ",$0);}'  bam/bam_list  ` (...)

instead of

(..) -I bam/bam_list  (...)
ADD REPLY
1
Entering edit mode

Oh... I realised what was wrong after your answer Pierre.... my bam list file name was bam_list (which works just fine for freebayes and bcftools), but GATK wants bam.list... Now it seems working... a very stupid mistake and all my pipeline was not working for days... :)

ADD REPLY
2
Entering edit mode

All it took was changing the file name from bam_list to bam.list?

ADD REPLY
0
Entering edit mode

yeah.... I am not sure this particularity is specified in the GATK documentation... or may be I was not careful enough..

ADD REPLY

Login before adding your answer.

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