snakemake-wrappers | development home of the Snakemake wrapper repository | BPM library
kandi X-RAY | snakemake-wrappers Summary
kandi X-RAY | snakemake-wrappers Summary
The Snakemake Wrapper Repository is a collection of reusable wrappers that allow to quickly use popular command line tools from Snakemake rules and workflows. Visit for more information.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Setup workflow
- Render meta file
- Render snakefile
- Return the path to the output directory
- Process the input_file
- Separates a file name based on the ending index
- Get the length of the longest sequence in a file
- Check if the query is a header
- Return the only child directory of path
- Convert an answer to a boolean
- Return the suffix of a path
- Get a named input by name
- Compose a gzipped output
- Return a base filename without file extension
- Compose a gzipped input file
- Move files from in_list to out_list
- Format a resampling response
- Unzip bz2 files
- Distribute the number of threads in the input_files
- Get named output by name
snakemake-wrappers Key Features
snakemake-wrappers Examples and Code Snippets
Community Discussions
Trending Discussions on snakemake-wrappers
QUESTION
I am using snakemake in cluster mode to submit a simple one rule workflow to the HPCC, which runs Torque with several compute nodes. The NFSv4 storage is mounted on /data. There is a link /PROJECT_DIR -> /data/PROJECT_DIR/
I submit the job using:
...ANSWER
Answered 2021-Apr-01 at 11:12Solved by providing a jobscript (--jobscript SCRIPT
) with:
QUESTION
TLDR I'm getting the following error:
The 'conda' command is not available inside your singularity container image. Snakemake mounts your conda installation into singularity. Sometimes, this can fail because of shell restrictions. It has been tested to work with docker://ubuntu, but it e.g. fails with docker://bash
I had created a Snakemake
workflow and converted the shell:
commands to rule-based package management via Snakemake wrappers:
.
However, I ran into issues running this on HPC and one of the HPC support staff strongly recommended against using conda
on any HPC system as:
"if the builder [of wrapper] is not super careful, dynamic libraries present in the conda environment that relies on the host libs (there are always a couple present because builder are most of the time carefree) will break. I think that relying on
Singularity
for your pipeline would make for a more robust system." - Anon
I did some reading over the weekend and according to this document, it's possible to combine containers with conda-based package management; by defining a global conda
docker container and per-rule yaml
files.
Note: In contrast to the example in the link above (Figure 5.4), which uses a predefined
yaml
andshell:
command, here I've use conda wrappers which download theseyaml
files into theSingularity
container (if I'm thinking correctly) so I thought should function the same - see the Note: at the end though...
Snakefile
, config.yaml
and samples.txt
Snakefile
...ANSWER
Answered 2020-Sep-22 at 15:02TLDR:
fastqc singularity container used in qc rule likely doesn't have conda
available in it, and this doesn't satisfy what snakemake's--use-conda
expects.
Explanation:
You have singularity containers defined at two different levels - 1. global level that will be used for all rules, unless they are overridden at rule level; 2. per-rule level that will be used at the rule level.
QUESTION
I'm in the process of porting Snakemake
Shell:
into Snakemake Wrappers and have noticed that the lambda wildcards:
I've successfully used for other wrappers is failing for the BWA MEM wrapper.
I've only managed to get the wrapper to work if it's hard-coded like:
...ANSWER
Answered 2020-Sep-02 at 15:46input:
reads=["lambda wildcards: getTrims(wildcards.sample)[0]", "lambda wildcards: getTrims(wildcards.sample)[1]"]
QUESTION
I have a rule using the bwa mem wrapper that sometimes fails due to cluster time limits. As this only happens occasionally, I do not want to generally increase the time limit for that job, but instead increase it with the number of attempts.
However, after failing due to cluster time limit, a lot of bwa mem tmp files are left in the output directory, which cause bwa mem to immediately fail in the next attempt. The generated tmp files are numbered out.tmp.1.bam .. out.tmp.n.bam
, where n
is some number as bwa mem sees fit, so I cannot simply mark these as temp files in Snakemake and rely on them being deleted on failure (I'm not even sure that this would happen - I don't know exactly when the deletion of files marked as temp is triggered...).
I considered the following solutions:
Delete these files first (by not using the wrapper, but instead copy the wrapper code, and modify it to delete all
out.tmp.*.bam
files before running bwa mem), but this seems ugly.Use a shadow directory, in the hope that this is directory cleared after each attempt, but the documentation says
Shadow directories are stored one per rule execution in
.snakemake/shadow/
, and are cleared on successful execution.Hence, for a failed execution, the temp files would still be there, which will cause subsequent attempts to fail as well. I guess that this is done in order to be able to debug failed runs. But here, it hinders restarts.
An alternative solution would be to have
onstart
,onsuccess
, andonerror
hooks per rule, as previously suggested in #133, but that is an option for the future...
I have posted a feature request for this problem already, but maybe there already is a pure Snakemake solution already out there. Any help appreciated!
Thanks, Lucas
...ANSWER
Answered 2020-Aug-17 at 19:30Update: From a bit more experimentation, it seems that shadow: "full"
does the job, and indeed also deletes the files when the job failed. Not entirely sure though, and the documentation is not clear on that. But so far, it works.
QUESTION
I am writing a snakemake file that shall perform multiple operations on multiple samples. After I validated the workflow running on my local computer, I am now working on running the workflow on a cluster.
My first two rules are independent from one another, the first uses fastqc
and the other bwa mem
These two rules look like (at this point I am only calling the workflow on a single SAMPLE = 'NIPT-PearlPPlasma-03-PPx_S3downSample'
):
ANSWER
Answered 2020-Apr-07 at 18:46Take a look at: https://snakemake.readthedocs.io/en/stable/snakefiles/deployment.html#integrated-package-management
You will have to make a make a conda environment yaml for the rule sort_bam
, something like this:
QUESTION
When snakemake wrappers are used with snakemake scripts, do they get fetched everytime from remote URL or are they stored locally? I don't see them stored anywhere in .snakemake
directory, which makes me think it gets fetched everytime even if same version of wrapper script is used everytime.
ANSWER
Answered 2020-Mar-12 at 14:23Unfortunately Snakemake does fetch wrapper script from remote URL everytime, and currently there doesn't appear to be a solution to change this behavior. One alternative is to have a local clone of the wrapper repository and point snakemake to it using --wrapper-prefix
.
Here is the error message when internet is not available:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install snakemake-wrappers
You can use snakemake-wrappers like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page