Skip to content

Results

Methods:

  • mutations

    Extracts all frameshift mutations as structured objects.

mutations

Python
mutations(sequence: bytes) -> list[Mutation]

Extracts all frameshift mutations as structured objects. Requires the original raw sequence to determine VCF anchored alleles.

A vectorized structure representing a batch of gene predictions.

This structure uses a Structure-of-Arrays (SoA) layout. Fields that have variable counts per gene (e.g. insertions and deletions) are exposed as flat arrays alongside parallel "offsets" arrays defining the slice boundaries (i.e. ragged arrays).

Attributes:

  • deletions_flat (NDArray[uint64]) –

    Flat array containing all deletion coordinates across all genes.

  • deletions_offsets (NDArray[uint64]) –

    Array of shape (N+1,) containing the slice offsets for deletions_flat.

  • ends (NDArray[uint64]) –

    Array of shape (N,) containing the end coordinates of each gene.

  • frames (NDArray[uint64]) –

    Array of shape (N,) containing the frame of each gene.

  • insertions_flat (NDArray[uint64]) –

    Flat array containing all insertion coordinates across all genes.

  • insertions_offsets (NDArray[uint64]) –

    Array of shape (N+1,) containing the slice offsets for insertions_flat.

  • scores (NDArray[float64]) –

    Array of shape (N,) containing the prediction scores of each gene.

  • sequence_indices (NDArray[uint64]) –

    Array of shape (N,) containing the index of the sequence in the batch for each gene.

  • starts (NDArray[uint64]) –

    Array of shape (N,) containing the start coordinates of each gene.

  • strands (NDArray[int8]) –

    Array of shape (N,) containing the strands of each gene (1 for forward, -1 for reverse).

deletions_flat property

Python
deletions_flat: NDArray[uint64]

Flat array containing all deletion coordinates across all genes.

deletions_offsets property

Python
deletions_offsets: NDArray[uint64]

Array of shape (N+1,) containing the slice offsets for deletions_flat.

ends property

Python
ends: NDArray[uint64]

Array of shape (N,) containing the end coordinates of each gene.

frames property

Python
frames: NDArray[uint64]

Array of shape (N,) containing the frame of each gene.

insertions_flat property

Python
insertions_flat: NDArray[uint64]

Flat array containing all insertion coordinates across all genes.

insertions_offsets property

Python
insertions_offsets: NDArray[uint64]

Array of shape (N+1,) containing the slice offsets for insertions_flat.

scores property

Python
scores: NDArray[float64]

Array of shape (N,) containing the prediction scores of each gene.

sequence_indices property

Python
sequence_indices: NDArray[uint64]

Array of shape (N,) containing the index of the sequence in the batch for each gene.

starts property

Python
starts: NDArray[uint64]

Array of shape (N,) containing the start coordinates of each gene.

strands property

Python
strands: NDArray[int8]

Array of shape (N,) containing the strands of each gene (1 for forward, -1 for reverse).

Represents a frameshift mutation detected by the ab initio model.

Attributes:

  • alt_allele (str) –

    The VCF alternate allele (conceptual FGS fix)

  • annotation (str) –

    Snippy-style text annotation

  • codon_idx (int) –

    1-based codon index where the frame breaks

  • mut_type (str) –

    "ins" (assembly has extra base) or "del" (assembly missing base)

  • pos (int) –

    1-based VCF anchored position

  • ref_allele (str) –

    The VCF reference allele

alt_allele property

Python
alt_allele: str

The VCF alternate allele (conceptual FGS fix)

annotation property

Python
annotation: str

Snippy-style text annotation

codon_idx property

Python
codon_idx: int

1-based codon index where the frame breaks

mut_type property

Python
mut_type: str

"ins" (assembly has extra base) or "del" (assembly missing base)

pos property

Python
pos: int

1-based VCF anchored position

ref_allele property

Python
ref_allele: str

The VCF reference allele