Question: Issues with SAM to BAM conversion
gravatar for rahneli
3.4 years ago by
United States
rahneli0 wrote:

I am receiving the following errors (below) when I attempt to convert my SAM file to a BAM file, none of which I have ever received before using this protocol. These errors result in an unusable file much smaller than it should be. Any thoughts would be appreciated!

[E::sam_parse1] missing SAM header [W::sam_read1] parse error at line 1 [bam_sort_core] truncated file. Continue anyway.



galaxy samtools • 3.1k views
ADD COMMENTlink modified 3.4 years ago by Jennifer Hillman Jackson25k • written 3.4 years ago by rahneli0

I recently ran into the same issue. I was running Tophat on Cloudman (ami-d1c77fba) and unknowingly filled up the storage volume (the EBS volume with variable storage size set at start-up) and got this message in the file descriptions:


Log: tool progress 

[bam_header_read] EOF marker is absent. The input is probably truncated. 

[bam_index_core] truncated file? Continue anyway. (-2) 


Log: tool progress [2015-10-12 20:57:37] Beginning TopHat run (v2.0.14)


The resultant output BAM file from Tophat was missing data for many chromosomes. Shouldn't a truncated file be flagged as erroneous (red), since data is excluded without direction from the user? 

ADD REPLYlink written 3.1 years ago by Mo Heydarian830
gravatar for Jennifer Hillman Jackson
3.4 years ago by
United States
Jennifer Hillman Jackson25k wrote:


It could be that if when data was uploaded to the server it was truncated. So, double check the size versus that locally before upload. Reload using FTP and review the upload status reported by the FTP client. This is always a good first check, although I wouldn't expect this exact error message for this reason.

Next, if the SAM file is missing headers, these can be replaced with tools in the Picard tool group. Do that as needed or as a test.

Finally, SAM datasets do not need to be sorted before using this particular tool, but running the sort sam tool could provide more clues (another test on the dataset to confirm that it is complete and intact, although really any simple tool that executes with a sam input dataset would work for this purpose).

If working on the public Main Galaxy server, and none of these resolve the issue, a bug report can be sent in and we can also take a look. If working on another server, you could also see if the issue can be replicated on Main, to determine if the problem is server specific, plus this would allow you to submit a bug report. Note what you have tried from the above and include a link to this post. 

Hopefully this helps to troubleshoot, but let us know. If you send in a bug report, we'll respond either there or here, but by all means will keep the private details in direct communications. 

Best, Jen, Galaxy team

ADD COMMENTlink written 3.4 years ago by Jennifer Hillman Jackson25k

Hi Jennifer, I am having the same problem as the above user.  I tried using the Picard tool group to replace the header, but this does not seem to fix the file.  The file continues to be truncated.  Could you please help? Thank you.

ADD REPLYlink written 3.1 years ago by jocelyntkim0
Please log in to add an answer.


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