Hi,
I am trying to merge two bam files using Samtools,
After merging the files, it showed that “An error occurred setting the metadata for this dataset” and the info showed as below
“[bam_merge_core] Order of targets in file 1.sam caused coordinate sort to be lost
[E::hts_idx_push] Chromosome blocks not continuous”
Both bam files have been sorted using Samtools sort but the error still occur… Can someone help me with this? Many thanks in advance!!
Plus this FAQ has more help. Tool error? Try Sorting Your Inputs Most is not needed anymore (Galaxy automatically coordinate sorts BAMs), but there are many ways to sort BAMs in other ways, intentionally or not, and this can help you to get back to a coordinate sort.
Better to get each of your BAMs created correctly and matched up near the start of an analysis, with minimal extra manipulations. Hunting for and fixing problems, later on, is non-trivial and not always successful or even possible. Example: You could just end up with “odd results” that are not obvious to detect.