@@ -90,6 +90,7 @@ def check_duplicates(variants):
90
90
def drop_hla (variants ):
91
91
"""Drop HLA alleles from a list of ScoreVariants
92
92
93
+ >>> from .scorevariant import ScoreVariant
93
94
>>> variant = ScoreVariant(**{"effect_allele": "A", "effect_weight": 5, "accession": "test", "row_nr": 0, "chr_name": "1", "chr_position": 1})
94
95
>>> list(drop_hla([variant])) # doctest: +ELLIPSIS
95
96
[ScoreVariant(..., effect_allele=Allele(allele='A', is_snp=True), ...
@@ -116,6 +117,7 @@ def drop_hla(variants):
116
117
def assign_other_allele (variants ):
117
118
"""Check if there's more than one possible other allele, remove if true
118
119
120
+ >>> from .scorevariant import ScoreVariant
119
121
>>> variant = ScoreVariant(**{"chr_position": 1, "rsID": None, "chr_name": "1", "effect_allele": "A", "effect_weight": 5, "other_allele": "A", "row_nr": 0, "accession": "test"})
120
122
>>> list(assign_other_allele([variant]))[0] # doctest: +ELLIPSIS
121
123
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):
142
144
In this case chr_name, chr_position, and other allele are missing.
143
145
Perhaps authors submitted rsID and effect allele originally:
144
146
147
+ >>> from .scorevariant import ScoreVariant
145
148
>>> 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})
146
149
>>> variant
147
150
ScoreVariant(..., effect_allele=Allele(allele='A', is_snp=True), other_allele=None, ...
@@ -171,6 +174,7 @@ def check_effect_allele(variants, drop_missing=False):
171
174
"""
172
175
Odd effect allele:
173
176
177
+ >>> from .scorevariant import ScoreVariant
174
178
>>> variant = ScoreVariant(**{"effect_allele": "Z", "effect_weight": 5, "accession": "test", "row_nr": 0, "chr_name": "1", "chr_position": 1})
175
179
>>> list(check_effect_allele([variant], drop_missing=True)) # doctest: +ELLIPSIS
176
180
[]
0 commit comments