From ac89acdcccd48e340a15c7486359be9ec8623d2b Mon Sep 17 00:00:00 2001 From: MaxUlysse Date: Fri, 25 Jun 2021 11:49:48 +0200 Subject: [PATCH 01/10] feat: add VEP module --- software/vep/Dockerfile | 30 ++++++++++++++ software/vep/build.sh | 47 ++++++++++++++++++++++ software/vep/environment.yml | 10 +++++ software/vep/functions.nf | 68 ++++++++++++++++++++++++++++++++ software/vep/main.nf | 62 +++++++++++++++++++++++++++++ software/vep/meta.yml | 53 +++++++++++++++++++++++++ tests/config/pytest_software.yml | 4 ++ tests/software/vep/main.nf | 12 ++++++ tests/software/vep/test.yml | 7 ++++ 9 files changed, 293 insertions(+) create mode 100644 software/vep/Dockerfile create mode 100755 software/vep/build.sh create mode 100644 software/vep/environment.yml create mode 100644 software/vep/functions.nf create mode 100644 software/vep/main.nf create mode 100644 software/vep/meta.yml create mode 100644 tests/software/vep/main.nf create mode 100644 tests/software/vep/test.yml diff --git a/software/vep/Dockerfile b/software/vep/Dockerfile new file mode 100644 index 00000000000..9c458e3ce37 --- /dev/null +++ b/software/vep/Dockerfile @@ -0,0 +1,30 @@ +FROM nfcore/base:1.14 +LABEL \ + author="Maxime Garcia" \ + description="VEP image for nf-core pipelines" \ + maintainer="maxime.garcia@scilifelab.se" + +# Install the conda environment +COPY environment.yml / +RUN conda env create -f /environment.yml && conda clean -a + +# Add conda installation dir to PATH (instead of doing 'conda activate') +ENV PATH /opt/conda/envs/nf-core-vep-104.3/bin:$PATH + +# Setup default ARG variables +ARG GENOME=GRCh38 +ARG SPECIES=homo_sapiens +ARG VEP_VERSION=99 + +# Download Genome +RUN vep_install \ + -a c \ + -c .vep \ + -s ${SPECIES} \ + -y ${GENOME} \ + --CACHE_VERSION ${VEP_VERSION} \ + --CONVERT \ + --NO_BIOPERL --NO_HTSLIB --NO_TEST --NO_UPDATE + +# Dump the details of the installed packages to a file for posterity +RUN conda env export --name nf-core-vep-104.3 > nf-core-vep-104.3.yml \ No newline at end of file diff --git a/software/vep/build.sh b/software/vep/build.sh new file mode 100755 index 00000000000..e8bdc950ad2 --- /dev/null +++ b/software/vep/build.sh @@ -0,0 +1,47 @@ +export GENOME=GRCh37 +export SPECIES=homo_sapiens +export VEP_VERSION=104 +export VEP_TAG=104.3 + +docker build -t nfcore/vep:${VEP_TAG}.${GENOME} modules/nf-core/software/vep/. --build-arg GENOME=${GENOME} --build-arg SPECIES=${SPECIES} --build-arg VEP_VERSION=${VEP_VERSION} +docker push nfcore/vep:${VEP_TAG}.${GENOME} + +export GENOME=GRCh38 +export SPECIES=homo_sapiens +export VEP_VERSION=104 +export VEP_TAG=104.3 + +docker build -t nfcore/vep:${VEP_TAG}.${GENOME} modules/nf-core/software/vep/. --build-arg GENOME=${GENOME} --build-arg SPECIES=${SPECIES} --build-arg VEP_VERSION=${VEP_VERSION} +docker push nfcore/vep:${VEP_TAG}.${GENOME} + +export GENOME=GRCm39 +export SPECIES=mus_musculus +export VEP_VERSION=104 +export VEP_TAG=104.3 + +docker build -t nfcore/vep:${VEP_TAG}.${GENOME} modules/nf-core/software/vep/. --build-arg GENOME=${GENOME} --build-arg SPECIES=${SPECIES} --build-arg VEP_VERSION=${VEP_VERSION} +docker push nfcore/vep:${VEP_TAG}.${GENOME} + +export GENOME=GRCm38 +export SPECIES=mus_musculus +export VEP_VERSION=102 +export VEP_TAG=104.3 + +docker build -t nfcore/vep:${VEP_TAG}.${GENOME} modules/nf-core/software/vep/. --build-arg GENOME=${GENOME} --build-arg SPECIES=${SPECIES} --build-arg VEP_VERSION=${VEP_VERSION} +docker push nfcore/vep:${VEP_TAG}.${GENOME} + +export GENOME=CanFam3.1 +export SPECIES=canis_lupus_familiaris +export VEP_VERSION=104 +export VEP_TAG=104.3 + +docker build -t nfcore/vep:${VEP_TAG}.${GENOME} modules/nf-core/software/vep/. --build-arg GENOME=${GENOME} --build-arg SPECIES=${SPECIES} --build-arg VEP_VERSION=${VEP_VERSION} +docker push nfcore/vep:${VEP_TAG}.${GENOME} + +export GENOME=WBcel235 +export SPECIES=caenorhabditis_elegans +export VEP_VERSION=104 +export VEP_TAG=104.3 + +docker build -t nfcore/vep:${VEP_TAG}.${GENOME} modules/nf-core/software/vep/. --build-arg GENOME=${GENOME} --build-arg SPECIES=${SPECIES} --build-arg VEP_VERSION=${VEP_VERSION} +docker push nfcore/vep:${VEP_TAG}.${GENOME} diff --git a/software/vep/environment.yml b/software/vep/environment.yml new file mode 100644 index 00000000000..624eb00884a --- /dev/null +++ b/software/vep/environment.yml @@ -0,0 +1,10 @@ +# You can use this file to create a conda environment for this pipeline: +# conda env create -f environment.yml +name: nf-core-vep-104.3 +channels: + - conda-forge + - bioconda + - defaults + +dependencies: + - bioconda::ensembl-vep=104.3 diff --git a/software/vep/functions.nf b/software/vep/functions.nf new file mode 100644 index 00000000000..da9da093d3f --- /dev/null +++ b/software/vep/functions.nf @@ -0,0 +1,68 @@ +// +// Utility functions used in nf-core DSL2 module files +// + +// +// Extract name of software tool from process name using $task.process +// +def getSoftwareName(task_process) { + return task_process.tokenize(':')[-1].tokenize('_')[0].toLowerCase() +} + +// +// Function to initialise default values and to generate a Groovy Map of available options for nf-core modules +// +def initOptions(Map args) { + def Map options = [:] + options.args = args.args ?: '' + options.args2 = args.args2 ?: '' + options.args3 = args.args3 ?: '' + options.publish_by_meta = args.publish_by_meta ?: [] + options.publish_dir = args.publish_dir ?: '' + options.publish_files = args.publish_files + options.suffix = args.suffix ?: '' + return options +} + +// +// Tidy up and join elements of a list to return a path string +// +def getPathFromList(path_list) { + def paths = path_list.findAll { item -> !item?.trim().isEmpty() } // Remove empty entries + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes + return paths.join('/') +} + +// +// Function to save/publish module results +// +def saveFiles(Map args) { + if (!args.filename.endsWith('.version.txt')) { + def ioptions = initOptions(args.options) + def path_list = [ ioptions.publish_dir ?: args.publish_dir ] + if (ioptions.publish_by_meta) { + def key_list = ioptions.publish_by_meta instanceof List ? ioptions.publish_by_meta : args.publish_by_meta + for (key in key_list) { + if (args.meta && key instanceof String) { + def path = key + if (args.meta.containsKey(key)) { + path = args.meta[key] instanceof Boolean ? "${key}_${args.meta[key]}".toString() : args.meta[key] + } + path = path instanceof String ? path : '' + path_list.add(path) + } + } + } + if (ioptions.publish_files instanceof Map) { + for (ext in ioptions.publish_files) { + if (args.filename.endsWith(ext.key)) { + def ext_list = path_list.collect() + ext_list.add(ext.value) + return "${getPathFromList(ext_list)}/$args.filename" + } + } + } else if (ioptions.publish_files == null) { + return "${getPathFromList(path_list)}/$args.filename" + } + } +} diff --git a/software/vep/main.nf b/software/vep/main.nf new file mode 100644 index 00000000000..d8dba478c77 --- /dev/null +++ b/software/vep/main.nf @@ -0,0 +1,62 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName } from './functions' + +params.options = [:] +options = initOptions(params.options) +params.use_cache = false +params.vep_tag = "" + +process VEP { + label 'process_medium' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } + + conda (params.enable_conda ? "bioconda::vep=104.3" : null) + if (params.use_cache) { + if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { + container "https://depot.galaxyproject.org/singularity/vep:104.3--pl5262h4a94de4_0" + } else { + container "quay.io/biocontainers/vep:104.3--pl5262h4a94de4_0" + } + } else { + container "nfcore/vep:${params.vep_tag}" + } + + input: + tuple val(meta), path(vcf) + val (vep_genome) + val (vep_species) + val (vep_cache_version) + path (vep_cache) + + output: + tuple val(meta), path("*.ann.vcf"), emit: vcf + path "*.summary.html", emit: report + path "*.version.txt", emit: version + + script: + def software = getSoftwareName(task.process) + prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + dir_cache = params.use_cache ? "\${PWD}/${vep_cache}" : "/.vep" + """ + mkdir ${prefix} + + vep \\ + -i $vcf \\ + -o ${prefix}.ann.vcf \\ + $options.args \\ + --assembly $vep_genome \\ + --species $vep_species \\ + --cache \\ + --cache_version $vep_cache_version \\ + --dir_cache $dir_cache \\ + --fork $task.cpus \\ + --format vcf \\ + --stats_file ${prefix}.summary.html + + rm -rf ${prefix} + + echo \$(vep --help 2>&1) > ${software}.version.txt + """ +} diff --git a/software/vep/meta.yml b/software/vep/meta.yml new file mode 100644 index 00000000000..326071ff429 --- /dev/null +++ b/software/vep/meta.yml @@ -0,0 +1,53 @@ +name: VEP +description: Ensembl Variant Effect Predictor (VEP) +keywords: + - annotation +tools: + - vep: + description: | + VEP determines the effect of your variants (SNPs, insertions, deletions, CNVs + or structural variants) on genes, transcripts, and protein sequence, as well as regulatory regions. + homepage: https://www.ensembl.org/info/docs/tools/vep/index.html + documentation: https://www.ensembl.org/info/docs/tools/vep/script/index.html +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: | + vcf to annotate + - vep_genome: + type: value + description: | + which genome to annotate with + - vep_species: + type: value + description: | + which species to annotate with + - vep_cache_version: + type: value + description: | + which version of the cache to annotate with + - vep_cache: + type: file + description: | + path to VEP cache (optional) +output: + - vcf_ann: + type: file + description: | + annotated vcf + pattern: "*.ann.vcf" + - report: + type: file + description: VEP report file + pattern: "*.html" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" +authors: + - "@maxulysse" diff --git a/tests/config/pytest_software.yml b/tests/config/pytest_software.yml index 2ec0478c4f1..72b2799b2fe 100644 --- a/tests/config/pytest_software.yml +++ b/tests/config/pytest_software.yml @@ -747,6 +747,10 @@ vcftools: - software/vcftools/** - tests/software/vcftools/** +vep: + - software/vep/** + - tests/software/vep/** + yara/index: - software/yara/index/** - tests/software/yara/index/** diff --git a/tests/software/vep/main.nf b/tests/software/vep/main.nf new file mode 100644 index 00000000000..c79dbc6fa14 --- /dev/null +++ b/tests/software/vep/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { VEP } from '../../../software/vep/main.nf' addParams( vep_tag: '104.3.WBcel235', use_cache: false ) + +workflow test_vep { + input = [ [ id:'test' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] + ] + VEP ( input, "WBcel235", "caenorhabditis_elegans", "104", [] ) +} diff --git a/tests/software/vep/test.yml b/tests/software/vep/test.yml new file mode 100644 index 00000000000..4db5fd58ca2 --- /dev/null +++ b/tests/software/vep/test.yml @@ -0,0 +1,7 @@ +- name: vep test_vep + command: nextflow run tests/software/vep -entry test_vep -c tests/config/nextflow.config + tags: + - vep + files: + - path: output/vep/test.ann.vcf + - path: output/vep/test.summary.html From 765daa5f466d3080e1da2532a769230136d905db Mon Sep 17 00:00:00 2001 From: MaxUlysse Date: Fri, 25 Jun 2021 12:03:47 +0200 Subject: [PATCH 02/10] fix: name --- software/{vep => ensemblvep}/Dockerfile | 0 software/{vep => ensemblvep}/build.sh | 0 software/{vep => ensemblvep}/environment.yml | 0 software/{vep => ensemblvep}/functions.nf | 0 software/{vep => ensemblvep}/main.nf | 8 ++++---- software/{vep => ensemblvep}/meta.yml | 6 +++--- tests/config/pytest_software.yml | 8 ++++---- tests/software/ensemblvep/main.nf | 12 ++++++++++++ tests/software/ensemblvep/test.yml | 7 +++++++ tests/software/vep/main.nf | 12 ------------ tests/software/vep/test.yml | 7 ------- 11 files changed, 30 insertions(+), 30 deletions(-) rename software/{vep => ensemblvep}/Dockerfile (100%) rename software/{vep => ensemblvep}/build.sh (100%) rename software/{vep => ensemblvep}/environment.yml (100%) rename software/{vep => ensemblvep}/functions.nf (100%) rename software/{vep => ensemblvep}/main.nf (89%) rename software/{vep => ensemblvep}/meta.yml (94%) create mode 100644 tests/software/ensemblvep/main.nf create mode 100644 tests/software/ensemblvep/test.yml delete mode 100644 tests/software/vep/main.nf delete mode 100644 tests/software/vep/test.yml diff --git a/software/vep/Dockerfile b/software/ensemblvep/Dockerfile similarity index 100% rename from software/vep/Dockerfile rename to software/ensemblvep/Dockerfile diff --git a/software/vep/build.sh b/software/ensemblvep/build.sh similarity index 100% rename from software/vep/build.sh rename to software/ensemblvep/build.sh diff --git a/software/vep/environment.yml b/software/ensemblvep/environment.yml similarity index 100% rename from software/vep/environment.yml rename to software/ensemblvep/environment.yml diff --git a/software/vep/functions.nf b/software/ensemblvep/functions.nf similarity index 100% rename from software/vep/functions.nf rename to software/ensemblvep/functions.nf diff --git a/software/vep/main.nf b/software/ensemblvep/main.nf similarity index 89% rename from software/vep/main.nf rename to software/ensemblvep/main.nf index d8dba478c77..e726a72d61c 100644 --- a/software/vep/main.nf +++ b/software/ensemblvep/main.nf @@ -6,18 +6,18 @@ options = initOptions(params.options) params.use_cache = false params.vep_tag = "" -process VEP { +process ENSEMBLVEP { label 'process_medium' publishDir "${params.outdir}", mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } - conda (params.enable_conda ? "bioconda::vep=104.3" : null) + conda (params.enable_conda ? "bioconda::ensembl-vep=104.3" : null) if (params.use_cache) { if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/vep:104.3--pl5262h4a94de4_0" + container "https://depot.galaxyproject.org/singularity/ensembl-vep:104.3--pl5262h4a94de4_0" } else { - container "quay.io/biocontainers/vep:104.3--pl5262h4a94de4_0" + container "quay.io/biocontainers/ensembl-vep:104.3--pl5262h4a94de4_0" } } else { container "nfcore/vep:${params.vep_tag}" diff --git a/software/vep/meta.yml b/software/ensemblvep/meta.yml similarity index 94% rename from software/vep/meta.yml rename to software/ensemblvep/meta.yml index 326071ff429..28c3e4d3b23 100644 --- a/software/vep/meta.yml +++ b/software/ensemblvep/meta.yml @@ -1,12 +1,12 @@ -name: VEP +name: ENSEMBLVEP description: Ensembl Variant Effect Predictor (VEP) keywords: - annotation tools: - - vep: + - ensemblvep: description: | VEP determines the effect of your variants (SNPs, insertions, deletions, CNVs - or structural variants) on genes, transcripts, and protein sequence, as well as regulatory regions. + or structural variants) on genes, transcripts, and protein sequence, as well as regulatory regions. homepage: https://www.ensembl.org/info/docs/tools/vep/index.html documentation: https://www.ensembl.org/info/docs/tools/vep/script/index.html input: diff --git a/tests/config/pytest_software.yml b/tests/config/pytest_software.yml index 72b2799b2fe..ddf6b901f5f 100644 --- a/tests/config/pytest_software.yml +++ b/tests/config/pytest_software.yml @@ -222,6 +222,10 @@ dshbio/splitgff3: - software/dshbio/splitgff3/** - tests/software/dshbio/splitgff3/** +ensemblvep: + - software/ensemblvep/** + - tests/software/ensemblvep/** + fastp: - software/fastp/** - tests/software/fastp/** @@ -747,10 +751,6 @@ vcftools: - software/vcftools/** - tests/software/vcftools/** -vep: - - software/vep/** - - tests/software/vep/** - yara/index: - software/yara/index/** - tests/software/yara/index/** diff --git a/tests/software/ensemblvep/main.nf b/tests/software/ensemblvep/main.nf new file mode 100644 index 00000000000..5681e5e16f0 --- /dev/null +++ b/tests/software/ensemblvep/main.nf @@ -0,0 +1,12 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { ENSEMBLVEP } from '../../../software/ensemblvep/main.nf' addParams( vep_tag: '104.3.WBcel235', use_cache: false ) + +workflow test_ensemblvep { + input = [ [ id:'test' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] + ] + ENSEMBLVEP ( input, "WBcel235", "caenorhabditis_elegans", "104", [] ) +} diff --git a/tests/software/ensemblvep/test.yml b/tests/software/ensemblvep/test.yml new file mode 100644 index 00000000000..67c90a83f46 --- /dev/null +++ b/tests/software/ensemblvep/test.yml @@ -0,0 +1,7 @@ +- name: ensemblvep test_ensemblvep + command: nextflow run tests/software/ensemblvep -entry test_ensemblvep -c tests/config/nextflow.config + tags: + - ensemblvep + files: + - path: output/ensemblvep/test.ann.vcf + - path: output/ensemblvep/test.summary.html diff --git a/tests/software/vep/main.nf b/tests/software/vep/main.nf deleted file mode 100644 index c79dbc6fa14..00000000000 --- a/tests/software/vep/main.nf +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { VEP } from '../../../software/vep/main.nf' addParams( vep_tag: '104.3.WBcel235', use_cache: false ) - -workflow test_vep { - input = [ [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] - ] - VEP ( input, "WBcel235", "caenorhabditis_elegans", "104", [] ) -} diff --git a/tests/software/vep/test.yml b/tests/software/vep/test.yml deleted file mode 100644 index 4db5fd58ca2..00000000000 --- a/tests/software/vep/test.yml +++ /dev/null @@ -1,7 +0,0 @@ -- name: vep test_vep - command: nextflow run tests/software/vep -entry test_vep -c tests/config/nextflow.config - tags: - - vep - files: - - path: output/vep/test.ann.vcf - - path: output/vep/test.summary.html From 52768e96d4ef105af251bbcb39c83acd8c8bf664 Mon Sep 17 00:00:00 2001 From: MaxUlysse Date: Fri, 25 Jun 2021 12:05:25 +0200 Subject: [PATCH 03/10] fix: EC lint] --- software/ensemblvep/Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/software/ensemblvep/Dockerfile b/software/ensemblvep/Dockerfile index 9c458e3ce37..ac1b4691173 100644 --- a/software/ensemblvep/Dockerfile +++ b/software/ensemblvep/Dockerfile @@ -18,13 +18,13 @@ ARG VEP_VERSION=99 # Download Genome RUN vep_install \ - -a c \ - -c .vep \ - -s ${SPECIES} \ - -y ${GENOME} \ - --CACHE_VERSION ${VEP_VERSION} \ - --CONVERT \ - --NO_BIOPERL --NO_HTSLIB --NO_TEST --NO_UPDATE + -a c \ + -c .vep \ + -s ${SPECIES} \ + -y ${GENOME} \ + --CACHE_VERSION ${VEP_VERSION} \ + --CONVERT \ + --NO_BIOPERL --NO_HTSLIB --NO_TEST --NO_UPDATE # Dump the details of the installed packages to a file for posterity -RUN conda env export --name nf-core-vep-104.3 > nf-core-vep-104.3.yml \ No newline at end of file +RUN conda env export --name nf-core-vep-104.3 > nf-core-vep-104.3.yml From 1f063d7c5caa26ee32c33f158a2594e5ae84685d Mon Sep 17 00:00:00 2001 From: MaxUlysse Date: Tue, 29 Jun 2021 10:29:12 +0200 Subject: [PATCH 04/10] feat: add info about params --- software/ensemblvep/meta.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/software/ensemblvep/meta.yml b/software/ensemblvep/meta.yml index 28c3e4d3b23..9936578efb0 100644 --- a/software/ensemblvep/meta.yml +++ b/software/ensemblvep/meta.yml @@ -10,6 +10,16 @@ tools: homepage: https://www.ensembl.org/info/docs/tools/vep/index.html documentation: https://www.ensembl.org/info/docs/tools/vep/script/index.html input: + - use_cache: + type: params + description: | + boolean to enable the usage of containers with cache + Does not work with conda + - vep_tag: + type: params + description: | + Specify the tag for the container + https://hub.docker.com/r/nfcore/vep/tags - meta: type: map description: | From 0de9f888644d2b2ce8c3ed269be74bf110811dd9 Mon Sep 17 00:00:00 2001 From: MaxUlysse Date: Tue, 29 Jun 2021 10:31:25 +0200 Subject: [PATCH 05/10] fix: params as params, not input --- software/ensemblvep/meta.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/software/ensemblvep/meta.yml b/software/ensemblvep/meta.yml index 9936578efb0..15d28a7145c 100644 --- a/software/ensemblvep/meta.yml +++ b/software/ensemblvep/meta.yml @@ -9,17 +9,18 @@ tools: or structural variants) on genes, transcripts, and protein sequence, as well as regulatory regions. homepage: https://www.ensembl.org/info/docs/tools/vep/index.html documentation: https://www.ensembl.org/info/docs/tools/vep/script/index.html -input: +params: - use_cache: - type: params + type: boolean description: | - boolean to enable the usage of containers with cache + Enable the usage of containers with cache Does not work with conda - vep_tag: - type: params + type: value description: | Specify the tag for the container https://hub.docker.com/r/nfcore/vep/tags +input: - meta: type: map description: | From 93b5bae7b01b4bf5be4e7407d4a5c0e0ce3f8da3 Mon Sep 17 00:00:00 2001 From: MaxUlysse Date: Tue, 29 Jun 2021 13:23:39 +0200 Subject: [PATCH 06/10] fix: improve script --- software/ensemblvep/build.sh | 74 +++++++++++++----------------------- 1 file changed, 27 insertions(+), 47 deletions(-) diff --git a/software/ensemblvep/build.sh b/software/ensemblvep/build.sh index e8bdc950ad2..5fcb91dfe74 100755 --- a/software/ensemblvep/build.sh +++ b/software/ensemblvep/build.sh @@ -1,47 +1,27 @@ -export GENOME=GRCh37 -export SPECIES=homo_sapiens -export VEP_VERSION=104 -export VEP_TAG=104.3 - -docker build -t nfcore/vep:${VEP_TAG}.${GENOME} modules/nf-core/software/vep/. --build-arg GENOME=${GENOME} --build-arg SPECIES=${SPECIES} --build-arg VEP_VERSION=${VEP_VERSION} -docker push nfcore/vep:${VEP_TAG}.${GENOME} - -export GENOME=GRCh38 -export SPECIES=homo_sapiens -export VEP_VERSION=104 -export VEP_TAG=104.3 - -docker build -t nfcore/vep:${VEP_TAG}.${GENOME} modules/nf-core/software/vep/. --build-arg GENOME=${GENOME} --build-arg SPECIES=${SPECIES} --build-arg VEP_VERSION=${VEP_VERSION} -docker push nfcore/vep:${VEP_TAG}.${GENOME} - -export GENOME=GRCm39 -export SPECIES=mus_musculus -export VEP_VERSION=104 -export VEP_TAG=104.3 - -docker build -t nfcore/vep:${VEP_TAG}.${GENOME} modules/nf-core/software/vep/. --build-arg GENOME=${GENOME} --build-arg SPECIES=${SPECIES} --build-arg VEP_VERSION=${VEP_VERSION} -docker push nfcore/vep:${VEP_TAG}.${GENOME} - -export GENOME=GRCm38 -export SPECIES=mus_musculus -export VEP_VERSION=102 -export VEP_TAG=104.3 - -docker build -t nfcore/vep:${VEP_TAG}.${GENOME} modules/nf-core/software/vep/. --build-arg GENOME=${GENOME} --build-arg SPECIES=${SPECIES} --build-arg VEP_VERSION=${VEP_VERSION} -docker push nfcore/vep:${VEP_TAG}.${GENOME} - -export GENOME=CanFam3.1 -export SPECIES=canis_lupus_familiaris -export VEP_VERSION=104 -export VEP_TAG=104.3 - -docker build -t nfcore/vep:${VEP_TAG}.${GENOME} modules/nf-core/software/vep/. --build-arg GENOME=${GENOME} --build-arg SPECIES=${SPECIES} --build-arg VEP_VERSION=${VEP_VERSION} -docker push nfcore/vep:${VEP_TAG}.${GENOME} - -export GENOME=WBcel235 -export SPECIES=caenorhabditis_elegans -export VEP_VERSION=104 -export VEP_TAG=104.3 - -docker build -t nfcore/vep:${VEP_TAG}.${GENOME} modules/nf-core/software/vep/. --build-arg GENOME=${GENOME} --build-arg SPECIES=${SPECIES} --build-arg VEP_VERSION=${VEP_VERSION} -docker push nfcore/vep:${VEP_TAG}.${GENOME} +#!/usr/bin/env bash +set -euo pipefail + +# Build and push all containers + +build_push() { + GENOME=$1 + SPECIES=$2 + VEP_VERSION=$3 + VEP_TAG=$4 + + docker build \ + -t nfcore/vep:${VEP_TAG}.${GENOME} \ + software/vep/. \ + --build-arg GENOME=${GENOME} \ + --build-arg SPECIES=${SPECIES} \ + --build-arg VEP_VERSION=${VEP_VERSION} + + docker push nfcore/vep:${VEP_TAG}.${GENOME} +} + +build_push "GRCh37" "homo_sapiens" "104" "104.3" +build_push "GRCh38" "homo_sapiens" "104" "104.3" +build_push "GRCm38" "mus_musculus" "102" "104.3" +build_push "GRCm39" "mus_musculus" "104" "104.3" +build_push "CanFam3.1" "canis_lupus_familiaris" "104" "104.3" +build_push "WBcel235" "caenorhabditis_elegans" "104" "104.3" From e3c5b25a7905583efa12b7399b1bf6ff8c68db36 Mon Sep 17 00:00:00 2001 From: "Maxime U. Garcia" Date: Tue, 6 Jul 2021 10:56:26 +0200 Subject: [PATCH 07/10] Update software/ensemblvep/environment.yml Co-authored-by: Harshil Patel --- software/ensemblvep/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/ensemblvep/environment.yml b/software/ensemblvep/environment.yml index 624eb00884a..c0731c26d81 100644 --- a/software/ensemblvep/environment.yml +++ b/software/ensemblvep/environment.yml @@ -1,4 +1,4 @@ -# You can use this file to create a conda environment for this pipeline: +# You can use this file to create a conda environment for this module: # conda env create -f environment.yml name: nf-core-vep-104.3 channels: From 28a0317b245c8bfb3e911a62ccb0a480b5365ad3 Mon Sep 17 00:00:00 2001 From: "Maxime U. Garcia" Date: Tue, 6 Jul 2021 11:28:15 +0200 Subject: [PATCH 08/10] Apply suggestions from code review Co-authored-by: Harshil Patel --- software/ensemblvep/main.nf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/software/ensemblvep/main.nf b/software/ensemblvep/main.nf index e726a72d61c..26e020e3dab 100644 --- a/software/ensemblvep/main.nf +++ b/software/ensemblvep/main.nf @@ -25,10 +25,10 @@ process ENSEMBLVEP { input: tuple val(meta), path(vcf) - val (vep_genome) - val (vep_species) - val (vep_cache_version) - path (vep_cache) + val genome + val species + val cache_version + path cache output: tuple val(meta), path("*.ann.vcf"), emit: vcf @@ -37,10 +37,10 @@ process ENSEMBLVEP { script: def software = getSoftwareName(task.process) - prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" - dir_cache = params.use_cache ? "\${PWD}/${vep_cache}" : "/.vep" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + dir_cache = params.use_cache ? "\${PWD}/${cache}" : "/.vep" """ - mkdir ${prefix} + mkdir $prefix vep \\ -i $vcf \\ @@ -55,7 +55,7 @@ process ENSEMBLVEP { --format vcf \\ --stats_file ${prefix}.summary.html - rm -rf ${prefix} + rm -rf $prefix echo \$(vep --help 2>&1) > ${software}.version.txt """ From d0a891ca1d698c442a3b010e0a440614847eba84 Mon Sep 17 00:00:00 2001 From: "Maxime U. Garcia" Date: Tue, 6 Jul 2021 13:51:10 +0200 Subject: [PATCH 09/10] Apply suggestions from code review --- software/ensemblvep/main.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/software/ensemblvep/main.nf b/software/ensemblvep/main.nf index 26e020e3dab..fac818a5d98 100644 --- a/software/ensemblvep/main.nf +++ b/software/ensemblvep/main.nf @@ -46,10 +46,10 @@ process ENSEMBLVEP { -i $vcf \\ -o ${prefix}.ann.vcf \\ $options.args \\ - --assembly $vep_genome \\ - --species $vep_species \\ + --assembly $genome \\ + --species $species \\ --cache \\ - --cache_version $vep_cache_version \\ + --cache_version $cache_version \\ --dir_cache $dir_cache \\ --fork $task.cpus \\ --format vcf \\ From 3ec7874aa80238526f2ac5cf92d6716530b45e41 Mon Sep 17 00:00:00 2001 From: "Maxime U. Garcia" Date: Tue, 6 Jul 2021 14:07:42 +0200 Subject: [PATCH 10/10] Apply suggestions from code review Co-authored-by: Harshil Patel --- software/ensemblvep/main.nf | 4 ++-- software/ensemblvep/meta.yml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/software/ensemblvep/main.nf b/software/ensemblvep/main.nf index fac818a5d98..c2194e77b7f 100644 --- a/software/ensemblvep/main.nf +++ b/software/ensemblvep/main.nf @@ -32,8 +32,8 @@ process ENSEMBLVEP { output: tuple val(meta), path("*.ann.vcf"), emit: vcf - path "*.summary.html", emit: report - path "*.version.txt", emit: version + path "*.summary.html" , emit: report + path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) diff --git a/software/ensemblvep/meta.yml b/software/ensemblvep/meta.yml index 15d28a7145c..5eb111e96a1 100644 --- a/software/ensemblvep/meta.yml +++ b/software/ensemblvep/meta.yml @@ -30,24 +30,24 @@ input: type: file description: | vcf to annotate - - vep_genome: + - genome: type: value description: | which genome to annotate with - - vep_species: + - species: type: value description: | which species to annotate with - - vep_cache_version: + - cache_version: type: value description: | which version of the cache to annotate with - - vep_cache: + - cache: type: file description: | path to VEP cache (optional) output: - - vcf_ann: + - vcf: type: file description: | annotated vcf