Questions tagged [cigar]

A string present in each line of a SAM/BAM alignment file used to describe the similarity and differences between a read and the region it aligns to in the reference genome. The CIGAR string records the matching, mismatching and indels in the read compared to the reference. For example, a CIGAR string could encode a read that has 50 matches, followed by a deletion, followed by another 50 matching bases.

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

How do I find all supplementary mappings of a chimeric long (ONT) read mapped with NGMLR?

Unlike this guy How do I find split reads? I have done a lot of reading before asking this question. I'm aware that the FLAG will tell me if a read is supplementary and the CIGAR has information ...
1
vote
2answers
54 views

Extract end position from CIGAR

I was wondering how could I obtain the end position of an alignment using its start position and its CIGAR String. If an alignment present some soft clipping, for example: ...
2
votes
1answer
1k views

How do I find split reads?

How can I detect a split read in a BAM file? Is there any sign in the CIGAR string that describes split read?
5
votes
2answers
183 views

Is there a Python/R package with the ability to convert an alignment and reference into a CIGAR?

I'm writing a python function from scratch to do this, but I feel like this must exist in some standard bioinformatics library already. In principle, this is a simply regex operation which many must ...
7
votes
1answer
2k views

Extracting the CIGAR string from a BAM via Python?

Is there a standard method in Python to extract a CIGAR string from the BAM? There are great libraries which parse the CIGAR, e.g. https://pypi.python.org/pypi/cigar/0.1 ...
5
votes
1answer
115 views

Is the optional SAM NM field strictly computable from the MD and CIGAR?

From SAM Optional Fields Specification the NM field is Edit distance to the reference, including ambiguous bases but excluding clipping Assuming both the MD and CIGAR are present, is the edit ...
6
votes
1answer
491 views

How should the SAM MD tag match the CIGAR string?

I am trying to understand how the MD:Z tag is used. The following is from the SAM Optional Fields Specification, which gives an example but is not thorough. The MD field aims to achieve SNP/indel ...