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

New snakemake version introduces path handling error #313

Closed
abel-betraoui opened this issue Sep 27, 2021 · 4 comments
Closed

New snakemake version introduces path handling error #313

abel-betraoui opened this issue Sep 27, 2021 · 4 comments

Comments

@abel-betraoui
Copy link

Hi all,

I got the following error running pangolin today:

Traceback (most recent call last):
  File "/opt/conda/envs/pangolin/lib/python3.8/site-packages/snakemake/__init__.py", line 593, in snakemake
    workflow.include(
  File "/opt/conda/envs/pangolin/lib/python3.8/site-packages/snakemake/workflow.py", line 1182, in include
    exec(compile(code, snakefile.get_path_or_uri(), "exec"), self.globals)
  File "/opt/conda/envs/pangolin/lib/python3.8/site-packages/pangolin/scripts/pangolearn.smk", line 13, in <module>
    config["trained_model"] = os.path.join(workflow.current_basedir,'..', config["trained_model"])
  File "/opt/conda/envs/pangolin/lib/python3.8/posixpath.py", line 76, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not LocalSourceFile

The piece of incriminated code is the following (from pangolearn.smk):

if config.get("trained_model"):
    config["trained_model"] = os.path.join(workflow.current_basedir,'..', config["trained_model"])

I ran a previous version of the code (docker built on the 2021-09-20) on the same file and everything went well.

I noticed an update of snakemake (from 6.8.0 to 6.8.1) 3 days ago which introduces modifications in the definition of
the workflow.current_basedir function which now returns the path as a LocalSourceFile (apparently not handled by os.path.join).

Snakemake version is constrained in environment.yml as follows:

  - snakemake-minimal>=5.13

If I'm not mistaken, converting current_basedir to something os.path.join can handle should correct this issue. A temporary workaround would be to set the version were there any side effects to the fix.

Cheers

@tomu01
Copy link

tomu01 commented Sep 27, 2021

Also seeing this same error. In fact Pangolin 3.1.11 / pangoLEARN 2021-09-17 were working fine last week, but due to the recent snakemake change, are now failing.

@aineniamh
Copy link
Member

Resolved now with a modification of the environment file to use an earlier snakemake version!

@tomu01
Copy link

tomu01 commented Sep 27, 2021

Thanks so much @aineniamh for the quick fix!

@corneliusroemer
Copy link
Contributor

It's already reported upstream here, let's hope it'll be fixed soon so we're not stuck with old Snakemake for long
snakemake/snakemake#1212

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

4 participants