ensembl.vep.workflow.tracks package#
Annotation tracks and their registry.
Subpackages#
- ensembl.vep.workflow.tracks.consequence package
Submodules#
ensembl.vep.workflow.tracks.base module#
Annotation-track contracts and value objects.
A track owns everything one kind of annotation needs: the source it reads, whatever it caches between payloads, the rule pairing features with alleles, the annotator interpreting each pair, and where the results are attached for output. The worker running a track supplies only what every track shares – the reference sequence and the synonym map – so adding a kind of annotation adds a track and changes nothing above it.
- class ensembl.vep.workflow.tracks.base.AnnotationTrack[ResultT](*args, **kwargs)[source]#
Bases:
Protocol[ResultT]Configured annotation concern for one input buffer.
- annotate(input_buffer)[source]#
Return annotations for the input buffer.
- Return type:
list[TrackResult[ResultT]]
- attach(variations, results)[source]#
Attach this track’s results to the alleles output reads them from.
Every allele of every variation is assigned, so attaching no results releases what a rendered window retained.
- property identifier: str#
Return the unique configured track identifier.
- class ensembl.vep.workflow.tracks.base.OverlapAnnotationTrack[ResultT](*, identifier, overlap_finder, annotator, batch_size=256)[source]#
Bases:
Generic[ResultT]Overlap finder and annotator for one configured concern.
Specialised per kind of annotation: a subclass holds the source and caches its finder reads through, and attaches the results where that kind of overlap belongs.
- Variables:
identifier (str) – Unique name for this configured track instance.
overlap_finder (OverlapFinder[FeatureOverlap]) – Produce overlaps for an input buffer.
annotator (Annotator[ResultT]) – Interpret the overlaps found by this track.
batch_size (int) – Maximum overlaps materialised for one annotator call.
- annotate(input_buffer)[source]#
Return annotations for every overlap found in
input_buffer.- Return type:
list[TrackResult[ResultT]]
- attach(variations, results)[source]#
Reject results no subclass claimed, rather than dropping them silently.
- Raises:
NotImplementedError – Always. A track that produces results owns where they go.
- batch_size: int#
- begin_payload(input_buffer)[source]#
Prime nothing: a track caching between payloads overrides this.
- identifier: str#
- overlap_finder: OverlapFinder[FeatureOverlap]#
- class ensembl.vep.workflow.tracks.base.TrackResources(*, source_config, sequence_source, synonyms)[source]#
Bases:
objectResources shared by every track in one workflow.
Built once per worker and passed to each track builder: a source reads reference sequence and resolves sequence-region names through the same objects whichever track built it.
- Variables:
source_config (SourceConfig) – The configured sources, for the files and distances a track reads.
sequence_source (FastaSequenceSource | None) – The shared reference source, or None for a caller that can annotate without reference sequence.
synonyms (ChromosomeSynonyms) – The run’s sequence-region synonyms.
- sequence_source: FastaSequenceSource | None#
- source_config: SourceConfig#
- synonyms: ChromosomeSynonyms#
- class ensembl.vep.workflow.tracks.base.TrackResult[ResultT](*, track_identifier, overlap, annotations)[source]#
Bases:
Generic[ResultT]Annotation results for one overlap.
- Variables:
track_identifier (str) – Identifier of the producing track.
overlap (FeatureOverlap) – The overlap passed to the annotator.
annotations (tuple[ResultT, ...]) – Values emitted for the overlap.
- overlap: FeatureOverlap#
- track_identifier: str#
ensembl.vep.workflow.tracks.colocated module#
Co-located variant tracks.
A placeholder: ColocatedVariantOverlapFinder exists, but there is no known-variant source to
read and no option asking for one, so no run configures this track yet.
- ensembl.vep.workflow.tracks.colocated.build_colocated_tracks(config, resources)[source]#
Build no tracks: nothing configures co-located variants yet.
- Return type:
tuple[AnnotationTrack[Any],...]
ensembl.vep.workflow.tracks.custom module#
Custom annotation tracks.
A placeholder: CustomOverlapFinder and the CustomFeature model exist, but no reader parses
a --custom spec, so a run that asks for one is told rather than quietly annotating without it.
--custom is repeatable, so this is the builder that returns one track per occurrence once the
readers exist.
- ensembl.vep.workflow.tracks.custom.build_custom_tracks(config, resources)[source]#
Build no tracks, or refuse a run that asked for custom annotation.
- Raises:
NotImplementedError – If
--customwas given.- Return type:
tuple[AnnotationTrack[Any],...]
ensembl.vep.workflow.tracks.registry module#
Registry for annotation-track builders.
- ensembl.vep.workflow.tracks.registry.available_track_builders()[source]#
Return registered track builder names in sorted order.
- Return type:
tuple[str,...]
- ensembl.vep.workflow.tracks.registry.build_tracks(name, config, resources)[source]#
Build every track of one registered kind.
- Return type:
tuple[AnnotationTrack[Any],...]
- ensembl.vep.workflow.tracks.registry.register_track(name)[source]#
Register a track builder under
name.- Return type:
Callable[[Callable[[Config,TrackResources],tuple[AnnotationTrack[Any],...]]],Callable[[Config,TrackResources],tuple[AnnotationTrack[Any],...]]]
- ensembl.vep.workflow.tracks.registry.track_builder(name)[source]#
Return the track builder registered under
name.- Raises:
KeyError – If no builder is registered under that name.
- Return type:
Callable[[Config,TrackResources],tuple[AnnotationTrack[Any],...]]