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 : ...
  • 1,806
9 votes
Accepted

Running SnakeMake on cluster

You can omit --nodes, you need the following: ...
  • 19.4k
8 votes
Accepted

Snakemake: Cannot find first rule?

you are starting snakemake the wrong way. snakemake snakemake means "Running the pipeline in ...
  • 1,332
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 ...
  • 1,332
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, ...
  • 19.4k
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 (...
  • 19.4k
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 ...
  • 1,332
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 ...
  • 689
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 ...
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 ...
  • 1,254
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-...
  • 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 '-...
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: ...
  • 1,568
4 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 ...
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 <...
  • 3,040
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 ...
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 ...
  • 19.4k
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, ...
  • 19.4k
4 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 ...
  • 689
4 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/...
  • 2,156
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): ...
3 votes

snakemake rule all

The following (or something close) should work: ...
  • 19.4k
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 ...
  • 19.4k
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 ...
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 ...
  • 19.4k
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 ...
  • 1,332
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 ...
  • 19.4k
2 votes

Why can I not install snakemake on my SLURM computer even though I can find it in the bioconda channel?

I created a file .condarc in my home directory with the following content: channels: - conda-forge - bioconda - defaults and it works now. I don't ...
  • 2,429
2 votes
Accepted

Access workdir defined on command line from within Snakefile

You could query Python for the working directory within the Snakefile, since evidently Snakemake changes the actual working directory of the process to the one specified by ...
  • 739
2 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 ...
  • 19.4k

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