ensembl.vep.workflow.tracks.consequence package#
Consequence annotation tracks for overlapping features.
Submodules#
ensembl.vep.workflow.tracks.consequence.regulatory module#
The regulatory consequence annotation track.
A placeholder: RegulatoryOverlapFinder and the Regulatory model exist, but there is no
regulatory source, no annotator producing regulatory consequences, and no option asking for them,
so no run configures this track yet.
- ensembl.vep.workflow.tracks.consequence.regulatory.build_regulatory_tracks(config, resources)[source]#
Build no tracks: nothing configures regulatory consequences yet.
- Return type:
tuple[AnnotationTrack[Any],...]
ensembl.vep.workflow.tracks.consequence.transcript module#
The transcript consequence track and its candidate lookup.
The track holds the whole run path for transcript consequences: the transcript source, the caches that make a payload’s windows cheap, the pairing rule, the annotator, and the alleles the results are attached to. Pairing and the fetch window are built by their own functions as well, because explaining one derivation must use the same rule the run uses without wanting any of the caching around it.
- class ensembl.vep.workflow.tracks.consequence.transcript.TranscriptCandidateLookup(*, source, window, pool)[source]#
Bases:
objectCached transcript lookup for an input buffer.
- Variables:
source (TranscriptSource) – The transcript source every lookup reads.
window (int) – Bases added each side of an allele before querying.
pool (TranscriptPool) – Bounded cache of built transcripts, kept across payloads.
- begin_payload()[source]#
Release transcript state retained by the previous payload.
poolis deliberately not cleared: it is a bounded, per-worker cache of built transcripts meant to persist across payloads – see its own docstring and the module docstring oncaches/feature_pool.py.
- candidates(input_buffer)[source]#
Return each transcript that can pair with this one-region buffer.
- Return type:
list[Transcript]
- log_statistics()[source]#
Log the transcript pool’s running counters, cheap enough to do every payload.
- pool: TranscriptPool#
- source: GFF3TranscriptSource | GTFTranscriptSource#
- window: int#
- class ensembl.vep.workflow.tracks.consequence.transcript.TranscriptConsequenceTrack(*, identifier, overlap_finder, annotator, batch_size=256, lookup)[source]#
Bases:
OverlapAnnotationTrack[OverlapConsequence]Transcript consequence annotation track.
- Variables:
lookup (TranscriptCandidateLookup) – The source and caches this track’s finder reads through.
- attach(variations, results)[source]#
Attach consequences to the transcript overlaps of each allele.
- Raises:
TypeError – If a result holds an overlap this track cannot have produced.
- begin_payload(input_buffer)[source]#
Release the previous payload’s transcripts and fetch this payload’s in one pass.
Priming with the whole payload is what makes each annotation window a cache hit rather than another source query.
- lookup: TranscriptCandidateLookup#
- ensembl.vep.workflow.tracks.consequence.transcript.build_transcript_overlap_finder(config, candidates)[source]#
Return the rule pairing transcripts with alleles, over a caller’s own candidates.
The one definition of which
(allele, transcript)pairs exist. A run reaches it through its track, which fetches candidates from a cached source;vep explainreaches it with the transcripts it already found, so an explanation is never a second opinion about the pairing.- Parameters:
config (
Config) – The run’s configuration, for the distances and readthrough policy.candidates (
CandidateLookup[Transcript]) – Return the transcripts an input buffer may pair with.
- Returns:
The configured finder.
- Return type:
- ensembl.vep.workflow.tracks.consequence.transcript.build_transcript_tracks(config, resources)[source]#
Build the transcript consequence track a run always annotates with.
- Raises:
ValueError – If the transcript files are ambiguous or absent.
NotImplementedError – If the configured transcript provider has no reader yet.
- Return type:
tuple[AnnotationTrack[Any],...]
- ensembl.vep.workflow.tracks.consequence.transcript.transcript_candidate_window(config)[source]#
Return the bases added each side of an allele before transcripts are fetched.
The wider of the two distances: which one applies depends on each transcript’s strand, and the overlap finder is what decides that once they are fetched.
- Return type:
int