How to run Snakemake pipeline from .py file instead of .smk file.
Hi, for my purpose I want to write snakemake rules as part of python (.py) execution file, how to do it right?
Thanks!
snakemake
python
pipeline
• 3,839 views
•
link
written
by
Artem Kiselev •
0 answers
No answers yet.
Log in to answer this question.
More posts like this
-
python file for coding potential calculator
written by Ashok •i want to do coding potential using coding potential calculator 2 tool (cpc2). my python version is 3. i have cpc2.py file but it is …
-
take user options before calling snakemake
written by H.HasaniHi all, I'm writing a workflow that depends on user's input. For example, if the user choses analysis A, the scripts 1,2,3 will run while …
-
Snakemake, snake files
written by beginner123 •Hi everyone, I want to make a snake file. I already downloaded snakemake, but what command should I do in order to make a snake …
-
Snakemake and (external) jupyter notebooks
written by iibrams07 •I want to integrate snakemake with jupyter notebooks. More precisely, I have a jupyter notebook in which I am doing a machine learning project with …
-
Snakemake crashes with "JSONDecodeError: Extra data:"
written by RNG_Daemon •I am running a snakemake pipeline for variant calling. It executes the jobs just fine, but when the jobs finish, snakemake crashes while trying to …
-
Allow for failed wildcards in Snakemake workflow
written by mrmrwinter •Hi, I have a snakemake workflow that contains a small section with several shell command rules and external python script rules. The rules iterate over …
-
How to use Snakemake with tools which don't have clearly defined output options for files?
written by Artem Kiselev •Hi, I would like to use Snakemake in my variant annotation pipeline. But Annovar don't have clearly defined file output option (I can assign only …
-
Use of if-else statement in snakemake rule
written by Jokhe •Hi! I'm building snakemake pipeline for `VarScan2` variant calling. As a result of `VarScan2`, I have six VCF files that must be processed individually and …
-
Multithreading Python3 + Samtools
written by glihmHi there ! I am working on Ribosome Profiling data, and I want to use Python3 multithreading to speed up my program. To describe the …
-
Tool: Snakemake--Python-Based Workflow Management
written by Sean DavisFrom [the snakemake website][1]: > Build systems like GNU Make are frequently used to create complicated workflows, e.g. in bioinformatics. This project aims to reduce …
Please elaborate on what you are trying to do. Your current question does not contain enough information.
I also have no idea why you would like to do this.
My idea is the using of KNIME Analytics Platform for organisation of my SNP-calling pipeline, but despite the strong GUI capabilities, KNIME don't have enough good abilities for running of external programs (parallelism, etc). Inside of KNIME there is ability to run pure python scripts (form Knime gui with sort of IDE). I want to run of snakemake rules, directly from KNIME, using its capabilities to work with Python. In this case, I will be able to use all the KNIME features (for example flow variables) and convenient Snakemake features.
I'm not familiar with KNIME, but by running snakemake in python in KNIME it sounds like you are stacking too many layers of complexity.
I also suspect that everything you want from KNIME can be done directly in snakemake and it would probably be easier not to complicate all of this.
Another advantage of snakemake is its reproducibility - for example, share your pipeline upon publication. That feature is probably entirely lost in your application.
Thanks for your comment, but it seems to me that it is more convenient to use a graphical interface for organizing scientific work, it is rather difficult to understand a large number of files, protocols and versions. With the help of KNIME, I have organized a very convenient pipeline for working with R based DeSeq2, it is very easy to reproduce, correct and share with colleagues.
I completely agree with Wouter, this seems needlessly complex and likely more difficult to maintain than a straightforward snakemake pipeline.
Regardless, the subprocess module will let you call external commands from within python. Basically all I can point you to with the complete lack of details regarding what you specifically want, so I'm making the assumption that you're pre-creating your snakemake file and just want it to be run from a python script initiated by KNIME. If you're looking to actually write the snakemake file dynamically with variables, etc, from KNIME, then your question is likely way beyond the scope of biostars.
Thank you, I described the problem very confusingly. The question was about dynamic writing of snakemake file, using python.
Yeah, then you really just need to write a file with python and use variables to change anything dynamic as needed. What specifically are you having an issue with?
Extensions are meaningless (largely). Doesn't matter what it ends with.