ensembl.vep.config.sections.common package#

Options more than one command group reads.

A section shared across groups lives here so that one spelling, one default and one environment variable serve every command that reads it; a section only one group’s verbs share stays in that group’s own package. The synthetic corpus is here for that reason: explain, stats, corpus, catalogue and bench all read it.

Submodules#

ensembl.vep.config.sections.common.annotation module#

Annotation strategy and cache options.

The default is the columnar staged strategy with every cache off. The zone map, codon and mapper caches are all opt-in, because their benefit depends on the workload – the zone map pays for itself once a transcript is touched by more than one variant, which dense or targeted panels do and sparse genome-wide input does not. readthrough changes the modelled answer; the remaining options only affect the cost of reaching it.

class ensembl.vep.config.sections.common.annotation.AnnotationConfig(*, annotator='consequence.columnar-staged', batch_size=256, zone_map=False, zone_map_bytes=268435456, codon_cache=False, codon_cache_entries=65536, mapper_cache=False, mapper_cache_bytes=67108864, readthrough='none', early_subsumption_skip=False, fact_cost_override=False)[source]#

Bases: ConfigSection

Which annotator to run and which caches to give it.

Variables:
  • annotator (str) – Registered annotator name. Defaults to the columnar staged strategy.

  • batch_size (int) – Overlaps per chunk, for the batch-capable strategies.

  • zone_map (bool) – Enable the per-transcript positional-fact zone map. Disabled by default; worth enabling for inputs with many variants per transcript.

  • zone_map_bytes (int) – Byte budget for the zone map cache.

  • codon_cache (bool) – Enable the shared-codon edit cache.

  • codon_cache_entries (int) – Maximum codon cache entries.

  • mapper_cache (bool) – Enable the genomic-to-CDS mapper index cache.

  • mapper_cache_bytes (int) – Byte budget for the mapper index cache.

  • readthrough (str) – How far translation may run past a destroyed stop codon.

  • early_subsumption_skip (bool) – Skip rules already suppressed by a hit, for the staged strategy. Measured a small net loss; off by default.

  • fact_cost_override (bool) – Use the packaged measured fact costs instead of declared tiers.

annotator: str#
batch_size: int#
codon_cache: bool#
codon_cache_entries: int#
early_subsumption_skip: bool#
fact_cost_override: bool#
mapper_cache: bool#
mapper_cache_bytes: int#
readthrough: str#
section_name: ClassVar[str] = 'annotation'#
zone_map: bool#
zone_map_bytes: int#

ensembl.vep.config.sections.common.corpus module#

Registered corpus selection and construction options.

class ensembl.vep.config.sections.common.corpus.CorpusConfig(*, kind='synthetic.all', parameters=tuple(), fuzz=4000, step=13, genome_seed=7, boundary_seed=11, fuzz_seed=23, heavy_genome_seed=31, sweep_seed=41, corpus_dir=None)[source]#

Bases: ConfigSection

Which registered corpus to build, and how.

Consumed by ensembl.vep.corpus. Seeds are per stream rather than one global seed because the generator draws the chromosome sequence, the boundary variants and the fuzz variants from independent random.Random instances.

Variables:
  • kind (str) – Registered corpus name.

  • parameters (tuple[str, ...]) – Repeatable factory-owned KEY=VALUE parameters. JSON scalar values are decoded; other values remain strings.

  • fuzz (int) – Number of random variants to add to the default corpus.

  • step (int) – Position increment for the heavy-locus variant sweep.

  • genome_seed (int) – Seed for the default corpus’s chromosome sequence and transcript layout.

  • boundary_seed (int) – Seed for the adversarial boundary variants.

  • fuzz_seed (int) – Seed for the random fuzz variants.

  • heavy_genome_seed (int) – Seed for the heavy locus’s chromosome. Separate from genome_seed because the two corpora have always started from different seeds.

  • sweep_seed (int) – Seed for the heavy-locus variant sweep.

  • corpus_dir (Path | None) – Directory to load a saved corpus from, or write one to.

boundary_seed: int#
corpus_dir: Path | None#
fuzz: int#
fuzz_seed: int#
genome_seed: int#
heavy_genome_seed: int#
kind: str#
parameters: tuple[str, ...]#
section_name: ClassVar[str] = 'corpus'#
step: int#
sweep_seed: int#

ensembl.vep.config.sections.common.execution module#

Options controlling annotation-worker execution.

class ensembl.vep.config.sections.common.execution.ExecutionConfig(*, processes=1, start_method=StartMethod.AUTO, threads=1, buffer_size=5000, annotation_window=1024, max_in_flight=None, transcript_pool_bytes=134217728)[source]#

