What is the current state of running `snakemake` i...
# help
a
What is the current state of running
snakemake
inside
nextflow
, and specifically
nf-core
? There is a tool, CADD-SV, which we want to run on some of our data. I noticed that someone has implemented the caddsv get command in nf-core already, but this just pre-fetches the annotation data. The actual
caddsv run
command is a wrapper around a
snakemake
pipeline which is hardcoded to run with
--use-conda
. Is it even feasible to run such a tool within a nextflow process? Is it over burdensome with a lot of unnecessary overhead (rebuilding conda envs on every single process execution)? Is there a route to such a tool being in nf-core?
👍 1
i
We have https://nf-co.re/modules/snakemake/ so it must be possible in some scenarios
m
Your other option is to use it nf-cascade style. The poc runs nextflow in nextflow, but you can use it to do snakemake in nextflow in the same way. It just means snakemake needs to be in your PATH too, but Pixi can handle that. Just let me know if you want more details
a
The tool let’s you set a custom conda dir for the internal snakemake envs so I am wondering if that can actually be passed into the process and mounted into any container and would work as intended?
nf-cascade
style seems like it might be quite a heavy solution given that the internal snakemake is always running in a “local” mode (it’s not setup to allow the user to distribute steps across e.g. slurm)
m
Ah, that's a shame, then yes, nf-cascade is overkill. For just local running, the module is optimal I think. And you can always patch it to fit your needs.
m
@Adam Talbot played with the snakemake modules, and if I remember well using conda, he did a full inception, nextflow > snakemake > nextflow, but I don't remember how deep he went
inception 1
a
snakemake
pipeline which is hardcoded to run with
--use-conda
.
why
Running snakemake within a process is fine, it's just CLI calls after all
Installing and/or managing conda environments is a complete joke though.
In this case, you may be able to set the conda_prefix to some shell expansion?
conda_prefix=$(which cadd-sv)
?
m
And how deep did you went in the inception @Adam Talbot?
a
You can leave it going infinitely if you don't mind breaking your computer
i
Next challenge: run the inception in Galaxy
👀 1
🤣 1
o
Hi! I've made Galaxy wrapper for #C07Q8HNU4FK (and published it on the Toolshed by the way). The XML file is [here](github.com/OlivierCoen/stableexpression_galaxy/blob/…/nf_core_stableexpression.xml). I was able do this because nf-core/stableexpression can be run fully with conda / mamba / micromamba. In the Galaxy wrapper, I'm installing
nextflow
and
micromamba
(and
openjdk
but it may be overkill). Besides, I created a `micromamba`profile in the nf-core/stableexpression, and I'm running the pipeline inside Galaxy using this profile. So the inception here is: Galaxy (conda "engine") -> Nextflow (micromamba "engine") I've first tried with
apptainer
instead of
micromamba
, but then I had issues with fuse-fs...
By the way, this repo: github.com/OlivierCoen/stableexpression_galaxy allows one to create dynamically the Galaxy XML file using: • a XML template, containing hardcoded things, like outputs, tests, citations (stable things, that should not move too much in between versions) • a repo URL • a branch The idea behind is to build a XML dynamically from the nf-core repo config files, without having to do it manually. For now, it's dedicated to the stableexpression pipeline, but most things can be easily generalised and adapted to other nf-core pipelines 😉