merenlab / anvio

An analysis and visualization platform for 'omics data
http://merenlab.org/software/anvio
GNU General Public License v3.0
423 stars 144 forks source link

[BUG] global command line args in anvi-setup-kegg-data #2127

Closed semiller10 closed 11 months ago

semiller10 commented 11 months ago

Short description of the problem

anvi-self-test --suite metabolism fails in anvio-dev at anvi-setup-kegg-data because --no-progress is an unknown argument in parsing the selected "mode."

anvi'o version

Anvi'o .......................................: hope (v7.1-dev)
Python .......................................: 3.10.12

Profile database .............................: 38
Contigs database .............................: 21
Pan database .................................: 16
Genome data storage ..........................: 7
Auxiliary data storage .......................: 2
Structure database ...........................: 2
Metabolic modules database ...................: 4
tRNA-seq database ............................: 2

Detailed description of the issue

The way in which anvi-setup-kegg-data parses arguments for different modes does not recognize global anvi'o arguments beyond --debug (line 89).

Trying to solve this problem by using the anvio.argparse ArgumentParser as the subparser in line 156 rather than the argparse ArgumentParser throws a new error.

TypeError: ArgumentParser.__init__() got an unexpected keyword argument 'usage'

A clunky fix to this problem could be to create a list of global anvi'o arguments in anvio.__init__ that can be ignored in line 89.

Hopefully @ivagljiva will have a better idea of how to fix this code of Ozcan's that she repurposed in the context of this script. I wonder if this is also a problem in other scripts that use this code now that anvi'o has multiple global arguments.

ivagljiva commented 11 months ago

Thank you for catching this @semiller10 . I fixed it with 4e95a06. I basically catch all the global args and remove them. Not a very elegant solution, but the only one we have time for.