Coverage for src/python/ensembl/vep/workflow/build/haplo.py: 100%
16 statements
« prev ^ index » next coverage.py v7.17.2, created at 2026-11-18 14:41 +0000
« prev ^ index » next coverage.py v7.17.2, created at 2026-11-18 14:41 +0000
1# See the NOTICE file distributed with this work for additional information
2# regarding copyright ownership.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14"""The haplotype annotation workflow builder."""
16from __future__ import annotations
18from typing import Any
20from ensembl.vep.config import Config
21from ensembl.vep.workflow.base import Workflow
22from ensembl.vep.workflow.build.registry import register_workflow
23from ensembl.vep.workflow.tracks.base import AnnotationTrack, TrackResources
24from ensembl.vep.workflow.tracks.registry import build_tracks
26__all__ = ["HAPLO_TRACKS", "build_haplo_workflow"]
28HAPLO_TRACKS = ("consequence.transcript",)
29"""The kinds of track a haplotype run annotates with.
31Haplotype behaviour belongs to the tracks themselves rather than to runner or execution code, so
32this workflow differs from the default one only in which kinds it asks for.
33"""
36@register_workflow("haplo")
37def build_haplo_workflow(config: Config, resources: TrackResources) -> Workflow:
38 """Build the haplotype-aware workflow."""
39 tracks: list[AnnotationTrack[Any]] = []
40 for name in HAPLO_TRACKS:
41 tracks.extend(build_tracks(name, config, resources))
42 return Workflow(name="haplo", tracks=tuple(tracks))