Entering edit mode
7.6 years ago
reds.nik
▴
40
Good morning, I am struggling with samtools merge bam files. I am trying to merge few bam files, which have been generated with speedseq align. I have to indipendently merge two sets of bam files and while samtools successfully merge and index the first set, it exit with an error fot the second set, stating that on the input bam files is truncated. I ran samtools quickcheck on all the input bam files and they look fine, plus I checked with : tail file.bam | hexdump -C for the 28 bytes enconding the EOF and all the input files again look fine. Any suggestions?? thanks
Can you post the the hexdump output for the offending bam(s) together with your merge commandline?
Can you paste the verbatim error message here?
sure thanks. This is the end of the output
and the command that I used:
I used the same command for another set of bam files, which exited successfully
Odd, which version of samtools are you using? The end of the file looks correct.
I am using samtools 1.3.1, should I try with the last version? thanks
It's worth a try.
That should be your first reflex: update old tools :-)
(even if it doesn't solve your issue it doesn't hurt to work with up to date software)
Normally yes. However, the nays come with the fact that sometimes the s/w are not back compatible (e.g. changes in command line options like samtools sort) and still some other time they depend upon many other pkgs/tools (esp in R), which are not synchronized for version changes :-( E.g. One small change in mifi pkg creating havoc
ChAMP error in EPIC data import
A: ChAMP error in EPIC data import
If the new samtools doesn't solve the problem, you may try converting your offending bam to sam and then back to bam. It might be possible that your bam is malformed somewhere in the middle (which quickcheck can't detect).
I've trying both by merging the bam files with last version of samtools and by converting the offending bam to sam and then back to bam. I still get the error message.. I really have no idea what can be wrong with this file.
Why not try using some other alignment program (not sure what speedseq align is). It may be speedseq's fault somewhere else in the file.
If you can make a small enough example then create an issue on the samtools github repository and link to the file. The developers can get it sorted out for the next release then.