Michael Hall
I am a Bioinformatics PhD student in Zam Iqbal’s lab at EMBL-EBI. I currently work on using nanopore data and genome graphs to better call variation in bacterial genomes and to compare pan-genomes.
Run entire pipeline inside a given Singularity container
singularity: "docker://quay.io/biocontainers/bwa:0.7.3a--h84994c4_4"
rule map:
input:
query = "data/query.fastq",
ref = "data/ref.fa"
output:
"data/query.sam"
shell:
"bwa mem {input.ref} {input.query} > {output}"Run single rule inside a given Singularity container
rule map:
input:
query = "data/query.fastq",
ref = "data/ref.fa"
output:
"data/query.sam"
singularity: "docker://quay.io/biocontainers/bwa:0.7.3a--h84994c4_4"
shell:
"bwa mem {input.ref} {input.query} > {output}"When executing the pipeline you just need to add the use-singularity option.
snakemake --use-singularitysingularity: "docker://continuumio/miniconda3:4.4.10"
rule plot:
input:
"table.txt"
output:
"plots/myplot.pdf"
conda:
"envs/ggplot.yaml"
script:
"scripts/plot-stuff.R"singularity: "docker://continuumio/miniconda3:4.4.10"
rule plot:
input:
"table.txt"
output:
"plots/myplot.pdf"
conda:
"envs/ggplot.yaml"
script:
"scripts/plot-stuff.R"Will run the whole pipeline inside a container with miniconda installed. For our plot rule we then specify a conda environment.
Note: Still need conda installed locally and use --use-conda when running snakemake.
nextflow run <your script> -with-singularity [singularity image file]Run whole workflow in a container
Or specify the container in the nextflow.config file
process.container = '/path/to/singularity.img'
singularity.enabled = trueprocess {
withName:foo {
container = 'image_name_1'
}
withName:bar {
container = 'image_name_2'
}
}
singularity {
enabled = true
}Or specify multiple containers in the nextflow.config file
By Michael Hall
Singularity + (snakemake||nextflow)
I am a Bioinformatics PhD student in Zam Iqbal’s lab at EMBL-EBI. I currently work on using nanopore data and genome graphs to better call variation in bacterial genomes and to compare pan-genomes.