Skip to content

seeming inconsistency between CIGAR, nM, MD #2684

Description

@tsgouros

Hi:

I have observed what seem like inconsistencies with the CIGAR string, and the nM and MD results, and I'm not sure how to reconcile what I see with the STAR documentation. Maybe there are command-line controls for the quality of match that I do not (yet) know about? I don't know if this is the right forum to ask these questions, but I have not yet found a better one. Please point me there if this is not appropriate.

For example, here is a part of a reference genome and two 150bp sequences that were reported as "150M", which I thought meant they just matched, letter for letter. I've tried to indicate where the mismatches are.

REFERENCE 
123456789012345678901234567890.23456789012345678901234.67890.23.567890123456789012345678901.345678901.3456789.12345678901234567.901234567890123456.890
CTATTTAGGTAGCGCCTCGTGAACTCATCTCCGGGGGTAGAGCACTGTTTCGGCAAGGGGGTCATCCCGACTTACCAACCCGATGCAAACTGCGAATACCGGAGAATGTTATCACGGGAGACACACGGCGGGTGCTAACGTCCGTCGTGA

CIGAR:150M   nM:i:10   MD:Z:30C23A5G2A27G9G25G18G3
123456789012345678901234567890.23456789012345678901234.67890.23.567890123456789012345678901.345678901.3456789.12345678901234567.901234567890123456.890
                              C                       A     G  A                           G         G                         G                  G
CTATTTAGGTAGCGCCTCGTGAACTCATCTTCGGGGGTAGAGCACTGTTTCGGCTAGGGGATCCTCCCGACTTACCAACCCGATGCAAACTACGAATACCGAAGAATGTTATCACGGGAGACACACGACGGGTGCTAACGTCCGTCATGA
IIIII99IIII-9IIIII9IIIII-I9I99-99-II-9I-I99I-I-I-II9---9I-99-9--99--99-9--999-I-9----999--999III9II--I9II--9I--99--9I99I9I-I9II-I-9-9I9I9IIII99-II-I-I

CIGAR:150M   nM:i:8    MD:Z:30C23A36G9G48
123456789012345678901234567890.23456789012345678901234.678901234567890123456789012345678901.345678901.3456789.1234567890123456789012345678901234567890
                              C                       A                                    G         G       
CTATTTAGGTAGCGCCTCGTGAACTCATCTTCGGGGGTAGAGCACTGTTTCGGCTAGGGGGTCATCCCGACTTACCAACCCGATGCAAACTACGAATACCGAAGAATGTTATCACGGGAGACACACGGCGGGTGCTAACGTCCGTCGTGA	
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII

The MD strings seem correct to me, but why does the CIGAR string report "150M" and the nM report 10 and 8 when it seems like it should be 8 and 4?

Here's another example, while I'm here. These two strings seem to have the same number of mismatches, but nM reports are different and both have 150M CIGAR strings.

REFERENCE
1234567890123456789012345678901234567890123456789..2345678901234567890123456789012345678901234567..0123456789012345678901234567890123456789012345678901
GATTCCGACTTCATGGAGTCGAGTTGCAGACTCCAATCCGGACTACGACGCACTTTATGAGGTCCGCTTGCTCTCGCGAGGTCGCTTCTCTTTGTATGCGCCATTGTAGCACGTGTGTAGCCCTGGTCGTAAGGGCCATGATGACTTGACG

CIGAR:150M    nM:i:10  MD:Z:49G0C46G0C51
1234567890123456789012345678901234567890123456789..2345678901234567890123456789012345678901234567..0123456789012345678901234567890123456789012345678901
                                                 GC                                              GC
GATTCCGACTTCATGGAGTCGAGTTGCAGACTCCAATCCGGACTACGACATACTTTATGAGGTCCGCTTGCTCTCGCGAGGTCGCTTCTCTTTGTATATGCCATTGTAGCACGTGTGTAGCCCTGGTCGTAAGGGCCATGATGACTTGAC
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII9IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII

CIGAR:150M nM:i:8 MD:Z:48G0C46G0C52
123456789012345678901234567890123456789012345678..1234567890123456789012345678901234567890123456..90123456789012345678901234567890123456789012345678901
                                                GC                                              GC
ATTCCGACTTCATGGAGTCGAGTTGCAGACTCCAATCCGGACTACGACATACTTTATGAGGTCCGCTTGCTCTCGCGAGGTCGCTTCTCTTTGTATATGCCATTGTAGCACGTGTGTAGCCCTGGTCGTAAGGGCCATGATGACTTGACG
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII9IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII

I would have thought these would both have nM=4, but one is 8 and the other 10. Is there a document somewhere that explains this in detail?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions