Description
Return exact reference-consumed CIGAR span and discrepancy.
Sequence alignments distinguish flag bits, query/reference coordinates, CIGAR operations and scoring conventions. A single flag or length contribution does not establish a complete valid alignment; consuming reference bases differs from consuming query bases or counting a gap penalty.
Return exact reference-consumed CIGAR span and discrepancy.
When to use this tool
Use CIGAR Reference Consumption Gap when checking the stated alignment flag, operation, span or gap-scoring convention.
How to use the tool and how it works
- Enter cigar, suppliedReferenceSpan. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read consumedReferenceDecimal, gapDecimal. Use the output convention below.
Return exact reference-consumed CIGAR span and discrepancy. Accept supported operations with positive 1..128-digit lengths and nonnegative exact supplied span; sum M/D/N/=/X lengths with BigInt, gap = consumed-supplied.1
SAM/BAM defines separate flag, quality and CIGAR conventions. This local operation does not validate a complete alignment record.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| cigar | Cigar | Required. Text; maximum UTF-16 length 8192. |
| suppliedReferenceSpan | Supplied Reference Span | Required. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| consumedReferenceDecimal | Consumed Reference Decimal | Required. Text; maximum UTF-16 length 8192. |
| gapDecimal | Exact consumed-reference span minus supplied span, serialized as signed decimal text. | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"cigar": "3S6M1P1I4M",
"suppliedReferenceSpan": "10"
},
"output": {
"consumedReferenceDecimal": "10",
"gapDecimal": "0"
}
} Limitations and assumptions
- This checks only reference consumption, not clipping placement, query span, reference bounds or a complete SAM/BAM record.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use a complete SAM/BAM and reference-aware validator or alignment method with explicit clipping, coordinate and scoring policies for full processing.
References
-
Calculation and input contract: bioinformatics/cigar-reference-consumption-gap — tool.io
-
SAM/BAM format specification, version 1.6 — SAM/BAM Format Specification Working Group
Similar or alternative tools
- CIGAR Skipped Reference Length
Sum skipped-reference CIGAR lengths.
- CIGAR Soft Clip Length
Sum soft-clipped CIGAR lengths.