Questions tagged [snakemake]

Snakemake is a workflow management system with a Python-style specification language.

Snakemake is a workflow management system with a Python-style specification language.

1634 questions
8
votes
2 answers

snakemake - output one only file from multiple input files in one rule

I'm using snakemake for the first time in order to build a basic pipeline using cutadapt, bwa and GATK (trimming ; mapping ; calling). I would like to run this pipeline on every fastq file contained in a directory, without having to specify their…
Alexandre.S
  • 97
  • 1
  • 8
7
votes
2 answers

Symlink (auto-generated) directories via Snakemake

I am trying to create a symlink-directory structure for aliasing output directories in a Snakemake workflow. Let's consider the following example: A long time ago in a galaxy far, far away, somebody wanted to find the best ice cream flavour in the…
mschilli
  • 1,884
  • 1
  • 26
  • 56
7
votes
1 answer

Snakemake: 'Missing input files' due to wrong wildcard expansion

I am new to Snakemake and I want to write a very simple Snakefile with a rule that processes each input file separately to an output file, but somehow my wildcards aren't interpreted correctly. I have set up a minimal, reproducible example…
Bluescreen
  • 154
  • 2
  • 9
7
votes
1 answer

snakemake temp() causing unnecessary rerun of rules

I'm using snakemake v 5.4.0, and I'm running into a problem with temp(). In a hypothetical scenario: Rule A --> Rule B1 --> Rule C1 | --> Rule B2 --> Rule C2 where Rule A generates temp() files used by both pathways 1 (B1 + C1) and 2…
sharchaea
  • 743
  • 1
  • 6
  • 16
7
votes
1 answer

Using wildcards in params

Is it possible to use wildcards when defining parameters using config.yaml files in snakemake? I use a general R script to make the same basic heatmap but with different input matrices. I'd like to specify the configuration for the heatmap (such as…
Asymptomatic
  • 103
  • 1
  • 5
7
votes
1 answer

What would be an elegant way of preventing snakemake from failing upon shell/R error?

I would like to be able to have my snakemake workflows continue running even when certain rules fail. For example, I'm using a variety of tools in order to perform peak-calling of ChIP-seq data. However, certain programs issue an error when they…
rioualen
  • 948
  • 8
  • 17
6
votes
2 answers

Safely shut down snakemake programmatically

I am looking for a way to shutdown/exit/halt a running snakemake workflow programmatically - essentially with a python function that is called in the workflow but may run into an unrecoverable error requiring the workflow to stop for human…
Wouter De Coster
  • 409
  • 3
  • 17
6
votes
1 answer

Is there a way for Snakemake to evaluate dynamic Snakefile constructs like `eval` does in GNU Make?

I would like to have various dynamic "shortcuts" (rule names) in my Snakemake workflow without needing marker files. The method I have in mind is similar to eval in GNU Make, but it doesn't seem like Snakemake can evaluate variable-expanded code in…
sappjw
  • 373
  • 1
  • 14
6
votes
1 answer

String formatting of wildcards within output strings

I am relatively new to snakemake, and I am having some trouble adapting a scatter-gather DeepVariant workflow into snakemake rules. In the original Snakefile, I would like to scatter the first step across a cluster. DeepVariant uses a…
6
votes
1 answer

Snakemake how to execute downstream rules when an upstream rule fails

Apologies that the title is bad - I can't figure out how best to explain my issue in a few words. I'm having trouble dealing with downstream rules in snakemake when one of the rules fails. In the example below, rule spades fails on some samples.…
nicaimee
  • 61
  • 2
6
votes
2 answers

snakemake: how to implement log directive when using run directive?

Snakemake allows creation of a log for each rule with log parameter that specifies the name of the log file. It is relatively straightforward to pipe results from shell output to this log, but I am not able to figure out a way of logging output of…
econ
  • 547
  • 7
  • 22
6
votes
2 answers

How to prevent snakemake from deleting output folders from failed jobs?

I have a rule that iterates over a file pulls out the Fastq file paths and runs trimGalore on the Fastq files. However some of the files are corrupted / truncated and so trimGalore fails to process them. It continues to run on remaining files but…
jpsammy19
  • 93
  • 4
6
votes
2 answers

Building a workflow with dynamic input without using deprecated dynamic API

I'd like to make a workflow which downloads the list of some FASTQ files from the remote server, checks md5 and runs some post-processing, e.g. aligning. I understand how to implement this using two workflows: first download fastq files list file,…
6
votes
1 answer

Snakemake + docker example, how to use volumes

Lets have a simple snakefile like rule targets: input: "plots/dataset1.pdf", "plots/dataset2.pdf" rule plot: input: "raw/{dataset}.csv" output: "plots/{dataset}.pdf" shell: "somecommand…
mox
  • 447
  • 6
  • 15
6
votes
3 answers

awk command fails in snakemake --use-singularity

I am trying to combine Snakemake with Singularity, and I noticed that a simple awk command no longer works when using singularity. The $1 in the last line gets replaced by bash instead of being used as the first field by awk. Here is a minimal…
sssascha
  • 90
  • 1
  • 4