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
5
votes
1 answer

Snakemake - Wildcards in input files cannot be determined from output files

I am very new to snakemake and also not so fluent in python (so apologies this might be a very basic stupid question): I am currently building a pipeline to analyze a set of bamfiles with atlas. These bamfiles are located in different folders and…
Trillian Astra
  • 129
  • 1
  • 10
5
votes
1 answer

How can one access Snakemake config variables inside `shell` section?

In snakemake I would like to access keys from the config from within the shell: directive. I can use {input.foo}, {output.bar}, and {params.baz}, but {config.quux} is not supported. Is there a way to achieve this? rule do_something: input:…
init_js
  • 4,143
  • 2
  • 23
  • 53
5
votes
0 answers

Using other files based on dynamic outputs with mixed non-dynamic wildcards in snakemake

I am trying to use a Snakefile that does something like this: rule split_files: input: '{pop}.bam' output: dynamic('{pop}_split/{chrom}.sam') shell: "something" rule work: input: …
Mike D
  • 727
  • 2
  • 10
  • 26
5
votes
2 answers

Is it possible to print commands instead of rules in snakemake dry run?

Dry runs are a super important functionality of workflow languages. What I am looking at is mostly what would be executed if I run the command and this is exactly what one see when running make -n. However analogical functionality snakemake -n…
Kamil S Jaron
  • 494
  • 10
  • 23
5
votes
2 answers

Handling SIGPIPE error in snakemake

The following snakemake script: rule all: input: 'test.done' rule pipe: output: 'test.done' shell: """ seq 1 10000 | head > test.done """ fails with the following error: snakemake -s…
dariober
  • 8,240
  • 3
  • 30
  • 47
5
votes
0 answers

Snakemake: dynamic + non-dynamic output

I have a use case in which a rule generates an arbitrary number of "checkpoint" files and a single output file. For example, "example.input" would produce: example_000.checkpoint example_001.checkpoint ... example_093.checkpoint (arbitrary…
Sean Colby
  • 71
  • 2
5
votes
1 answer

Implementation How to use expand in snakemake when some particular combinations of wildcards are not desired?

I tried to implement How to use expand in snakemake when some particular combinations of wildcards are not desired? The goal is to only process crossed combinations between SUPERGROUPS: from itertools import…
lvw
  • 61
  • 2
5
votes
3 answers

Reuse of a rule in Snakemake

Is there a way to reuse a rule in snakemake changing only the params? For instance: rule job1: ... params: reference = "path/to/ref1" ... rule job2: input: rules.job1.output ... params: reference =…
glihm
  • 1,138
  • 13
  • 29
5
votes
1 answer

Is it possible to get yapf to ignore portions of a file?

I'm using a python-dsl called snakemake that looks like this: from bx.intervals.cluster import ClusterTree from epipp.config import system_prefix, include_prefix, config, expression_matrix config["name"] =…
The Unfun Cat
  • 29,987
  • 31
  • 114
  • 156
4
votes
3 answers

Multiline ruleorder in Snakemake

I have 3 rules and their names are somewhat long. When using ruleorder, the line goes over my desired 80 character limit. Is it possible break up the ruleorder into multiple lines in such a way that the behaviour is exactly the same as if I wrote it…
yippingAppa
  • 331
  • 1
  • 11
4
votes
1 answer

'expand' won't do what I want. How do I generate a custom list of inputs to a rule in Snakemake?

I want to run a Snakemake workflow where the input is defined by a combination of different variables (e.g. pairs of samples, sample ID and Nanopore barcode,...): sample_1 = ["foo", "bar", "baz"] sample_2 = ["spam", "ham", "eggs"] I've got a rule…
KeyboardCat
  • 442
  • 3
  • 12
4
votes
1 answer

How to ignore Snakemake's "params have changed since last execution"?

Some very late jobs of a workflow crashed due to a conda environment not being active. Now, when I try to rerun using snakemake deploy_all --ignore-incomplete all jobs are rerun straight from the beginning, with the following reason: Reason: Params…
Cornelius Roemer
  • 3,772
  • 1
  • 24
  • 55
4
votes
1 answer

Snakemake Error: No values given for wildcard

This is a follow-up of a previous question about using a Python dictionary to generate a list of files to include as input for a single step. In this case, I'm interested in merging BAM files for a single sample that have been generated by mapping…
ksw
  • 313
  • 3
  • 11
4
votes
2 answers

Using STAR shared memory module in Snakemake for sequential alignment tasks

I'm writing a Snakemake pipeline for scRNAseq sequence processing which uses STAR as the alignment tool. Loading genome index into the memory for each alignment job is very time-consuming. Since I have a lot of memory at my disposal, I figure that…
4
votes
2 answers

Snakemake Singularity with Local Resources / Questions about Snakemake with --use-singularity

I'm starting to experiment with using containers with Snakemake, and I have a question about what needs to be pre-build into the container and what doesn't. For example: I want to run a python script (stored in workflow_root/scripts/myScript.py,…