ensembl.vep.annotators.consequence package#

Consequence annotation facts, rules, and strategies.

The package has three dependency-ordered layers:

  • facts defines cost-tagged properties of a variant-feature overlap.

  • rules compiles Sequence Ontology terms into Boolean formulas over facts.

  • strategies provides interchangeable evaluators that produce identical consequences.

Importing this package registers every fact and every consequence.* annotator as an import side effect. strategies is imported last because it depends on facts and rules.

Subpackages#

Submodules#

ensembl.vep.annotators.consequence.graphs module#

Build graphs from consequence facts and rules.

This module assigns domain meaning to graph nodes and edges. Renderers remain responsible for visual presentation so ensembl.vep.render stays independent of consequence annotation.

ensembl.vep.annotators.consequence.graphs.catalogue_overview_graph(definitions=None)[source]#

Return every catalogue term and the direction of subsumption between them.

Return type:

Graph

ensembl.vep.annotators.consequence.graphs.derivation_graphs(trace, ruleset=None)[source]#

Return every rule decorated with its result for one overlap.

Each term keeps its own expression tree. Observed True and False expression nodes carry those states for the renderer; nodes whose atoms were never observed remain neutral. The graphs are grouped by outcome – emitted first, then firing terms removed by subsumption, then rules that did not fire – and retain rank order within each group.

Parameters:
  • trace (AnnotationTrace) – The derivation to draw.

  • ruleset (FactRuleSet | None, default: None) – The rules the trace was produced against, or None for the packaged catalogue’s.

Returns:

One decorated expression tree per rule.

Return type:

tuple[Graph, ...]

ensembl.vep.annotators.consequence.graphs.fact_dependency_graph()[source]#

Return the fact registry as a graph, columns ordered by cost tier.

Two edge kinds, and the distinction matters: deps is what must be computed first, while requires is the implication a staging planner exploits to settle a rule without computing the expensive atom at all.

Return type:

Graph

ensembl.vep.annotators.consequence.graphs.rule_graph(term, ruleset=None)[source]#

Return one rule as a Boolean expression tree.

The formula reads left to right: atoms feed ALL and ANY operators, which feed the term. Negation of an atom stays on that leaf; a separate NOT operator is reserved for a compound expression. Subsumption belongs to catalogue_overview_graph rather than this tree.

Parameters:
  • term (str) – The SO term to draw.

  • ruleset (FactRuleSet | None, default: None) – The rules to read, or None for the packaged catalogue’s.

Returns:

The term’s tree.

Return type:

Graph

Raises:

KeyError – If no rule is named term.

ensembl.vep.annotators.consequence.graphs.rule_graphs(ruleset=None)[source]#

Return one tree per rule, in catalogue rank order.

One graph each rather than a single merged diagram: the rules share atoms but not structure, so merging them produces a tangle that shows neither formula clearly.

Return type:

tuple[Graph, ...]