ptrebert / project-diploid-assembly

Pipeline code for creating a fully haplotype-resolved assembly from a combination of PacBio/ONT long reads and Illumina Strand-seq data
MIT License
15 stars 3 forks source link

Config file setup_env not found. #12

Closed wjj666 closed 3 years ago

wjj666 commented 3 years ago

Hi, I have create the snakemake execution environment sucessfully and already activated the environment with conda activate ./smk_env.

Now, I want to run the demo dataset with just the default environment configuration with the tutorial. But when I run this cmd to prepare the software environment: (/xxx/diploid/smk_env) [project-diploid-assembly]$ snakemake --directory ../run_folder --profile environment/snakemake/demo/ --configfiles smk_config/demo/run_env.yml smk_config/demo/params.yml setup_env

it leads to this error:

Traceback (most recent call last):
  File "/xxx/diploid/smk_env/lib/python3.6/site-packages/snakemake/io.py", line 1340, in _load_configfile
    with open(configpath) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'setup_env'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/xxx/diploid/smk_env/bin/snakemake", line 10, in <module>
    sys.exit(main())
  File "/xxx/diploid/smk_env/lib/python3.6/site-packages/snakemake/__init__.py", line 2119, in main
    log_handler=log_handler,
  File "/xxx/diploid/smk_env/lib/python3.6/site-packages/snakemake/__init__.py", line 405, in snakemake
    overwrite_config.update(load_configfile(f))
  File "/xxx/diploid/smk_env/lib/python3.6/site-packages/snakemake/io.py", line 1370, in load_configfile
    config = _load_configfile(configpath)
  File "/xxx/diploid/smk_env/lib/python3.6/site-packages/snakemake/io.py", line 1365, in _load_configfile
    raise WorkflowError("{} file {} not found.".format(filetype, configpath))
snakemake.exceptions.WorkflowError: Config file setup_env not found.

Could you please help me solve this problem? Thank you very much.

ptrebert commented 3 years ago

Hi wjj666. That is indeed a negligence in the tutorial, setup_env cannot follow immediately after all config file paths as it will be interpreted as one more config file (hence the FileNotFoundError), you need to indicate that the list of config files is over, e.g., by adding -- or some other command line parameter that only consumes a single value. Thanks for flagging this.

wjj666 commented 3 years ago

Hi wjj666. That is indeed a negligence in the tutorial, setup_env cannot follow immediately after all config file paths as it will be interpreted as one more config file (hence the FileNotFoundError), you need to indicate that the list of config files is over, e.g., by adding -- or some other command line parameter that only consumes a single value. Thanks for flagging this.

Hi, thanks for your quick reply. But I am sorry that after adding -- to indicate the list of config file is over, it leads to another error:

Building DAG of jobs...
MissingRuleException:
No rule to produce --res=mem_total_mb=131072 (if you use input functions make sure that they don't raise unexpected exceptions).

However, when I omit the setup_env, it comes to:

Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 24
Rules claiming more threads will be scaled down.
Provided resources: mem_total_mb=131072
Job counts:
        count   jobs
        1       dump_config
        1       master
        2

[Thu Apr 22 08:16:13 2021]
rule dump_config:
    output: config.dump
    jobid: 1
    resources: mem_per_cpu_mb=1024, mem_total_mb=1024, runtime_hrs=1, runtime_min=59

Job counts:
        count   jobs
        1       dump_config
        1
[Thu Apr 22 08:16:14 2021]
Finished job 1.
1 of 2 steps (50%) done

[Thu Apr 22 08:16:14 2021]
Job 0: Default run: processing only samples in loaded configuration

[Thu Apr 22 08:16:14 2021]
Finished job 0.
2 of 2 steps (100%) done
Complete log: /xxx/diploid/run_folder/.snakemake/log/2021-04-22T081612.441675.snakemake.log

How to fix this error? Thank you.

ptrebert commented 3 years ago

Hm, that's a bit odd, but maybe Snakemake is parsing certain command line arguments in a special way... anyways, then just switch around the order of --profile and --configfiles