Hi Mark, The error message comes from function bam_translate in bam_sort.c, where it attempts to update the read's PG tag. Apparently the PG tag does not match any of the @PG entries in your header: https://github.com/samtools/samtools/blob/develop/bam_sort.c
Can you share the output of: $ samtools view -H your_file.bam If that is very long, at least show us the @PG lines: $ samtools view -H your_file.bam | grep "^@PG" And the entry/entries for the read giving the error: $ samtools view your_file.bam | grep "^1_1101_10360_49339_1" Regards, Peter On Wed, Nov 5, 2014 at 8:39 AM, Mark Ravinet <mravi...@nig.ac.jp> wrote: > Hi Peter, > > Apologies, I should have mentioned that in my last email. It was samtools 1.0 > > Thanks > > Mark > >> On 5 Nov 2014, at 17:34, Peter Cock <p.j.a.c...@googlemail.com> wrote: >> >> Hi Mark, >> >> Which version of samtools was this? >> >> Peter >> >> On Wed, Nov 5, 2014 at 3:44 AM, Mark Ravinet <mravi...@nig.ac.jp> wrote: >>> Hello all, >>> >>> When running samtools sort to sort a large number of bam files using the >>> following line: >>> >>> samtools sort -T sorting -O bam -o $outfile $infile >>> >>> >>> I get the following error messages printed to the screen: >>> >>> [bam_sort_core] merging from 2 files... >>> [bam_translate] PG tag "A" on read "1_1101_10360_49339_1" encountered with >>> no corresponding entry in header, tag lost >>> >>> >>> The number of reads appears to remain the same between the sorted/unsorted >>> bams. Can anyone give any insight into what this means? >>> >>> Many thanks >>> >>> Mark >>> ------------------------------------------------ >>> Mark Ravinet >>> Postdoctoral Research Fellow >>> Ecological Genetics Laboratory >>> National Institute of Genetics >>> Yata 1111, Mishima, Shizuoka >>> 411-8540, Japan >>> Email: mravi...@nig.ac.jp >>> Skype: mark.ravinet >>> +44 (0) 7841 67 58 63 (UK) >>> +81 (0) 90 7211 3590 (Japan) >>> ------------------------------------------------ >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Samtools-help mailing list >>> Samtools-help@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/samtools-help >>> > ------------------------------------------------------------------------------ _______________________________________________ Samtools-help mailing list Samtools-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/samtools-help