jts / ncov-tools

Small collection of tools for performing quality control on coronavirus sequencing data and genomes
MIT License
47 stars 16 forks source link

TypeError when running most recent Pangolin #94

Closed jpalmer37 closed 1 year ago

jpalmer37 commented 2 years ago

Just wanted to provide visibility to a compatibility issue between Snakemake >=6.8.1 and Pangolin >=3.1.13. The following error is produced when running Pangolin:

[Tue Sep 28 15:59:11 2021]
rule make_lineage_assignments:
    input: consensus.fasta
    output: lineages/lineage_report.csv
    jobid: 188
    threads: 8
    resources: tmpdir=/tmp

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

[Tue Sep 28 15:59:12 2021]
Error in rule make_lineage_assignments:
    jobid: 188
    output: lineages/lineage_report.csv
    shell:
        pangolin --outfile lineages/lineage_report.csv consensus.fasta
        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Solution

Already addressed in this issue on the Pangolin repo. It requires downgrading Snakemake to 6.8.0:

rdeborja commented 2 years ago

With the latest version of snakemake (i.e. 7.6.1) from the most recent PR, the issue seems to be resolved.

rdeborja commented 1 year ago

Closing issue for now as there has been no follow-up to the resolution. If issue persists please re-open.