File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1069,7 +1069,7 @@ def __init__(self, db):
1069
1069
self ._sciname_keys = self .genome_table .argsort (order = ('SciName' ))
1070
1070
self ._omaid_re = re .compile (r'(?P<genome>[A-Z][A-Z0-9]{4})(?P<nr>\d+)' )
1071
1071
self ._db = db
1072
- self .approx_genome_matcher = self ._init_fuzzy_matcher_with_genome_infos ()
1072
+ self ._approx_genome_matcher = self ._init_fuzzy_matcher_with_genome_infos ()
1073
1073
1074
1074
def _init_fuzzy_matcher_with_genome_infos (self ):
1075
1075
values = []
@@ -1147,7 +1147,7 @@ def identify_genome(self, code):
1147
1147
return self .genome_from_SciName (code )
1148
1148
1149
1149
def approx_search_genomes (self , pattern ):
1150
- candidates = self .approx_genome_matcher .search_approx (pattern )
1150
+ candidates = self ._approx_genome_matcher .search_approx (pattern )
1151
1151
return [Genome (self ._db , self .genome_table [z [2 ]]) for z in candidates ]
1152
1152
1153
1153
def omaid_to_entry_nr (self , omaid ):
Original file line number Diff line number Diff line change @@ -412,3 +412,9 @@ def test_resolve_taxon_id(self):
412
412
def test_resolve_nonexisting_code (self ):
413
413
with self .assertRaises (UnknownSpecies ):
414
414
self .OmaIdMapper .identify_genome (2 )
415
+
416
+ def test_approx_search_genome (self ):
417
+ query = 'sacero cervesa'
418
+ expect = 'YEAST'
419
+ cands = self .OmaIdMapper .approx_search_genomes (query )
420
+ self .assertIn (expect , [g .uniprot_species_code for g in cands ])
You can’t perform that action at this time.
0 commit comments