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
22
votes
2 answers

Recommended way to do multiple shell commands with shell()

In snakemake, what is the recommended way to use the shell() function to execute multiple commands?
tedtoal
  • 1,030
  • 1
  • 10
  • 22
18
votes
3 answers

How to avoid running Snakemake rule after input or intermediary output file was updated

Even if the output files of a Snakemake build already exist, Snakemake wants to rerun my entire pipeline only because I have modified one of the first input or intermediary output files. I figured this out by doing a Snakemake dry run with -n which…
Vincent Darbot
  • 217
  • 3
  • 11
13
votes
1 answer

Printing simplified DAG plot with snakemake

I have a long snakemake workflow processing 9 samples with many parallel rules. When I create a picture for the DAG with: snakemake --forceall --dag | dot -Tpdf > dag.pdf the resulting dag plot is huge and very redundant (and ugly because of…
splaisan
  • 845
  • 6
  • 22
13
votes
2 answers

Meaning of the benchmark variables in snakemake

I included a benchmark directive to some of the rules in my snakemake workflow, and the resulting files have the following header: s h:m:s max_rss max_vms max_uss max_pss io_in io_out mean_load The only documentation I've found mentions a…
bli
  • 7,549
  • 7
  • 48
  • 94
12
votes
3 answers

Can SnakeMake be forced to rerun rules when files are missing

When a file that was made earlier in the pipeline is removed, SnakeMake does not seem to consider that a problem, as long as later files are there: rule All: input: "testC1.txt", "testC2.txt" rule A: input: "{X}{Y}.txt" output:…
tedtoal
  • 1,030
  • 1
  • 10
  • 22
10
votes
2 answers

Snakemake using a rule in a loop

I'm trying to use Snakemake rules within a loop so that the rule takes the output of the previous iteration as input. Is that possible and if yes how can I do that? Here is my example Setup the test data mkdir -p test echo "SampleA" >…
Fabian_G
  • 431
  • 4
  • 16
10
votes
2 answers

Current-rule's name in Snakemake

I am working with Snakemake and I can't find a way to access to the current-rule's name. For instance, is there a way to have an access like this: rule job1: input: check_inputs(rules.current.name) output: ... This can be very helpful when…
glihm
  • 1,138
  • 13
  • 29
9
votes
1 answer

Use of Snakemake workflows in AWS Batch

I wanted to ask the Snakemake community if anybody has had success implementing Snakemake workflows in AWS Batch. Page 4 of a recent publication from Oct 2018 seems to suggest that Snakemake does not work on AWS as it cannot handle resource…
user10101904
  • 427
  • 2
  • 12
9
votes
4 answers

How to run only one rule in snakemake

I have created a workflow within snakemake, I Have a problem when I want to run just one rule. Indeed it runs for me the rules where the output is the input of my rule even if those one are already created before. Example : rule A: input A output…
BioManil
  • 91
  • 1
  • 1
  • 3
9
votes
1 answer

Snakemake hangs when cluster (slurm) cancelled a job

Maybe the answer is obvious for many, but I am quite surprised I could not find a question regarding this topic, which represents a major problem for me. I would greatly appreciate a hint! When submitting a job on a cluster managed by slurm, if the…
davide m
  • 91
  • 5
9
votes
2 answers

What are snakemake metadata files? When can I erase those?

I notice that my backup rsync script spends quite some time copying stuff with random name from .snakemake/metadata folders. What are those files used for? Can I safely erase them after a snakemake run has completed, or are they necessary for…
bli
  • 7,549
  • 7
  • 48
  • 94
8
votes
1 answer

How to properly use wildcards in input and output

I recently decided to start with snakemake. I can't find anything that fits my needs neither on stack, nor on the snakemake doc. I feel like I don't understand something and I may need some explanations. I am trying to make a simple snakemake…
Roxane
  • 111
  • 7
8
votes
1 answer

Snakemake wants to run job although output file already exists

I have a workflow that begins by downloading files from a public database, and then in subsequent steps processes these files to create several aggregated data tables. I’m testing the workflow on a machine with no internet connection. I ran the…
Daniel Standage
  • 8,136
  • 19
  • 69
  • 116
8
votes
1 answer

Restrict number of jobs by a rule in snakemake

Is it possible to restrict number of jobs to run by a particular rule in snakemake? --jobs controls globably how many jobs are allowed to run at a time, but I would like to restrict by a specific rule. This is because, I have a particular rule that…
Manavalan Gajapathy
  • 3,900
  • 2
  • 20
  • 43
8
votes
1 answer

Is Snakemake params function evaluated before input file existence?

Consider this snakefile: def rdf(fn): f = open(fn, "rt") t = f.readlines() f.close() return t rule a: output: "test.txt" input: "test.dat" params: X=lambda wildcards, input, output, threads, resources: rdf(input[0]) …
tedtoal
  • 1,030
  • 1
  • 10
  • 22
1
2 3
99 100