Skip to content

Main content

SAM CIGAR Zero Length Flag Tool

Flag zero-length operations in a supplied parsed CIGAR stream; no alignment or sequence is reconstructed.

Loading tool…

Description

Locate zero-length CIGAR operation records.

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.

Locate zero-length CIGAR operation records.

When to use this tool

Use SAM CIGAR Zero Length Flag when checking the stated alignment flag, operation, span or gap-scoring convention.

How to use the tool and how it works

  1. Enter lengths, operations. Follow any array-alignment requirements below. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read hasZeroLength, zeroIndices. Inspect hasZeroLength before interpreting the associated values.

Locate zero-length CIGAR operation records. Require aligned nonempty arrays, nonnegative whole lengths and supported operation letters; zeroIndices lists exact zero lengths, hasZeroLength reports any.1

Input fieldMeaning and unitsAccepted input
lengthsNonnegative supplied whole operation lengths; zero values are reported diagnostically.Required. Array of safe integer; maximum items 256.
operationsOperationsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
Output fieldInterpretationReturned shape
hasZeroLengthHas Zero LengthRequired. Boolean.
zeroIndicesZero IndicesRequired. Array of safe integer; maximum items 256.
json
{
  "input": {
    "lengths": [
      10,
      0,
      5
    ],
    "operations": [
      "M",
      "I",
      "M"
    ]
  },
  "output": {
    "hasZeroLength": true,
    "zeroIndices": [
      1
    ]
  }
}

Limitations and assumptions

  • Lengths must be whole numbers; this zero-length diagnostic is not a complete valid CIGAR parser.
  • 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

  1. Calculation and input contract: bioinformatics/sam-cigar-zero-length-flag — tool.io

Similar or alternative tools