Closed dengzq1234 closed 1 month ago
Thanks @dengzq1234
Before I merge this PR, I'd like to understand the couple of things I mentioned before, and also we should understand why after this change the ncbiquery test fails (which seems to be from your change in line 135 of
tests/test_ncbiquery.py
, that I imagine you had a reason to do):$ pytest tests/test_ncbiquery.py [...] tests/test_ncbiquery.py ......F. [...] ____________________________________________ Test_ncbiquery.test_merged_id _____________________________________________ self = <tests.test_ncbiquery.Test_ncbiquery testMethod=test_merged_id> def test_merged_id(self): ncbi = NCBITaxa(dbfile=DATABASE_PATH) t1 = ncbi.get_lineage(649756) > self.assertEqual(t1, [1, 131567, 2, 1783272, 1239, 186801, 3085636, 186803, 207244, 649756]) E AssertionError: Lists differ: [1, 131567, 2, 1783272, 1239, 186801, 186802, 186803, 207244, 649756] != [1, 131567, 2, 1783272, 1239, 186801, 3085636, 186803, 207244, 649756] E E First differing element 6: E 186802 E 3085636 E E - [1, 131567, 2, 1783272, 1239, 186801, 186802, 186803, 207244, 649756] E ? ^ ^^^ E E + [1, 131567, 2, 1783272, 1239, 186801, 3085636, 186803, 207244, 649756] E ? ^^ + ^^ test_ncbiquery.py:135: AssertionError
I changed it because I updated my ncbi taxonomy database, I wonder if it would effect test_ncbiquery.taxa.sqlite
? For my latest update of ncbi taxonomy, I won't pass this unitest if I don't change it.
@jordibc Already update with the next ncbi unitest
this PR is to solve #750
It includes the following features:
Convert methods in
GTDBTaxa()
which involves meaningless numeric ids to internal methods, such as:get_lineage_translator()
->_get_lineage_translator()
get_name_translator()
->_get_name_translator()
translate_to_names()
->_translate_to_names()
Convert input of
get_rank()
from numeric id to string id inGTDBTaxa()
, for example:Add flag
ignore_unclassified
in bothNCBITaxa()
andGTDBTaxa()
, whenignore_unclassified=True
,annotate_tree()
will igore empty annotation of leaves