Is it possible to integrate shell scripts in snakemake
1
0
Entering edit mode
2.5 years ago
iibrams07 ▴ 10

Hello,

I need to integrate as inputs/outputs scripts written in python, R as well as shell scripts. I also would like to add to this list jupyter notebooks in constructing modular pipelines. While I found in the documentation about snakemake that some of this is possible, I did not find a clear indication as of the use of shell scripts inside the snakemake code. I also found that snake make integrates shell commands.

My questions are: Can snakemake integrate shell scripts in building bioinformatics pipelines? Can nextflow integrate it and other scripts (and jupyter notebooks) as well?

I have no experience in using snakemake or nextflow but willing to do so in future.

Many thanks.

snakemake • 2.9k views
ADD COMMENT
1
Entering edit mode

well each script/shell section of a nextflow or a snakemake is a kind of shell script itself... for example if your script hello.sh is

#!/bin/bash
echo Hello

in nextflow you could write

script:
```
/path/to/hello.sh > output.txt
```

or

script:
```
echo Hello  > output.txt
```
ADD REPLY
1
Entering edit mode
2.5 years ago
lily ▴ 80

Sure, you can easily run your shell scripts in Snakemake.

A rule can, for example, look like the following:

rule shell_rule:
   input: "path/to/input"
   output: "path/to/output"
   shell: "my_shell.sh {input} {output}"

You just have to make sure / adjust your scripts such that they handle the input and output files accordingly.

ADD COMMENT

Login before adding your answer.

Traffic: 1990 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6