On 3 Jan 2017, at 16:21, Holbrook J. <j.holbr...@soton.ac.uk> wrote:
> I am trying to manipulate .bam files created by ernebs5 
> (http://erne.sourceforge.net) aligning against hg19.
> I am running samtools 1.3.1
[...]
> 
> samtools sort -T /dev/shm/jostemp -@ 8 -m 4G -o sample1b_paired_sorted.bam 
> Sample1b_unmasked.bam
> 
> I get an error message that starts:
> [bam_sort_core] merging from 16 files……
> [E::trans_tbl_add_sq] @SQ SN (chr1) found in binary header but not text 
> header.
> [E::trans_tbl_add_sq] @SQ SN (chr10) found in binary header but not text 
> header.

This error message does not exist in samtools 1.3.1.  So it is in fact an 
earlier version of samtools that is being run, and it would be instructive to 
use the samtools-1.3.1 you think you have installed

        /full/path/to/desired/version/of/samtools sort -T etc etc

and see if this version accepts these files.

> I’ve also checked out this which seems similar but not the same: 
> https://github.com/samtools/samtools/issues/548

Issue 548 is about BAM files generated with RSEM, which writes BAM files 
without textual headers, and led to the change in samtools 1.3.1 to just deal 
with the situation rather than producing the error messages above.  It is not 
unlikely that ernebs5 similarly writes BAM files without textual @SQ headers 
and actually using samtools-1.3.1 will solve your problem.

It would be useful if you could post the first 100K or so of 
Sample1b_unmasked.bam somewhere we can download it and examine the raw headers.

TL;DR i.e. what Rob said.  But note that when you output SAM with samtools 
view, samtools appends basic @SQ headers if there aren't already any.  So Rob's 
`samtools view -H ... | grep '^@SQ'` will display some headers whether the file 
contains textual headers or not.  Removing the grep will allow some educated 
guesses to be made about whether @SQ headers seen with samtools view are 
synthetic or really in the input file: if there are any other (e.g. @RG) 
headers *after* the block of @SQ headers, or if the @SQ headers have any fields 
beyond SN and LN, then they are definitely real.

    John

-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to