Cigar And Sequence Length Are Inconsistent In Sam File
2
0
Entering edit mode
11.6 years ago
xiaoyanli82 ▴ 10

I use bwa to algin Illumina PE reads to references, commands are:

bwa aln -o 1 -l 32 -k 2 -t 16 -L -i 5 reference R1>R1.sai

bwa aln -o 1 -l 32 -k 2 -t 16 -L -i 5 reference R2>R2.sai

bwa sampe -a 900 -r "@RG\tID:E${k}a_PE\tSM:wheat_${k}\tLB:E${k}\tPI:350" -f PE.sam R1.sai R2.sai R1 R2

samtools view -b -u -t ref.fa.fai -S PE.sam -o -|samtools sort -m 2G - PE.bam

There is an error report :Line 12270525, sequence length 98 vs 89 from CIGAR

So the command was used : head -12270525 PE.sam |tail -1 and the result was:

HWI-ST1255:50:C0M14ACXX:8:1114:10824:26280 147 scaffold883 24446 15 2S22M50I2M13S = 24349 -121 AAAAAGAAAAAGAAAAAGAAAAAGAAAAAGGAAGGAAGTTGTGGAAAATGAAATGAAAGAAAAAGAAAAAGAAAAAGAAAAAAAAAAGAAAAAGAAA EEDEDEFFDBFHEGHHHGJIIJIGEJJJIJHIIJJJIIHHJIIIIIIFGIGCGIJJJIIIIJIIEJJIFJIIIIIJJJJJJJJJJHGHHGFFFFFC@C RG:Z:E4a_PE XT:A:M NM:i:50 SM:i:15 AM:i:15 XM:i:0 XO:i:1 XG:i:50 MD:Z:24

The sequnce length and CIGAR are both 98, what's the problem?

Thank you !

sam • 5.9k views
ADD COMMENT
0
Entering edit mode

what's your version of BWA ?

ADD REPLY
0
Entering edit mode
11.6 years ago
Michael 55k

2+22+50+2+13 = 89 So the CIGAR is 89 and the the sequence length is 98. However the CIGAR shouldn't be shorter than the sequence. So, as recommended, could you try to do the alignment again using the latest version of BWA and check if the problem is fixed?

ADD COMMENT
0
Entering edit mode
11.5 years ago
xiaoyanli82 ▴ 10

I tried my data using the latest version and the problem is fixed, thank you Michael Dondrup.

ADD COMMENT

Login before adding your answer.

Traffic: 1908 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6