Bases: ConfigSection

Configure worker processes and optional independent-track threads.

Variables:
  • processes (int) – Number of worker processes. Perl VEP spells it --fork, accepted as a synonym so every layer writes this one field and the highest-precedence layer wins.

  • start_method (StartMethod) – Multiprocessing start method, or auto.

  • threads (int) – Threads available to independent annotation tracks in one worker.

  • buffer_size (int) – Maximum records in one sequence-region input buffer.

  • annotation_window (int) – Maximum variations retaining overlap graphs at one time.

  • max_in_flight (int | None) – Explicit submitted-buffer cap, or None to match worker count.

  • transcript_pool_bytes (int) – Byte budget for the per-worker cross-payload transcript pool. 0 disables pooling; every payload then rebuilds its own transcripts, matching behaviour before Stage 4.

annotation_window: int#
buffer_size: int#
max_in_flight: int | None#
processes: int#
section_name: ClassVar[str] = 'execution'#
start_method: StartMethod#
threads: int#
transcript_pool_bytes: int#

ensembl.vep.config.sections.common.logging module#

Logging options, read by every runner.

class ensembl.vep.config.sections.common.logging.LoggingConfig(*, log_level='info', log_file=None, verbose=False, quiet=False)[source]#

Bases: ConfigSection

How much the run says, and where it says it.

Variables:
  • log_level (str) – Root level for the ensembl.vep logger hierarchy.

  • log_file (Path | None) – File to append log records to, or None for stream output only. Perl VEP calls this --warning_file, which is accepted as a synonym.

  • verbose (bool) – Shorthand for log_level="debug". Also what turns derivation tracing on, since ensembl.vep.trace keys off the strategy logger being at DEBUG.

  • quiet (bool) – Shorthand for log_level="error".

effective_level()[source]#

Returns the level to apply once verbose/quiet are taken into account.

Returns:

One of LOG_LEVELS. quiet wins over verbose when both are set, so the

quieter of two conflicting requests is honoured.

Return type:

str

log_file: Path | None#
log_level: str#
quiet: bool#
section_name: ClassVar[str] = 'logging'#
verbose: bool#

ensembl.vep.config.sections.common.source module#

Variant and annotation source configuration.

class ensembl.vep.config.sections.common.source.SourceConfig(*, input_file=None, format=None, gff=None, gtf=None, fasta=None, synonyms=None, cache=False, dir_cache=None, database=False, custom=(), distance=(5000,))[source]#

Bases: ConfigSection

Input variant and annotation source configuration.

Variables:
  • input_file (Path | None) – Variant input, or None to use a synthetic corpus instead.

  • format (str | None) – Input format, or None to infer from the file extension. Perl VEP spells it --format; --input_format is accepted as a synonym.

  • gff (Path | None) – GFF3 file of transcripts.

  • gtf (Path | None) – GTF file of transcripts.

  • fasta (Path | None) – Reference FASTA, required alongside gff/gtf for sequence.

  • synonyms (Path | None) – File of sequence-region synonyms, one region per line: a reference name followed by a synonym, whitespace-separated. Perl VEP’s --synonyms format.

  • cache (bool) – Annotate from a VEP cache, a switch as in Perl VEP; the directory is dir_cache. Accepted, not implemented yet.

  • dir_cache (Path | None) – Directory of the VEP cache.

  • database (bool) – Annotate from an Ensembl database. Accepted, not implemented yet.

  • custom (tuple[str, ...]) – Custom annotation specs, one per --custom occurrence and each kept whole (Perl VEP’s spec is itself comma-separated). Accepted, not implemented yet.

  • distance (tuple[int, ...]) – How far outside a feature a variant may fall and still be paired with it, as Perl VEP’s --distance: one value for both directions, or upstream,downstream. --flank is accepted as a synonym. Read through upstream_distance and downstream_distance rather than directly.

cache: bool#
custom: tuple[str, ...]#
database: bool#
dir_cache: Path | None#
distance: tuple[int, ...]#
property downstream_distance: int#

Return bases past a feature’s 3’ end that still pair with it.

fasta: Path | None#
format: str | None#
gff: Path | None#
gtf: Path | None#
has_features()[source]#

Return whether a transcript source has been configured.

Returns:

True if either gff or gtf is set.

Return type:

bool

input_file: Path | None#
section_name: ClassVar[str] = 'source'#
synonyms: Path | None#
property upstream_distance: int#

Return bases before a feature’s 5’ end that still pair with it.