Hi Peter,

Thanks for your reply.

Grepped lines from a typical header are as follows:

> @PG   ID:GSNAP        PN:gsnap        VN:2013-11-27   CL:gsnap -d stick_ref 
> --maxsearch=10 -M 0 -m 5 -t 6 -n 1 -A sam --quiet-if-excessive 
> --terminal-threshold=10 -i 2 ./samples_081014/CHA13_N_PA_F.fq
> 

Similarly, the grepped line of one of the entry errors is as follows:

> 1_1101_10360_49339_1  16      groupI  11728   40      90M     *       0       
> 0       
> TCAATTATATTTAATATGAATAGTTACACCGTTAAACCAGCGTTGCATTTTTCCTCTCAAGGAATCCCTAGAGCCGCTTGCGTGCCTGCA
>       
> C>DCDDCDCAEDDDEDEEECDCCA>BA?DDDDCBA?CADFFHFFEHGIIGIGJJJIGFIHHCIJIIHGHFJJJIJIIJJIGGFFCCIHFH
>       MD:Z:90 NH:i:1  HI:i:1  NM:i:0  SM:i:40 XQ:i:40 X2:i:0  XO:Z:UU PG:Z:A

I guess the error seems to have something to do with the “A” tag at the end of 
the entry? However I ran these commands on a group of bams including several 
which do not produce this error and they also have the “A” tag and an identical 
header. Here is an example which produces no errors:

> @PG   ID:GSNAP        PN:gsnap        VN:2013-11-27   CL:gsnap -d stick_ref 
> --maxsearch=10 -M 0 -m 5 -t 6 -n 1 -A sam --quiet-if-excessive 
> --terminal-threshold=10 -i 2 ./samples_081014/CHA117_N_PA_F.fq

And a typical read:

> 1_1101_19655_2193_1   0       groupXX 10637098        40      90M     *       
> 0       0       
> TGCAGGAGAAAGATAGTGGACTAACTATGCCCCACACGCTACACACTCACACATCCTACACCACATAGTTGCACTAATAATTTGCATGTT
>       
> HHHIGG<BFHHG99BF2<?*1?B<99C4?4DBFHBHGIIIC8FFCA;=7@77?EDEDDCD;>AC;;@>(-;CCC>>:5@>A#########
>       MD:Z:90 NH:i:1  HI:i:1  NM:i:SM:i:40    XQ:i:40 X2:i:0  XO:Z:UU PG:Z:A

Thanks for your help so far!

Mark 


> On 5 Nov 2014, at 19:31, Peter Cock <p.j.a.c...@googlemail.com> wrote:
> 
> 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

Reply via email to