Skip to content

Commit dbf3155

Browse files
committed
fix doctest imports
1 parent 15cdf8f commit dbf3155

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pgscatalog.core/src/pgscatalog/core/lib/_normalise.py

+4
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def check_duplicates(variants):
9090
def drop_hla(variants):
9191
"""Drop HLA alleles from a list of ScoreVariants
9292
93+
>>> from .scorevariant import ScoreVariant
9394
>>> variant = ScoreVariant(**{"effect_allele": "A", "effect_weight": 5, "accession": "test", "row_nr": 0, "chr_name": "1", "chr_position": 1})
9495
>>> list(drop_hla([variant])) # doctest: +ELLIPSIS
9596
[ScoreVariant(..., effect_allele=Allele(allele='A', is_snp=True), ...
@@ -116,6 +117,7 @@ def drop_hla(variants):
116117
def assign_other_allele(variants):
117118
"""Check if there's more than one possible other allele, remove if true
118119
120+
>>> from .scorevariant import ScoreVariant
119121
>>> variant = ScoreVariant(**{"chr_position": 1, "rsID": None, "chr_name": "1", "effect_allele": "A", "effect_weight": 5, "other_allele": "A", "row_nr": 0, "accession": "test"})
120122
>>> list(assign_other_allele([variant]))[0] # doctest: +ELLIPSIS
121123
ScoreVariant(..., effect_allele=Allele(allele='A', is_snp=True), other_allele=Allele(allele='A', is_snp=True), ...)
@@ -142,6 +144,7 @@ def remap_harmonised(variants, harmonised, target_build):
142144
In this case chr_name, chr_position, and other allele are missing.
143145
Perhaps authors submitted rsID and effect allele originally:
144146
147+
>>> from .scorevariant import ScoreVariant
145148
>>> variant = ScoreVariant(**{"chr_position": 1, "rsID": None, "chr_name": "2", "effect_allele": "A", "effect_weight": 5, "accession": "test", "hm_chr": "1", "hm_pos": 100, "hm_rsID": "testrsid", "hm_inferOtherAllele": "A", "row_nr": 0})
146149
>>> variant
147150
ScoreVariant(..., effect_allele=Allele(allele='A', is_snp=True), other_allele=None, ...
@@ -171,6 +174,7 @@ def check_effect_allele(variants, drop_missing=False):
171174
"""
172175
Odd effect allele:
173176
177+
>>> from .scorevariant import ScoreVariant
174178
>>> variant = ScoreVariant(**{"effect_allele": "Z", "effect_weight": 5, "accession": "test", "row_nr": 0, "chr_name": "1", "chr_position": 1})
175179
>>> list(check_effect_allele([variant], drop_missing=True)) # doctest: +ELLIPSIS
176180
[]

0 commit comments

Comments
 (0)