khyox / recentrifuge

Recentrifuge: robust comparative analysis and contamination removal for metagenomics
http://www.recentrifuge.org
Other
86 stars 7 forks source link

Recentrifuge fails because of new NCBI taxonomy rank: subcohort #10

Closed khyox closed 5 years ago

khyox commented 5 years ago

Bug report

Bug summary

Recentrifuge fails while loading NCBI data from recent versions from NCBI taxdump files. A recent (last weeks) change in the NCBI taxdump files has triggered this error. The problem is the inclusion of a new taxonomic rank in NCBI Taxonomy: subcohort.

Actual outcome

Loading NCBI nodes...Traceback (most recent call last):
  File "/software/Python/Python-3.7.1/lib/python3.7/site-packages/recentrifuge/taxonomy.py", line 79, in read_nodes
    rank = Rank[_rank.upper().replace(" ", "_")]
  File "/software/Python/Python-3.7.1/lib/python3.7/enum.py", line 351, in __getitem__
    return cls._member_map_[name]
KeyError: 'SUBCOHORT'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/software/Python/Python-3.7.1/bin/rcf", line 812, in <module>
    main()
  File "/software/Python/Python-3.7.1/bin/rcf", line 736, in main
    collapse, excluding, including, args.debug)
  File "/software/Python/Python-3.7.1/lib/python3.7/site-packages/recentrifuge/taxonomy.py", line 40, in __init__
    self.read_nodes(nodes_file)
  File "/software/Python/Python-3.7.1/lib/python3.7/site-packages/recentrifuge/taxonomy.py", line 82, in read_nodes
    f'Unknown tax level {_rank}')
recentrifuge.rank.UnsupportedTaxLevelError: Unknown tax level subcohort

Expected outcome

Loading NCBI nodes... OK!
Loading NCBI names... OK!

Workaround

While I solve the issue, you can use a previous version of the NCBI taxonomy files from January. You can download it from HERE.

Acknoledgements

Thanks to Shashi Kanth from Theranosis for reporting this issue through email.

khyox commented 5 years ago

Solved by 0f0f233a85c6bf3c9383f5854ec657edb9b7bb6b in release 0.28.2