Question: Error When Running Gatk
gravatar for huboqiang
6.4 years ago by
huboqiang10 wrote:

I am Calling snps and indels using the pipeline referred in this post: In a step, realign, my code like this:

java -jar GenomeAnalysisTK.jar -T RealignerTargetCreator -R GRCh37.c.fasta -I ../s_4.sort.rg.bam -o ../s_4.intervals

And usually it cannot generate a interval file...(But I can really get it sometimes, I do not know why) The error message like this:

##### ERROR See the documentation (rerun with -h) for this tool to view allowable command-line arguments.
##### ERROR Visit our wiki for extensive documentation
##### ERROR Visit our forum to view answers to commonly asked questions
##### ERROR
##### ERROR MESSAGE: SAM/BAM file ../s_4/s_4.sort.rg.bam is malformed: Premature EOF; BinaryCodec in readmode; streamed file (filename not available)

I got s_4.sort.rg.bam by sorting it using samtools sort and then using picardtools AddOrReplaceReadGroups.jar .

Furthermore, if I samtools the file s_4.sort.rg.bam, the warning like this:

samtools view  s_4.sort.rg.bam | less
[bam_header_read] EOF marker is absent. The input is probably truncated.

So how to deal with this problem?

gatk error • 4.3k views
ADD COMMENTlink modified 2.5 years ago by Biostar ♦♦ 20 • written 6.4 years ago by huboqiang10
gravatar for matted
6.4 years ago by
Boston, United States
matted7.0k wrote:

Both tools are telling you the problem: your BAM file is truncated. Did you cancel the sort or Picard operation prematurely? Did it crash in the middle for some reason? Try making a new BAM file that isn't truncated. You can test out the new BAM file with Picard ValidateSamFile.

ADD COMMENTlink written 6.4 years ago by matted7.0k

But my raw bam files are also truncated. How could I deal with that? By the way, why I can run -T UnifiedGenotyper but cannot run -T RealignerTargetCreator

ADD REPLYlink written 6.4 years ago by huboqiang10

The answer is the same - remake the BAM (perhaps from the raw reads). 9 times out of 10, this means something bad happened and you shouldn't want to continue your analysis with the defective file.

I don't know why GATK is pickier on one command than another.

ADD REPLYlink written 6.4 years ago by matted7.0k
gravatar for Neilfws
3.8 years ago by
Sydney, Australia
Neilfws48k wrote:

I just had a similar error after using Picard to remove duplicate information from BAM files. My issue was that the BAM index was then out of date; the error was fixed by reindexing the BAM file using samtools.

ADD COMMENTlink written 3.8 years ago by Neilfws48k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1247 users visited in the last hour