Question: Cigar And Sequence Length Are Inconsistent In Sam File
0
gravatar for xiaoyanli82
5.5 years ago by
xiaoyanli820 wrote:

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 • 3.7k views
ADD COMMENTlink modified 17 months ago by Biostar ♦♦ 20 • written 5.5 years ago by xiaoyanli820

what's your version of BWA ?

ADD REPLYlink written 5.5 years ago by Pierre Lindenbaum114k
0
gravatar for Michael Dondrup
5.5 years ago by
Bergen, Norway
Michael Dondrup45k wrote:

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 COMMENTlink written 5.5 years ago by Michael Dondrup45k
0
gravatar for xiaoyanli82
5.5 years ago by
xiaoyanli820 wrote:

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

ADD COMMENTlink written 5.5 years ago by xiaoyanli820
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1426 users visited in the last hour