Skip to main content
10 votes
Accepted

Running SnakeMake on cluster

You can omit --nodes, you need the following: ...
Devon Ryan's user avatar
  • 19.6k
9 votes
Accepted

Snakemake: Cannot find first rule?

you are starting snakemake the wrong way. snakemake snakemake means "Running the pipeline in ...
finswimmer's user avatar
  • 1,342
9 votes
Accepted

How to resolve in snakemake error : "Target rules may not contain wildcards."

The problem is that you need a master rule that requires all of your desired outputs as inputs, in your case it would be : ...
heathobrien's user avatar
  • 1,816
7 votes
Accepted

How can I ask snakemake to produce a dag where each node represents a rule?

I think you are looking for --rulegraph instead of --dag ...
finswimmer's user avatar
  • 1,342
5 votes
Accepted

Running Snakemake in one single conda env

Using only the --use-conda directive, snakemake copies environments somewhere in the local .snakemake directory. This is ...
Sebastian Müller's user avatar
5 votes
Accepted

Mix globbing and wildcards when specifying rule input

A nice solution comes from a colleague of mine, as seen in this Snakemake workflow. The trick is to access the wildcards programmatically using an anonymous (lambda) function. In my example above, it ...
Daniel Standage's user avatar
5 votes
Accepted

'Wildcards' object has no attribute 'sample'

Snakemake gets wildcards from the parsing the input/output file names. For example, if you had ...
James Hawley's user avatar
  • 1,384
5 votes
Accepted

How to specify resources for cluster in snakemake

This feature was added in version 3.6.0. Look at release notes. {wildcards} normally expands to a something that looks vaguely like a dictionary. In other words, ...
Devon Ryan's user avatar
  • 19.6k
5 votes
Accepted

How are snakemake's --cluster and --drmaa options implemented?

I'd always kind of wondered how this worked too, so I took this as an excuse to look into the snakemake code. At the end of the day this becomes a question of (1) how are jobs actually submitted and (...
Devon Ryan's user avatar
  • 19.6k
5 votes

Running Snakemake in one single conda env

A good practice is to provide yml file along with your Snakefile. This file should contain all the enviroment definitions that ...
finswimmer's user avatar
  • 1,342
5 votes
Accepted

Snakemake and SLURM -unable to use it with with --cluster

In your submission script you have -n {-cluster.n}, hence the error from snakemake I guess. Are you sure it is not a typo and it should be ...
dariober's user avatar
  • 699
5 votes
Accepted

How to modify execution orders for Snakemake?

I think you should use the priority directive to give precedence to downstream rule(s). Here below I give higher priority to step2 so when the first sample has ...
dariober's user avatar
  • 699
5 votes

How do I write tests for a snakemake pipeline?

You can run CI on a snakemake workflow when provoding a minimal example dataset. Maybe an example from the snakemake-workflows repo will be helpful: https://github.com/snakemake-workflows/dna-seq-...
jafors's user avatar
  • 151
5 votes
Accepted

snakemake multiple parameters for multiple input and single output in snakemake. ConbineGVCFs gatk problem

Found out the problem. Turns out I can write a lambda function as follows params: extra=lambda wildcards, input: ' -V '.join(input.all_gvcf_list) and add '-...
Shafayet Rahat's user avatar
5 votes

Modification time does not trigger a snakemake rule

This is a Snakemake feature: For small files (less than 100000 bytes), checksums are compared to determine if a job needs to run if the input file is newer than output file: https://github.com/...
Steve's user avatar
  • 3,109
4 votes
Accepted

Output file names are not known beforehand

Could you give an example of names of input files and output files of normalize.py ? It seems to me that your case could be similar to the one described about the <...
bli's user avatar
  • 3,130
4 votes

How are snakemake's --cluster and --drmaa options implemented?

DRMAA (Distributed Resource Management Application API) appears to be an open API that describes a specification for submission and management of work submitted to some grid/cluster. If your scheduler ...
Sam Nicholls's user avatar
4 votes
Accepted

How can I specify an email address in the SLURM snakemake json configuration file?

As noted by the comments and the SLURM manual (not so much bioinformatics related?) You need the following terms in your batch/queuing command: ...
story's user avatar
  • 1,573
4 votes
Accepted

conda doesn't install latest version of snakemake

Python (whether installed with conda or not) will prefer packages installed in your home directory unless you tell it not to. This is a little known secret about using a virtualenv, actually, since ...
Devon Ryan's user avatar
  • 19.6k
4 votes
Accepted

Can't install snakemake v5.15.0 from conda

This is an example of the conda solver behaving incorrectly. In this case, it's choosing to pick a version that minimizes the number of dependencies required. Version 5.3.0 has 25 fewer dependencies, ...
Devon Ryan's user avatar
  • 19.6k
4 votes
Accepted

How can I incorporate wildcards in Snakemake in an R script?

Your problem is that Snakemake is passing all the input data to the R script simultaneously instead of running them individually :) As written your rule takes a list of input files and gives a list of ...
Jesse's user avatar
  • 947
3 votes
Accepted

snakemake with --conda-prefix, can I use a pre-built conda environment?

If the environment already exists it will simply be used. You cannot, however, tell it to use an environment with a normal name (e.g., "my_env"). I assume you mean, "where the heck does the random ...
Devon Ryan's user avatar
  • 19.6k
3 votes

How to resolve in snakemake error : "Target rules may not contain wildcards."

Given the Makefile you provided and which someone then deleted from the question, you should probably just add this line (this should be the first rule): ...
Karel Břinda's user avatar
3 votes

snakemake rule all

The following (or something close) should work: ...
Devon Ryan's user avatar
  • 19.6k
3 votes
Accepted

Dealing with absence of coverage

I'll fix the bamCoverage issue in the 2.6.0 release (it may already be fixed since I rewrite how bigWig files are made for that release). You can follow my status ...
Devon Ryan's user avatar
  • 19.6k
3 votes

How to specify resources for cluster in snakemake

The solutions are either, upgrade snakemake or just take all wildcards out of cluster.json file and write them directly to ...
Kamil S Jaron's user avatar
3 votes
Accepted

Running snakemake with multiple conda environments without rebuilding environments every time

Each YAML file will always create its own environment. The packages in each aren't downloaded and installed each time, if they're already installed elsewhere they're just hard-linked in. You'll want ...
Devon Ryan's user avatar
  • 19.6k
3 votes
Accepted

Snakemake: Re-read the samples.tsv file midway through the workflow

You're right, it doesn't re-run things again for each job, so your original definition of samples is still the one it's working with. It seems like it goes against ...
Jesse's user avatar
  • 947
2 votes
Accepted

Python string editing in Snakemake

It seems that it is not possible to apply strip() directly on the wildcard placeholders. Luckily it is possible to executed functions in the ...
finswimmer's user avatar
  • 1,342
2 votes
Accepted

combining the use of workdir and option --jobscript in snakemake

To quote from the snakemake documentation All paths in the snakefile are interpreted relative to the directory snakemake is executed in. This behaviour can be overridden by specifying a workdir in ...
Devon Ryan's user avatar
  • 19.6k

Only top scored, non community-wiki answers of a minimum length are eligible