Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yqy6611 opened this issue Dec 16, 2023 · 3 comments
Open

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

yqy6611 opened this issue Dec 16, 2023 · 3 comments
Assignees

Comments

@yqy6611
Copy link

yqy6611 commented Dec 16, 2023

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

  • A reaction network will be made from protein orthology annotations in the
    contigs database.
    Contigs database .............................: /mnt/b351004a-4dc6-4bcf-add3-21fc26707773/Eric_meta/GB_GCA_001567165_1.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/MODELSEED

  • METABOLIC REACTION NETWORK STATISTICS

  • Gene calls and KEGG Ortholog (KO) annotations
    Total gene calls in genome ...................: 2,254
    Genes annotated with protein KOs .............: 1,170
    Genes in network .............................: 625
    Protein KOs annotating genes .................: 991
    KOs in network ...............................: 540

  • ModelSEED reactions in network and KO sources
    Reactions in network .........................: 5,033
    Mean reactions per KO ........................: 12.4
    Stdev reactions per KO .......................: 34.5
    Max reactions per KO .........................: 337

[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
Copy link
Author

yqy6611 commented Apr 3, 2024

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

@semiller10
Copy link
Contributor

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.

@yqy6611
Copy link
Author

yqy6611 commented May 24, 2024

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)

  • METABOLIC REACTION NETWORK STATISTICS

  • Gene calls and KEGG Ortholog (KO) annotations
    Total gene calls in genome ...................: 2,250
    Genes annotated with protein KOs .............: 1,602
    Genes in network .............................: 860
    Protein KOs annotating genes .................: 1,381
    KOs in network ...............................: 752

  • ModelSEED reactions in network and KO sources
    Reactions in network .........................: 6,288
    Mean reactions per KO ........................: 12.3
    Stdev reactions per KO .......................: 32.6
    Max reactions per KO .........................: 377

  • Reaction alias source comparison
    Reactions aliased by KEGG reaction ...........: 0
    Reactions aliased by EC number ...............: 6,288
    Rxns aliased by both KEGG rxn & EC number ....: 0
    Reactions aliased only by KEGG reaction ......: 0
    Reactions aliased only by EC number ..........: 6,288
    KEGG reactions contributing to network .......: 0
    Mean reactions per KEGG reaction .............: nan
    Stdev reactions per KEGG reaction ............: nan
    Max reactions per KEGG reaction ..............: 0
    EC numbers contributing to network ...........: 712
    Mean reactions per EC number .................: 9.4
    Stdev reactions per EC number ................: 25.1
    Max reactions per EC number ..................: 377

  • Reaction reversibility
    Reversible reactions .........................: 4,446
    Irreversible reactions .......................: 1,842

  • Metabolites and localization
    Metabolites in network .......................: 4,464
    Cytoplasmic metabolites ......................: 4,461
    Extracellular metabolites ....................: 23
    Exclusively cytoplasmic metabolites ..........: 4,441
    Exclusively extracellular metabolites ........: 3
    Cytoplasmic/extracellular metabolites ........: 20

  • Metabolite consumption and production
    Consumed metabolites .........................: 4,051
    Produced metabolites .........................: 4,093
    Both consumed & produced metabolites .........: 3,680
    Exclusively consumed metabolites .............: 371
    Exclusively produced metabolites .............: 413
    Metabolites consumed or produced by 1 rxn ....: 1,897
    Metabolites consumed or produced by 2 rxns ...: 1,095
    Metabolites consumed or produced by 3+ rxns ..: 1,472

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants