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
3 votes
1 answer
101 views

Generating CIGAR strings for MSA with reference

I have a list containing the results of a MSA: ...
Fravadona's user avatar
  • 181
1 vote
0 answers
251 views

Extract read names and the associated nucleotides on specific positions from a BAM file (in R)

Let's assume I have a BAM file and several positions that I would like to examine more closely in this alignment. My goal is to find out whether these positions are on the same reads and which ...
wejt's user avatar
  • 11
6 votes
1 answer
727 views

Is there an efficient way to extract CIGAR strings for read pairs from bam files with python?

I am working with bam files and I have to check if reads of a specific position or their mates are soft clipped. So, I am looking for a fast way to extract the read pairs from a bam file in python. So ...
Mereven's user avatar
  • 61
1 vote
1 answer
390 views

What does presence/absence of black lines mean in IGV?

IGV (Integrated Genome Viewer) is a popular open-source tool for viewing alignment files. In my BAM file in IGV, some deletions have black lines running through them, and others don't. What causes ...
TimD1's user avatar
  • 292
1 vote
2 answers
710 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: ...
Jeni's user avatar
  • 135
4 votes
1 answer
3k 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?
fatemeh khoramdel's user avatar
5 votes
2 answers
392 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 ...
EB2127's user avatar
  • 1,393
7 votes
2 answers
3k 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 ...
ShanZhengYang's user avatar
5 votes
1 answer
169 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 ...
mattm's user avatar
  • 754
6 votes
1 answer
891 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 ...
mattm's user avatar
  • 754