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] Error in setting up kegg database in new anvio (Marie) #2137

Closed Harpreet525 closed 11 months ago

Harpreet525 commented 11 months ago

Short description of the problem

Error in setting up the kegg database in freshly installed latest version of anvio probably because of the naming error

anvi'o version

Anvio 8

anvi-self-test --version

anvi-self-test --suite mini worked fine.

System info

Linux Ubuntu , installation of anvio via pip and by default as indicated in anvio guide.

Detailed description of the issue

File "/bettik/PROJECTS/pr-microbio/Singhhar/miniconda3/envs/anvio/lib/python3.10/site-packages/anvio/biochemistry/reactionnetwork.py", line 1148, in set_up os.mkdir(parent_dir) FileNotFoundError: [Errno 2] No such file or directory: '/bettik/PROJECTS/pr-microbio/Singhhar/miniconda3/envs/anvio/lib/python3.10/site-packages/anvio/data/MISC/KEGG'

Here, the reactionnetwork.py is locating the data stored in the path /bettik/PROJECTS/pr-microbio/Singhhar/miniconda3/envs/anvio/lib/python3.10/site-packages/anvio/data/MISC/KEGG.

However, it is unable to find the path because of the case sensitive letter "MISC" in the path. By default, the files are stored in data/misc/KEGG. But the reactionnetwork.py is locating it at data/MISC/KEGG.

Regards

meren commented 11 months ago

Thanks for the report, @Harpreet525.

This is interesting. Self note: If we can reproduce it, probably os.makedirs() instead of os.mkdir() will solve the problem. I'm not sure why the MISC/KEGG wouldn't be there, though.

ivagljiva commented 11 months ago

I probably missed this because I am always testing with the misc/KEGG directory already in place rather than from a fresh install without that directory :)

I fixed both the incorrect case for misc in the path KODatabase.default_dir, AND I switched the mkdir function to makedirs. Currently testing it with anvi-setup-kegg-data --kegg-data-dir TEST_KEGG -T 6 --mode modeling, but it will take about two hours to finish, so we won't know for a while if it worked. I will report back.

meren commented 11 months ago

Thank you very much for your quick action, @ivagljiva!

Harpreet525 commented 11 months ago

i had replaced and changed the case of data/MISC/KEGG path with data/misc/KEGG in the reactionnetwork.py script and the kegg database setup completed successfully. Hoping this was the correct method !

Regards

Harpreet525 commented 11 months ago

Total number of KOs/entry files ..............: 26,252 KEGG KO database version .....................: Release 108.0+/10-03, Oct 23 KEGG KO list .................................: /bettik/PROJECTS/pr-microbio/Singhhar/miniconda3/envs/anvio/lib/python3.10/site-packages/anvio/data/misc/KEGG/KO_REACTION_NETWORK/ko_list.txt KEGG KO info .................................: /bettik/PROJECTS/pr-microbio/Singhhar/miniconda3/envs/anvio/lib/python3.10/site-packages/anvio/data/misc/KEGG/KO_REACTION_NETWORK/ko_info.txt Table of select KEGG KO data .................: /bettik/PROJECTS/pr-microbio/Singhhar/miniconda3/envs/anvio/lib/python3.10/site-packages/anvio/data/misc/KEGG/KO_REACTION_NETWORK/ko_data.tsv Archived KEGG KO entry files .................: /bettik/PROJECTS/pr-microbio/Singhhar/miniconda3/envs/anvio/lib/python3.10/site-packages/anvio/data/misc/KEGG/KO_REACTION_NETWORK/ko_entries.tar.gz

✓ anvi-setup-kegg-data took 1:45:28.341934

ivagljiva commented 11 months ago

That was exactly the right way to fix it @Harpreet525 :) Looks like it worked.

Now this issue should be fixed in anvio-dev as well!

meren commented 11 months ago

Should I update the tar.gz archive attached to the release, @ivagljiva? We didn't do anything major in the repo, and it would be nice for people to not have to switch to anvio-dev to address this issue. What do you think?

ivagljiva commented 11 months ago

I think that is a good idea @meren.

But please wait a little bit before you do it. I want my test to finish running just to make sure everything is A-OK first :)

(I'll ping you here when its done)

semiller10 commented 11 months ago

Thank you very much for catching that, @Harpreet525, and for the quick fix, @ivagljiva. Updating the release sounds fine, @meren.

ivagljiva commented 11 months ago

@meren , this should be good to go :) Feel free to update the release (and I will close this issue). Thank you all very much!

meren commented 11 months ago

this should be good to go :) Feel free to update the release (and I will close this issue)

Just for posterity, this is now done, and I updated the tarball attached to the release reflecting the tested changes implemented in 59640ec0e513088754e9e53734481a4ac0459996 and 7ca5a8d30c6f1434f2af5e8b61490e10c66834c8.