merenlab / anvio

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

[BUG] ValueError occurred after running anvi-reaction-network #2190

Open yqy6611 opened 11 months ago

yqy6611 commented 11 months ago

Short description of the problem

"ValueError: max() arg is an empty sequence" was encountered after running anvi-reaction-network.

anvi'o version

Anvi'o .......................................: marie (v8-dev) Python .......................................: 3.10.13

Profile database .............................: 39 Contigs database .............................: 22 Pan database .................................: 17 Genome data storage ..........................: 7 Auxiliary data storage .......................: 2 Structure database ...........................: 2 Metabolic modules database ...................: 4 tRNA-seq database ............................: 2

System info

Ubuntu 22.04; following https://anvio.org/install/linux/dev/.

Detailed description of the issue

"ValueError: max() arg is an empty sequence" was encountered after running anvi-reaction-network. Attached is the verbose:

(anvio-dev) e2s2@e2s2-super-server-1:/mnt/b351004a-4dc6-4bcf-add3-21fc26707773/Eric_meta$ anvi-reaction-network -c '/mnt/b351004a-4dc6-4bcf-add3-21fc26707773/Eric_meta/GB_GCA_001567165_1.db' --ko-dir '/mnt/cc061462-beb3-49ab-9318-5c7bf54d8588/database/anvio-KEGG/KO_REACTION_NETWORK' --modelseed-dir '/mnt/cc061462-beb3-49ab-9318-5c7bf54d8588/database/MODELSEED' --overwrite-existing-network

Reference KEGG KO database directory .........: /mnt/cc061462-beb3-49ab-9318-5c7bf54d8588/database/anvio-KEGG/KO_REACTION_NETWORK Reference ModelSEED database directory .......: /mnt/cc061462-beb3-49ab-9318-5c7bf54d8588/database/MODELSEED

[16 Dec 23 21:21:54 Counting reactions from each alias source] ... /home/e2s2/miniconda3/envs/anvio-dev/lib/python3.10/site-packages/numpy/core/fromnumeric.py:3432: RuntimeWarning: Mean of empty slice. return _methods._mean(a, axis=axis, dtype=dtype, /home/e2s2/miniconda3/envs/anvio-dev/lib/python3.10/site-packages/numpy/core/_methods.py:190: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) /home/e2s2/miniconda3/envs/anvio-dev/lib/python3.10/site-packages/numpy/core/_methods.py:265: RuntimeWarning: Degrees of freedom <= 0 for slice ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof, /home/e2s2/miniconda3/envs/anvio-dev/lib/python3.10/site-packages/numpy/core/_methods.py:223: RuntimeWarning: invalid value encountered in divide arrmean = um.true_divide(arrmean, div, out=arrmean, casting='unsafe', /home/e2s2/miniconda3/envs/anvio-dev/lib/python3.10/site-packages/numpy/core/_methods.py:257: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) Traceback (most recent call last): File "/home/e2s2/Softwares/anvio/bin/anvi-reaction-network", line 112, in main() File "/home/e2s2/Softwares/anvio/bin/anvi-reaction-network", line 29, in main constructor.make_network( File "/home/e2s2/Softwares/anvio/anvio/biochemistry/reactionnetwork.py", line 2412, in make_network network = self.make_contigs_database_network( File "/home/e2s2/Softwares/anvio/anvio/biochemistry/reactionnetwork.py", line 2757, in make_contigs_database_network stats['Max reactions per KEGG reaction'] = max_reactions_per_kegg_reaction = max(reaction_counts) ValueError: max() arg is an empty sequence

yqy6611 commented 8 months ago

Can someone please help me figure this out? Seems like this issue persists. Many thanks!

semiller10 commented 6 months ago

Sorry for the delay, @yqy6611. This should be fixed in the dev branch with https://github.com/merenlab/anvio/commit/cb8786a75ad7d441429e3b25176e41f57d8a4172. Try again after a git pull. I'm in the midst of major upgrades to the reaction network which I'll merge into the dev branch in the next few weeks.

yqy6611 commented 6 months ago

Sorry for the delay, @yqy6611. This should be fixed in the dev branch with cb8786a. Try again after a git pull. I'm in the midst of major upgrades to the reaction network which I'll merge into the dev branch in the next few weeks.

Hello Samuel @semiller10,

Thanks for your reply. Now I encountered another error:

A reaction network will be made from protein orthology annotations in the contigs database. Contigs database .............................: anvio/S1/S1_bin_1_orig.db

Reference KEGG KO database directory .........: /mnt/cc061462-beb3-49ab-9318-5c7bf54d8588/database/anvio-KEGG/KO_REACTION_NETWORK Reference ModelSEED database directory .......: /mnt/cc061462-beb3-49ab-9318-5c7bf54d8588/database/anvio-modelseed/MODELSEED [24 May 24 15:04:54 Counting reactions from each alias source] ... /home/e2s2/miniconda3/envs/anvio-dev/lib/python3.10/site-packages/numpy/core/fromnumeric.py:3432: RuntimeWarning: Mean of empty slice. return _methods._mean(a, axis=axis, dtype=dtype, /home/e2s2/miniconda3/envs/anvio-dev/lib/python3.10/site-packages/numpy/core/_methods.py:190: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) /home/e2s2/miniconda3/envs/anvio-dev/lib/python3.10/site-packages/numpy/core/_methods.py:265: RuntimeWarning: Degrees of freedom <= 0 for slice ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof, /home/e2s2/miniconda3/envs/anvio-dev/lib/python3.10/site-packages/numpy/core/_methods.py:223: RuntimeWarning: invalid value encountered in divide arrmean = um.true_divide(arrmean, div, out=arrmean, casting='unsafe', /home/e2s2/miniconda3/envs/anvio-dev/lib/python3.10/site-packages/numpy/core/_methods.py:257: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount)

Traceback (most recent call last): File "/home/e2s2/Softwares/anvio/bin/anvi-get-metabolic-model-file", line 131, in main() File "/home/e2s2/Softwares/anvio/bin/anvi-get-metabolic-model-file", line 51, in main network: reactionnetwork.PangenomicNetwork = constructor.load_network( File "/home/e2s2/Softwares/anvio/anvio/biochemistry/reactionnetwork.py", line 5098, in load_network network = self.load_pan_database_network( File "/home/e2s2/Softwares/anvio/anvio/biochemistry/reactionnetwork.py", line 5475, in load_pan_database_network self_table = pan_db_info.get_self_table() File "/home/e2s2/Softwares/anvio/anvio/dbinfo.py", line 210, in get_self_table with DB(self.path, None, ignore_version=True) as database: AttributeError: 'ContigsDBInfo' object has no attribute 'path'

Do you know how to solve it? Many thanks!