From 6a147b8aaa5b07290ac823124a690a90f26ba19a Mon Sep 17 00:00:00 2001 From: MaxUlysse Date: Tue, 16 Feb 2021 19:11:36 +0100 Subject: [PATCH 1/4] chores: replace bcftools/bgzip by tabix/bgzip cf #179 --- .github/filters.yml | 8 +++---- .../{bcftools => tabix}/bgzip/functions.nf | 0 software/{bcftools => tabix}/bgzip/main.nf | 14 ++++++------- software/{bcftools => tabix}/bgzip/meta.yml | 21 ++++++++++--------- tests/software/bcftools/bgzip/test.yml | 8 ------- .../{bcftools => tabix}/bgzip/main.nf | 6 +++--- tests/software/tabix/bgzip/test.yml | 8 +++++++ 7 files changed, 33 insertions(+), 32 deletions(-) rename software/{bcftools => tabix}/bgzip/functions.nf (100%) rename software/{bcftools => tabix}/bgzip/main.nf (68%) rename software/{bcftools => tabix}/bgzip/meta.yml (84%) delete mode 100644 tests/software/bcftools/bgzip/test.yml rename tests/software/{bcftools => tabix}/bgzip/main.nf (54%) create mode 100644 tests/software/tabix/bgzip/test.yml diff --git a/.github/filters.yml b/.github/filters.yml index 9fe5cdb9..c462d603 100644 --- a/.github/filters.yml +++ b/.github/filters.yml @@ -2,10 +2,6 @@ bandage_image: - software/bandage/image/** - tests/software/bandage/image/** -bcftools_bgzip: - - software/bcftools/bgzip/** - - tests/software/bcftools/bgzip/** - bcftools_consensus: - software/bcftools/consensus/** - tests/software/bcftools/consensus/** @@ -233,6 +229,10 @@ stringtie: - software/stringtie/** - tests/software/stringtie/** +tabix_bgzip: + - software/tabix/bgzip/** + - tests/software/tabix/bgzip/** + tool_subtool: - software/TOOL/SUBTOOL/** - tests/software/TOOL/SUBTOOL/** diff --git a/software/bcftools/bgzip/functions.nf b/software/tabix/bgzip/functions.nf similarity index 100% rename from software/bcftools/bgzip/functions.nf rename to software/tabix/bgzip/functions.nf diff --git a/software/bcftools/bgzip/main.nf b/software/tabix/bgzip/main.nf similarity index 68% rename from software/bcftools/bgzip/main.nf rename to software/tabix/bgzip/main.nf index 3e6e72e6..aa469e22 100644 --- a/software/bcftools/bgzip/main.nf +++ b/software/tabix/bgzip/main.nf @@ -4,31 +4,31 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' params.options = [:] def options = initOptions(params.options) -process BCFTOOLS_BGZIP { +process TABIX_BGZIP { tag "$meta.id" publishDir "${params.outdir}", mode: params.publish_dir_mode, saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } - conda (params.enable_conda ? "bioconda::bcftools=1.11=h7c999a4_0" : null) + conda (params.enable_conda ? "bioconda::tabix=0.2.6" : null) if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/bcftools:1.11--h7c999a4_0" + container "https://depot.galaxyproject.org/singularity/tabix:0.2.6--ha92aebf_0" } else { - container "quay.io/biocontainers/bcftools:1.11--h7c999a4_0" + container "quay.io/biocontainers/tabix:0.2.6--ha92aebf_0" } input: - tuple val(meta), path(vcf) + tuple val(meta), path(file) output: - tuple val(meta), path("*.gz"), emit: vcf + tuple val(meta), path("*.gz"), emit: file path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ - bgzip -c $options.args $vcf > ${prefix}.vcf.gz + bgzip -c $options.args $file > ${prefix}.${file.getExtension()}.gz echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt """ } diff --git a/software/bcftools/bgzip/meta.yml b/software/tabix/bgzip/meta.yml similarity index 84% rename from software/bcftools/bgzip/meta.yml rename to software/tabix/bgzip/meta.yml index c2f9e548..2bdb2a0f 100644 --- a/software/bcftools/bgzip/meta.yml +++ b/software/tabix/bgzip/meta.yml @@ -1,14 +1,14 @@ -name: bcftools_bgzip -description: Compresses VCF files +name: tabix_bgzip +description: Compresses files keywords: - - variant calling - compress - - VCF + - bgzip + - tabix tools: - bgzip: description: | Bgzip compresses files in a similar manner to, and compatible with, gzip. - homepage: http://samtools.github.io/bcftools/bcftools.html + homepage: https://www.htslib.org/doc/tabix.html documentation: http://www.htslib.org/doc/bgzip.html doi: 10.1093/bioinformatics/btp352 params: @@ -38,19 +38,19 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - vcf: + - file: type: file - description: VCF text file + description: text file output: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - vcf: + - file: type: file - description: Output compressed VCF file - pattern: "*.{vcf}" + description: Output compressed file + pattern: "*.{gz}" - version: type: file description: File containing software version @@ -58,3 +58,4 @@ output: authors: - "@joseespinosa" - "@drpatelh" + - "@maxulysse" diff --git a/tests/software/bcftools/bgzip/test.yml b/tests/software/bcftools/bgzip/test.yml deleted file mode 100644 index b8b69258..00000000 --- a/tests/software/bcftools/bgzip/test.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: bcftools bgzip - command: nextflow run ./tests/software/bcftools/bgzip -entry test_bcftools_bgzip -c tests/config/nextflow.config - tags: - - bcftools - - bcftools_bgzip - files: - - path: output/bcftools/test.vcf.gz - md5sum: eb75ae1f08a1884f8edc59ed423471a2 diff --git a/tests/software/bcftools/bgzip/main.nf b/tests/software/tabix/bgzip/main.nf similarity index 54% rename from tests/software/bcftools/bgzip/main.nf rename to tests/software/tabix/bgzip/main.nf index 02fc80d2..ba6a3912 100644 --- a/tests/software/bcftools/bgzip/main.nf +++ b/tests/software/tabix/bgzip/main.nf @@ -2,13 +2,13 @@ nextflow.enable.dsl = 2 -include { BCFTOOLS_BGZIP } from '../../../../software/bcftools/bgzip/main.nf' addParams( options: [:] ) +include { TABIX_BGZIP as BGZIP_VCF } from '../../../../software/tabix/bgzip/main.nf' addParams( options: [:] ) -workflow test_bcftools_bgzip { +workflow test_tabix_bgzip_vcf { def input = [] input = [ [ id:'test' ], // meta map [ file("${launchDir}/tests/data/vcf/test.vcf", checkIfExists: true) ]] - BCFTOOLS_BGZIP ( input ) + BGZIP_VCF ( input ) } diff --git a/tests/software/tabix/bgzip/test.yml b/tests/software/tabix/bgzip/test.yml new file mode 100644 index 00000000..f935668d --- /dev/null +++ b/tests/software/tabix/bgzip/test.yml @@ -0,0 +1,8 @@ +- name: tabix bgzip + command: nextflow run ./tests/software/tabix/bgzip -entry test_tabix_bgzip_vcf -c tests/config/nextflow.config + tags: + - tabix + - tabix_bgzip + files: + - path: output/bgzip/test.vcf.gz + md5sum: 40419fb7562475d1c8ec4ab725796de2 From 8dd6d1d38a1e2b1e4e157aaee823eb8b0ee8abf8 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Tue, 16 Feb 2021 22:29:13 +0000 Subject: [PATCH 2/4] Update tests/software/tabix/bgzip/main.nf --- tests/software/tabix/bgzip/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/software/tabix/bgzip/main.nf b/tests/software/tabix/bgzip/main.nf index ba6a3912..4f8ac229 100644 --- a/tests/software/tabix/bgzip/main.nf +++ b/tests/software/tabix/bgzip/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { TABIX_BGZIP as BGZIP_VCF } from '../../../../software/tabix/bgzip/main.nf' addParams( options: [:] ) +include { TABIX_BGZIP } from '../../../../software/tabix/bgzip/main.nf' addParams( options: [:] ) workflow test_tabix_bgzip_vcf { From 4f11064ae2d46744b37c93d43ebff67b7f94b1f6 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Tue, 16 Feb 2021 22:30:06 +0000 Subject: [PATCH 3/4] Update tests/software/tabix/bgzip/main.nf --- tests/software/tabix/bgzip/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/software/tabix/bgzip/main.nf b/tests/software/tabix/bgzip/main.nf index 4f8ac229..1da489d1 100644 --- a/tests/software/tabix/bgzip/main.nf +++ b/tests/software/tabix/bgzip/main.nf @@ -10,5 +10,5 @@ workflow test_tabix_bgzip_vcf { input = [ [ id:'test' ], // meta map [ file("${launchDir}/tests/data/vcf/test.vcf", checkIfExists: true) ]] - BGZIP_VCF ( input ) + TABIX_BGZIP ( input ) } From 596bb18394384941b03683fb2d74c0bf0930fb98 Mon Sep 17 00:00:00 2001 From: MaxUlysse Date: Wed, 17 Feb 2021 00:28:32 +0100 Subject: [PATCH 4/4] fix: rename file to input and gz, plus fix tests --- software/tabix/bgzip/main.nf | 6 +++--- tests/software/tabix/bgzip/main.nf | 2 +- tests/software/tabix/bgzip/test.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/software/tabix/bgzip/main.nf b/software/tabix/bgzip/main.nf index aa469e22..80d4159c 100644 --- a/software/tabix/bgzip/main.nf +++ b/software/tabix/bgzip/main.nf @@ -18,17 +18,17 @@ process TABIX_BGZIP { } input: - tuple val(meta), path(file) + tuple val(meta), path(input) output: - tuple val(meta), path("*.gz"), emit: file + tuple val(meta), path("*.gz"), emit: gz path "*.version.txt" , emit: version script: def software = getSoftwareName(task.process) def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" """ - bgzip -c $options.args $file > ${prefix}.${file.getExtension()}.gz + bgzip -c $options.args $input > ${prefix}.${input.getExtension()}.gz echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt """ } diff --git a/tests/software/tabix/bgzip/main.nf b/tests/software/tabix/bgzip/main.nf index 1da489d1..84be4d6d 100644 --- a/tests/software/tabix/bgzip/main.nf +++ b/tests/software/tabix/bgzip/main.nf @@ -4,7 +4,7 @@ nextflow.enable.dsl = 2 include { TABIX_BGZIP } from '../../../../software/tabix/bgzip/main.nf' addParams( options: [:] ) -workflow test_tabix_bgzip_vcf { +workflow test_tabix_bgzip { def input = [] input = [ [ id:'test' ], // meta map diff --git a/tests/software/tabix/bgzip/test.yml b/tests/software/tabix/bgzip/test.yml index f935668d..853664cb 100644 --- a/tests/software/tabix/bgzip/test.yml +++ b/tests/software/tabix/bgzip/test.yml @@ -1,8 +1,8 @@ - name: tabix bgzip - command: nextflow run ./tests/software/tabix/bgzip -entry test_tabix_bgzip_vcf -c tests/config/nextflow.config + command: nextflow run ./tests/software/tabix/bgzip -entry test_tabix_bgzip -c tests/config/nextflow.config tags: - tabix - tabix_bgzip files: - - path: output/bgzip/test.vcf.gz + - path: output/tabix/test.vcf.gz md5sum: 40419fb7562475d1c8ec4ab725796de2