Entering edit mode
9.0 years ago
jyu429
▴
120
Hi, I'm trying to merge these two bam files and I did the command
samtools merge merged.bam file1.bam file2.bam
However, it gives me this error:
[trans_tbl_init] @SQ SN (hg38_gold start=chr14:105786368 strand=+) found in binary header but not text header.
I'm not sure how to get around this. Is there an option I need to turn on to suppress/fix this?
I just checked the code. This should happen whenever you have a chromosome missing between the files that you want to merge. You might be able to get around this with
samtool merge merged.bam file2.bam file1.bam
, but if not then it makes sense to reheader at least one of the files to have all of the chromosomes (put the missing ones at the end, don't change the order of any of the existing ones!) and then merge.Or you can try MergeSamFiles commans from picard tools. It is better in handling headers than samtools.
Indeed, picard tends to be a bit friendlier with merging headers.
What version are you using?
Version 1.1. Is that too outdated?
Can you update to 1.2 and see if that fixes it?
I updated it and it gives me the same error.