ensembl.vep.sources.file.fasta package#

FASTA-backed sequence sources.

Submodules#

ensembl.vep.sources.file.fasta.sequence module#

FASTA-backed sequence source.

class ensembl.vep.sources.file.fasta.sequence.FastaSequenceSource(*, cache=None, file_path=None, adaptor=FastaParser())[source]#

Bases: SequenceSource

Sequence source backed by a FASTA file.

A region the FASTA does not carry gets UNKNOWN_REGION_LENGTH rather than no length. A slice cannot be built without a sequence-region length, and the reader raises when one cannot be resolved – so a single contig missing from the FASTA would abort the entire run. Reporting a placeholder lets those variants be read; they pair with nothing – the transcript file has no such contig either – and the runner writes them through unannotated.

Variables:
  • file_path (str | Path | None) – FASTA file path.

  • unknown_regions (set[str]) – Regions asked for that the FASTA does not carry.

adaptor: FastaParser#
close()[source]#

Release FASTA metadata and derived sequence caches.

file_path: str | Path | None#
property sequence_region_names: frozenset[str]#

Return names advertised by the FASTA metadata index.

unknown_regions: set[str]#
ensembl.vep.sources.file.fasta.sequence.UNKNOWN_REGION_LENGTH = 2147483647#

Length reported for a sequence region the FASTA does not carry.

Its value does not matter: nothing annotates against these regions, it exists only so a slice can be built at all.