Search code examples
linuxbashubuntusnakemake

Bare bones necessary to run pipeline on snakemake?


I have to perform imputation of genetic information, but scripts and files are located on different locations. There are some parallel jobs for could (cluster) involved as well. Too much of a manual running-waiting is necessary to get job done.

In order to streamline the mess, i want to put these bash scripts in Snakemake pipeline. The expected outcome would be a Snakefile with rules consisting only of shell scripts as input/output files are already specified.

For that i basically have to run this simple example:

Let's say we have input called test.txt containting list:

13 234 34 4

And bash script for ordering, called test.sh:

sort -n test.txt > test1.txt

In order to run this script through Snakemake, i made Snakefile:

rule sort:
    shell:
            "path/to/test.sh"

When i run it using command

snakemake Snakefile 

i get following error:

/usr/bin/bash: path/to/test.sh: Permission denied

Could you guys point me on why such syntax would not work with snakemake?


Solution

  • So the problem is being hinted at in the comments.

    There are two likely possible problems. One is that the path to the file is incorrect, the other is that the path is correct, but the file is 'not executable'.

    If the file is not executable, then it has little to do with snakemake. The solution is easy though. Just use the command proposed by @CharlesDuffy:

    chmod +x path/to/test.sh