vinisalazar / metaphor

Metaphor: a general-purpose workflow for assembly and binning of metagenomes
https://metaphor-workflow.readthedocs.io/
Other
35 stars 3 forks source link

Metaphor test issue #64

Closed francesco-ricci closed 4 months ago

francesco-ricci commented 7 months ago

Hi Vini,

I run in the following issue when I run metaphor test:

(metaphor) [fricci@m3-login1 Metaphor]$ metaphor test Creating test directory: 'test_data_metaphor'. Starting data download. Downloading 8 files from 'https://github.com/vinisalazar/mg-example-data/raw/main/data/'. 100%|█████████████████████████████████████████████████████████████████████████████████████████| 8/8 [00:03<00:00, 2.09it/s] Downloaded 8 files.

Creating input table for test files.

8 files detected: RL1_S002insert_270_short_R1.fq.gz RL2_S002insert_270_short_R1.fq.gz RL2_S001insert_270_short_R1.fq.gz RL1_S002insert_270_short_R2.fq.gz RL1_S001insert_270_short_R1.fq.gz RL1_S001insert_270_short_R2.fq.gz RL2_S002insert_270_short_R2.fq.gz RL2_S001insert_270_short_R2.fq.gz

4 samples detected, 2 files per sample. RL1_S001insert_270_short: RL1_S001insert_270_short_R1.fq.gz RL1_S001insert_270_short_R2.fq.gz RL1_S002__insert_270_short: RL1_S002insert_270_short_R1.fq.gz RL1_S002insert_270_short_R2.fq.gz RL2_S001insert_270_short: RL2_S001insert_270_short_R1.fq.gz RL2_S001insert_270_short_R2.fq.gz RL2_S002__insert_270_short: RL2_S002insert_270_short_R1.fq.gz RL2_S002insert_270_short_R2.fq.gz

Generated input table 'samples.csv'.

Starting Snakemake. This may require the installation of conda environments which should take a while.

You can suppress this confirmation message by running the Metaphor command with the -y flag.

Snakemake will start with 3 cores and 8192 MB RAM. Ok to continue? [y/N] y Your command is: snakemake \ --snakefile /home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/metaphor/workflow/Snakefile \ --configfile /home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/metaphor/config/test-config.yaml \ --cores 3 \ -p -r \ --use-conda --wrapper-prefix \ https://github.com/snakemake/snakemake-wrappers/raw/ --conda-prefix \ /home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/metaphor/config/conda --config Config file /home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/metaphor/config/default-config.yaml is extended by additional config specified via the command line.


/ |/ / / / _ / / _ _ / /|/ // -_)/ // `// \ / \/ \ / / // // _/ _/ _,_// ._/////\///
/
/

Metaphor v1.7.9 - Metagenomic Pipeline for Short Reads

© The University of Melbourne 2023 MIT licence

Documentation available at 'https://metaphor-workflow.readthedocs.io/'.

To give feedback and report bugs or issues, please go to 'https://github.com/vinisalazar/metaphor'.

Building DAG of jobs... /bin/bash: conda: command not found Traceback (most recent call last): File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/snakemake/init.py", line 792, in snakemake success = workflow.execute( ^^^^^^^^^^^^^^^^^ File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/snakemake/workflow.py", line 1078, in execute dag.create_conda_envs( File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/snakemake/dag.py", line 359, in create_conda_envs env.create(dryrun) File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/snakemake/deployment/conda.py", line 393, in create pin_file = self.pin_file ^^^^^^^^^^^^^ File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/snakemake/common/init.py", line 217, in get value = self.method(instance) ^^^^^^^^^^^^^^^^^^^^^ File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/snakemake/deployment/conda.py", line 103, in pin_file f".{self.conda.platform}.pin.txt" ^^^^^^^^^^ File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/snakemake/common/init.py", line 217, in get value = self.method(instance) ^^^^^^^^^^^^^^^^^^^^^ File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/snakemake/deployment/conda.py", line 96, in conda return Conda( ^^^^^^ File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/snakemake/deployment/conda.py", line 653, in init shell.check_output(self._get_cmd("conda info --json"), text=True) File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/snakemake/shell.py", line 61, in check_output return sp.check_output(cmd, shell=True, executable=executable, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/subprocess.py", line 466, in check_output return run(popenargs, stdout=PIPE, timeout=timeout, check=True, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'conda info --json' returned non-zero exit status 127. Metaphor did not finish with exit code 1. Please see the error message below. An error occurred while running Metaphor. Please check the traceback below. Traceback (most recent call last): File "/home/fricci/miniconda3/envs/metaphor/bin/metaphor", line 10, in sys.exit(main()) ^^^^^^ File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/metaphor/cli/cli.py", line 278, in main args.func(args) File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/metaphor/cli/test.py", line 182, in main retcode = run_cmd(cmd) ^^^^^^^^^^^^ File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/metaphor/utils.py", line 92, in run_cmd retcode = check_call(cmd.split()) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/fricci/miniconda3/envs/metaphor/lib/python3.11/subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['snakemake', '--snakefile', '/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/metaphor/workflow/Snakefile', '--configfile', '/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/metaphor/config/test-config.yaml', '--cores', '3', '-p', '-r', '--use-conda', '--wrapper-prefix', 'https://github.com/snakemake/snakemake-wrappers/raw/', '--conda-prefix', '/home/fricci/miniconda3/envs/metaphor/lib/python3.11/site-packages/metaphor/config/conda', '--config', 'max_mb=8192']' returned non-zero exit status 1

vinisalazar commented 7 months ago

Hi Francesco,

Thanks for reporting that. I am unable to reproduce your error, so I suspect it's something related to your installation.

The very beginning of your error message shows: /bin/bash: conda: command not found

This suggest to me that, for some reason, when you execute Snakemake, it's using the default Bash (the one at /bin/bash) $PATH variable instead of the Metaphor environment path. Seems related to this: https://github.com/snakemake/snakemake/issues/1204

Could try some of the suggestions listed in the issue above?

This answer also seems to provide some insight: https://stackoverflow.com/questions/35246386/conda-command-not-found

You can try running this to troubleshoot:

which bash   # check the location of your bash executable
bash   # open a new bash shell
conda    # check if, inside the bash shell, you can find the conda executable
which conda   # check the location of said conda executable

Let me know how it goes.

Best, Vini

francesco-ricci commented 6 months ago

Hey Vini,

thanks for your help, you pointed me in the right direction. Anyway, metaphor works if I deactivate the base conda environment, then I activate the metaphor environment.

Thanks! Francesco