replikation / What_the_Phage

WtP: Phage identification via nextflow and docker or singularity
https://mult1fractal.github.io/wtp-documentation/
GNU General Public License v3.0
103 stars 15 forks source link

Install singularity without admins permissions #165

Closed lingyi-owl closed 2 years ago

lingyi-owl commented 2 years ago

Dear developer,

I am building a Snakemake pipeline with WtP nextflow embedded in a wrapper. The script is attached below. The cachedir points to a folder containing singularity images. Our bioinformatician @papanikos helped me build the images before. Now I want to build the singularity myself again. This tutorial https://mult1fractal.github.io/wtp-documentation/installation/Engine/singularity/ showed how to build it with sudo but I am using a cluster without admins permission. Is there a way I can install singularity without admins permission?

I am looking forward to your reply.

Best, Ling-Yi

rule wtp:
    input:
        expand("results/wtp/input/{sample}_scaffolds_gt{length}.fasta",
                sample=ALL_SAMPLES, length=LENGTH)
    output:
        expand("results/wtp/output/{sample}_scaffolds_gt{length}/{sample}_scaffolds_gt{length}_quality_summary.tsv",
                sample=ALL_SAMPLES, length=LENGTH),
    log:
        ".nextflow.log"
    conda:
        "../envs/wtp.yaml"
    params:
        fasta="'results/wtp/input/*.fasta'",
        pipeline="replikation/What_the_Phage",
        revision="v1.0.2",
        profile=["local", "singularity"],
        workdir=config["WTP"]["workdir"],
        databases=config["WTP"]["databases"],
        cachedir=config["WTP"]["cachedir"],
        output=config["WTP"]["outputdir"],
        cores=config["WTP"]["threads"],
        identify=config["WTP"]["identify"],
        annotate=config["WTP"]["annotate"],
        dv=config["WTP"]["dv"],
        ma=config["WTP"]["ma"],
        mp=config["WTP"]["mp"],
        pp=config["WTP"]["pp"],
        sm=config["WTP"]["sm"],
        vb=config["WTP"]["vb"],
        vf=config["WTP"]["vf"],
        vn=config["WTP"]["vn"],
        vs=config["WTP"]["vs"],
        ph=config["WTP"]["ph"],
        vs2=config["WTP"]["vs2"],
        sk=config["WTP"]["sk"]

    handover: True
    wrapper:
        "0.74.0/utils/nextflow"
mult1fractal commented 2 years ago

Hey, Unfortunately, I have not that much experience with singularity... maybe you find something here ?

papanikos commented 2 years ago

Hi @lingyi-owl . Have you tried the --setup workflow as documented here under Conda Usage ? For a first time interactive run you can use that to setup the images and databases locations.

If you want to include this as a step in your workflow - which can be unstable and lead to some frustration IMO - you would need to add an extra rule that wraps the step from above and produces all the required inputs for your rule wtp, specifically databases=config["WTP"]["databases"] and cachedir=config["WTP"]["cachedir"].

lingyi-owl commented 2 years ago

It worked. thank you! @papanikos

replikation commented 2 years ago

thanks for helping out @papanikos