merenlab / MerenLab-workflows

A repository with scripts to run pipeline that are commonly used in the Meren Lab
GNU General Public License v3.0
11 stars 4 forks source link

we need a smart solution for wrappers #6

Open meren opened 7 years ago

meren commented 7 years ago

I am all for wrappers, but currently we use them at one place, and we need to copy the wrappers directory to a relative location to the snakemake file. I think this is not very feasible, and we need to find a better way to handle wrappers.

This is how I'm running things at the moment:

diff --git a/workflows/assembly-based-metagenomics-workflow/merenlab-metagenomics-pipeline.snakefile b/workflows/assembly-based-metagenomics-workflow/merenlab-metagenomics-pipeline.snakefile
index 38b3b6c..fcd96d2 100644
--- a/workflows/assembly-based-metagenomics-workflow/merenlab-metagenomics-pipeline.snakefile
+++ b/workflows/assembly-based-metagenomics-workflow/merenlab-metagenomics-pipeline.snakefile
@@ -450,10 +450,7 @@ rule reformat_fasta:
     params: prefix = "{group}"
     threads: T('reformat_fasta')
     resources: nodes = T('reformat_fasta'),
-    wrapper:
-        # Notice that path to wrapper is relative to the workdir (if you
-        # want an absolute path, use 'file://' instead of 'file:')
-        "file:wrappers/reformat-fasta"
+    shell: "anvi-script-reformat-fasta {input} -o {output.contigs} -r {output.report} --simplify-names --prefix {params.prefix} >> {log} 2>&1"

 if run_remove_human_dna_using_centrifuge:
ShaiberAlon commented 7 years ago

Meren, don't take this to think that I'm working ;-) But shouldn't we aspire to use the official snakemake wrapper repository? And then we don't need people to put the wrappers in a specific place.

On Aug 27, 2017 1:38 PM, "A. Murat Eren" notifications@github.com wrote:

I am all for wrappers, but currently we use them at one place, and we need to copy the wrappers directory to a relative location to the snakemake file. I think this is not very feasible, and we need to find a better way to handle wrappers.

This is how I'm running things at the moment:

diff --git a/workflows/assembly-based-metagenomics-workflow/merenlab-metagenomics-pipeline.snakefile b/workflows/assembly-based-metagenomics-workflow/merenlab-metagenomics-pipeline.snakefile index 38b3b6c..fcd96d2 100644--- a/workflows/assembly-based-metagenomics-workflow/merenlab-metagenomics-pipeline.snakefile+++ b/workflows/assembly-based-metagenomics-workflow/merenlab-metagenomics-pipeline.snakefile@@ -450,10 +450,7 @@ rule reformat_fasta: params: prefix = "{group}" threads: T('reformat_fasta') resources: nodes = T('reformat_fasta'),- wrapper:- # Notice that path to wrapper is relative to the workdir (if you-

want an absolute path, use 'file://' instead of 'file:')-

"file:wrappers/reformat-fasta"+ shell: "anvi-script-reformat-fasta {input} -o {output.contigs} -r {output.report} --simplify-names --prefix {params.prefix} >> {log} 2>&1"

if run_remove_human_dna_using_centrifuge:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/merenlab/MerenLab-workflows/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AQ18dOItNs5nVqXyC7PSo2aD47tIj8yWks5scbeigaJpZM4PD4Vj .

meren commented 7 years ago

Hey Alon,

I just wanted to leave something behind so we remember it later :) What are YOU doing here!?

But shouldn't we aspire to use the official snakemake wrapper repository?

Absolutely. But this shouldn't stop us from testing and using our stuff effectively and without pain. We can find a way to make this process seamless. I.e, if a wrapper is in the official repository the code would use it from there, if not, the code would set some environmental variables to use them from whatever location on the disk we keep them. Having to copy a directory to run a snakemake file is what is not working :)

I will ask @ozcan's opinion on this during the week.