Coverage for src/python/ensembl/vep/models/overlap/overlap_consequence.py: 100%

14 statements  

« 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"""OverlapConsequence class.""" 

15 

16from __future__ import annotations 

17 

18from attrs import define, field 

19 

20from ensembl.vep.models import Feature 

21from ensembl.vep.common import ConsequenceImpact 

22 

23 

24@define(kw_only=True, auto_attribs=True) 

25class OverlapConsequence: 

26 """ 

27 A predicted consequence of an overlap between a feature and a base feature. 

28 

29 This is typically used to represent the consequence of a variant on a transcript, but it can be used 

30 for any type of feature overlap. 

31 

32 Attributes: 

33 term (str): 

34 The SO term for the consequence, e.g. "missense_variant". 

35 accession (str): 

36 The SO accession for the consequence, e.g. "SO:0001583". 

37 is_default (bool): 

38 Whether this consequence is the default consequence for the overlapping feature. 

39 Only one consequence can be default, 

40 for transcript variation allele it is generally intergenic_variant. 

41 rank (int): 

42 The rank of the consequence, with 1 being the most severe. 

43 tier (int): 

44 The tier of the consequence. If tier 1 consequence are assigned, 

45 then no tier 2 consequences will be checked or assigned. 

46 impact (ConsequenceImpact | None): 

47 The predicted impact of the consequence, e.g. "HIGH", "MODERATE", "LOW", "MODIFIER". 

48 feature_type (type[Feature] | None): 

49 The type of the overlapped feature that is affected by this consequence type, e.g. Transcript. 

50 overlapping_feature_type (type[Feature] | None): 

51 The type of the overlapping feature that causes this consequence type, e.g. VariationAllele. 

52 """ 

53 

54 term: str 

55 accession: str 

56 is_default: bool = field(default=False) 

57 rank: int = field(default=0) 

58 tier: int = field(default=0) 

59 impact: ConsequenceImpact | None = field(default=ConsequenceImpact.LOW) 

60 feature_type: type[Feature] | None = field(default=Feature) 

61 overlapping_feature_type: type[Feature] | None = field(default=Feature)