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

Error running demo #15

Open j-schoenebeck opened 1 year ago

j-schoenebeck commented 1 year ago

Hello,

I am following the helpful tutorial for running the pipeline using demo data on my local machine (Intel iMac). Unfortunately, I am running into a roadblock. Everything seems to install fine using mamba. The conda environment loads without issue.

I made copies of the laptop configs and adjusted CPU and RAM according to my machine's specs.

My error occurs when I attempt to build the environment, step prior to processing the demo data: snakemake --dry-run --directory ../run_folder --profile environment/snakemake/iMac/ --configfiles smk_config/run_env/smk_cfg_env-iMac.yml smk_config/demo/params.yml setup_env

The following error is created:


  File "/Users/jschoene/PGAS/smk_env/lib/python3.7/site-packages/snakemake/io.py", line 1416, 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 "/Users/jschoene/PGAS/smk_env/bin/snakemake", line 10, in <module>
    sys.exit(main())
  File "/Users/jschoene/PGAS/smk_env/lib/python3.7/site-packages/snakemake/__init__.py", line 2386, in main
    log_handler=log_handler,
  File "/Users/jschoene/PGAS/smk_env/lib/python3.7/site-packages/snakemake/__init__.py", line 459, in snakemake
    overwrite_config.update(load_configfile(f))
  File "/Users/jschoene/PGAS/smk_env/lib/python3.7/site-packages/snakemake/io.py", line 1446, in load_configfile
    config = _load_configfile(configpath)
  File "/Users/jschoene/PGAS/smk_env/lib/python3.7/site-packages/snakemake/io.py", line 1441, in _load_configfile
    raise WorkflowError("{} file {} not found.".format(filetype, configpath))
snakemake.exceptions.WorkflowError: Config file setup_env not found.```

Unfortunately I am a bit of a Snakemake newbie. Any clue what I might be doing wrong?

Many thanks!
ptrebert commented 1 year ago

Hi j-schoenebeck ,

the reason for the fail is most likely the following: the --configfiles parameter accepts and arbitrary number of config files as input, and, hence, Snakemake is interpreting setup_env is yet another config file to read (which doesn't exist, of course). I checked the docs that I wrote about this and it looks like - if that is the problem - I have the same mistake as part of the example command lines (sorry). You can just add another parameter in between the list of config files and setup_env to check, or you just insert the special argument --:

(from Python docs)

[...] you can insert the pseudo-argument '--' which tells parse_args()
that everything after that is a positional argument

On a general note, PGAS has already reached its end of life due to the rise of hybrid assemblers (combining HiFi + ONT) leading to much better assemblies and also simplifying the process considerably. So, if you are willing to share some details on what you want to achieve, I may have alternative suggestions for you how reach these goals (as long as we are talking about assemblies of vertebrate genomes :-) )

Best, Peter