BenKaehler / q2-makarsa

A QIIME 2 plugin to generate and visualise microbial networks.
BSD 3-Clause "New" or "Revised" License
8 stars 4 forks source link

An error was encountered while running FlashWeave in Julia (return code 127) #59

Closed LenaFloerl closed 1 year ago

LenaFloerl commented 1 year ago

Hi,

thanks so much for wrapping FlashWeave - I'm super excited about this plugin! πŸš€

I installed q2-markarsa in a fresh qiime2-2023.2 environment and tried running it with my FeatureTable, without modifying any of the optional parameters but got the error: An error was encountered while running FlashWeave in Julia (return code 127)

I saw that it might mean that the command is not found in Julia?

I hope it's okay that I'm already trying to use FlashWeave! πŸ™Œ

Cheers! Lena


This is the complete error message:

Running external command line application(s). This may print messages to stdout and/or stderr.
The command(s) being run are below. These commands cannot be manually re-run as they will depend on temporary files that no longer exist.

Command: run_FlashWeave.jl --datapath /scratch/lfloerl/tmpdata/tmp2ah97p88/input-data.tsv --output /scratch/lfloerl/tmpdata/tmp2ah97p88/network.gml --max_k 3 --alpha 0.01 --conv 0.01 --max_tests 1000000 --hps 5 --n_obs_min -1 --time_limit -1.0 --prec 64 --update_interval 30 --verbose --sensitive --feed_forward --FDR --normalize --make_sparse

/usr/bin/env: julia: No such file or directory
Traceback (most recent call last):
  File "/scratch/lfloerl/.condaenvs/qiime2-2023.2-new/lib/python3.8/site-packages/q2_makarsa/_flashweave.py", line 84, in flashweave
    run_commands([cmd])
  File "/scratch/lfloerl/.condaenvs/qiime2-2023.2-new/lib/python3.8/site-packages/q2_makarsa/_run_commands.py", line 19, in run_commands
    subprocess.run(cmd, check=True)
  File "/scratch/lfloerl/.condaenvs/qiime2-2023.2-new/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_FlashWeave.jl', '--datapath', '/scratch/lfloerl/tmpdata/tmp2ah97p88/input-data.tsv', '--output', '/scratch/lfloerl/tmpdata/tmp2ah97p88/network.gml', '--max_k', '3', '--alpha', '0.01', '--conv', '0.01', '--max_tests', '1000000', '--hps', '5', '--n_obs_min', '-1', '--time_limit', '-1.0', '--prec', '64', '--update_interval', '30', '--verbose', '--sensitive', '--feed_forward', '--FDR', '--normalize', '--make_sparse']' returned non-zero exit status 127.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/scratch/lfloerl/.condaenvs/qiime2-2023.2-new/lib/python3.8/site-packages/q2cli/commands.py", line 352, in __call__
    results = action(**arguments)
  File "<decorator-gen-398>", line 2, in flashweave
  File "/scratch/lfloerl/.condaenvs/qiime2-2023.2-new/lib/python3.8/site-packages/qiime2/sdk/action.py", line 234, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/scratch/lfloerl/.condaenvs/qiime2-2023.2-new/lib/python3.8/site-packages/qiime2/sdk/action.py", line 381, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/scratch/lfloerl/.condaenvs/qiime2-2023.2-new/lib/python3.8/site-packages/q2_makarsa/_flashweave.py", line 86, in flashweave
    raise Exception(
Exception: An error was encountered while running FlashWeave in Julia (return code 127), please inspect stdout and stderr to learn more.
BenKaehler commented 1 year ago

Sorry @LenaFloerl! I forgot to update the readme with FlashWeave installation instructions.

I will do that when I get a spare moment, but in the mean time these commands worked for me (in the appropriate conda/mamba environment):

conda install -c conda-forge julia
julia -e 'using Pkg; Pkg.add("FlashWeave")'
julia -e 'using Pkg; Pkg.add("ArgParse")'
julia -e 'using Pkg; Pkg.add("GraphIO")'
LenaFloerl commented 1 year ago

Hi - great thanks! Works like a gem now, FlashWeave is super fast! πŸ’Ž

Quick follow up question regarding the visualisation: trying to visualise the network now I got the plugin error: (PowerIterationFailedConvergence(...), 'power iteration failed to converge within 100 iterations')

That seems to mean that I have multiple multiple eigenvalues with the same magnitude - is that something I can fix by playing around with the FlashWeave parameters to (slightly) change the network?

Thanks again! I really hope it's okay that I'm already using FlashWeave! ✨

Cheers! Lena


Whole error message:

Traceback (most recent call last):
  File "/Users/lfloerl/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2cli/commands.py", line 352, in __call__
    results = action(**arguments)
  File "<decorator-gen-393>", line 2, in visualise_network
  File "/Users/lfloerl/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 234, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/Users/lfloerl/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 443, in _callable_executor_
    ret_val = self._callable(output_dir=temp_dir, **view_args)
  File "/Users/lfloerl/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_makarsa/_visualisation.py", line 310, in visualise_network
    annotate_node_stats(network)
  File "/Users/lfloerl/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_makarsa/_visualisation.py", line 287, in annotate_node_stats
    ee = nx.eigenvector_centrality(network)
  File "/Users/lfloerl/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/networkx/classes/backends.py", line 145, in wrapper
    return func(*args, **kwds)
  File "/Users/lfloerl/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/networkx/utils/decorators.py", line 766, in func
    return argmap._lazy_compile(__wrapper)(*args, **kwargs)
  File "<class 'networkx.utils.decorators.argmap'> compilation 17", line 4, in argmap_eigenvector_centrality_14
    import inspect
  File "/Users/lfloerl/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/networkx/algorithms/centrality/eigenvector.py", line 138, in eigenvector_centrality
    raise nx.PowerIterationFailedConvergence(max_iter)
networkx.exception.PowerIterationFailedConvergence: (PowerIterationFailedConvergence(...), 'power iteration failed to converge within 100 iterations')

Plugin error from makarsa:

  (PowerIterationFailedConvergence(...), 'power iteration failed to converge within 100 iterations')
BenKaehler commented 1 year ago

Hi @LenaFloerl,

I really hope it's okay that I'm already using FlashWeave! :sparkles:

It is definitely ok. Thanks very much for testing it!

I've made the statistics calculations more defensive, which should fix this problem (although I could not test with the data I've seen).

I suspect you may run into more problems as you progress your current data set, so please share any that you find!

BenKaehler commented 1 year ago

Hi @LenaFloerl, is this issue solved? Mind if I close it?

LenaFloerl commented 1 year ago

Hi @BenKaehler - thanks for following up! Yes, it worked well! πŸ‘