diff --git a/.github/filters.yml b/.github/filters.yml index b2f0b04c..dee0b0b2 100644 --- a/.github/filters.yml +++ b/.github/filters.yml @@ -26,10 +26,6 @@ bcftools_stats: - software/bcftools/stats/** - tests/software/bcftools/stats/** -bcftools_tabix: - - software/bcftools/tabix/** - - tests/software/bcftools/tabix/** - bedtools_complement: - software/bedtools/complement/** - tests/software/bedtools/complement/** @@ -140,6 +136,10 @@ gunzip: - software/gunzip/** - tests/software/gunzip/** +tabix_tabix: + - software/tabix/tabix/** + - tests/software/tabix/tabix/** + ivar_consensus: - software/ivar/consensus/** - tests/software/ivar/consensus/** diff --git a/deprecated/htslib/tabix/main.nf b/deprecated/htslib/tabix/main.nf deleted file mode 100644 index ebd08a16..00000000 --- a/deprecated/htslib/tabix/main.nf +++ /dev/null @@ -1,16 +0,0 @@ -process htslib_tabix { - tag "$vcf" - - container 'quay.io/biocontainers/tabix:0.2.6--ha92aebf_0' - - input: - path vcf - - output: - path "${vcf}.tbi" - - script: - """ - tabix -p vcf ${vcf} - """ -} diff --git a/deprecated/htslib/tabix/meta.yml b/deprecated/htslib/tabix/meta.yml deleted file mode 100644 index b8261b92..00000000 --- a/deprecated/htslib/tabix/meta.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: htslib tabix -description: create tabix index from a bgzip vcf file -keywords: - - index - - tabix -tools: - - bwa: - description: | - Generic indexer for TAB-delimited genome position files. - homepage: https://www.htslib.org/ - documentation: https://www.htslib.org/doc/tabix.1.html - doi: 10.1093/bioinformatics/btq671 -input: - - - - input: - type: file - description: Input vcf.gz file - pattern: "*.{vcf.gz}" -output: - - - - index: - type: file - description: tabix index file - pattern: "*.{vcf.gz.tbi}" -authors: - - "@maxulysse" diff --git a/deprecated/htslib/tabix/test/main.nf b/deprecated/htslib/tabix/test/main.nf deleted file mode 100644 index 478d38f5..00000000 --- a/deprecated/htslib/tabix/test/main.nf +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env nextflow -nextflow.preview.dsl = 2 -include '../../../tests/functions/check_process_outputs.nf' params(params) -include '../main.nf' params(params) - -// Define input channels -input = '../../../test-datasets/tools/file.vcf.gz' - -// Run the workflow -workflow { - tabix_index(ch_read_files) - // .check_output() -} diff --git a/deprecated/htslib/tabix/test/nextflow.config b/deprecated/htslib/tabix/test/nextflow.config deleted file mode 100644 index c137a138..00000000 --- a/deprecated/htslib/tabix/test/nextflow.config +++ /dev/null @@ -1,2 +0,0 @@ -docker.enabled = true -params.outdir = './results' diff --git a/software/bcftools/tabix/meta.yml b/software/bcftools/tabix/meta.yml deleted file mode 100644 index ea4c9d1a..00000000 --- a/software/bcftools/tabix/meta.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: bcftools_tabix -description: Index GFF/BED/SAM/VCF file -keywords: - - index - - vcf - - bed - - sam - - gff -tools: - - stats: - description: | - Indexes a TAB-delimited genome position file. - homepage: http://samtools.github.io/bcftools/bcftools.html - documentation: http://www.htslib.org/doc/bcftools.html - doi: 10.1093/bioinformatics/btp352 -params: - - outdir: - type: string - description: | - The pipeline's output directory. By default, the module will - output files into `$params.outdir/` - - publish_dir_mode: - type: string - description: | - Value for the Nextflow `publishDir` mode parameter. - Available: symlink, rellink, link, copy, copyNoFollow, move. - - enable_conda: - type: boolean - description: | - Run the module with Conda using the software specified - via the `conda` directive - - singularity_pull_docker_container: - type: boolean - description: | - Instead of directly downloading Singularity images for use with Singularity, - force the workflow to pull and convert Docker containers instead. -input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf: - type: file - description: TAB-delimited genome position file compressed with bgzip - pattern: "*.{vcf.gz,bed.gz,sam.gz,gff.gz}" -output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - tbi: - type: file - description: Index file - pattern: "*.{tbi}" - - version: - type: file - description: File containing software version - pattern: "*.{version.txt}" -authors: - - "@joseespinosa" - - "@drpatelh" diff --git a/software/bcftools/tabix/functions.nf b/software/tabix/tabix/functions.nf similarity index 97% rename from software/bcftools/tabix/functions.nf rename to software/tabix/tabix/functions.nf index 6f3b4b29..d25eea86 100644 --- a/software/bcftools/tabix/functions.nf +++ b/software/tabix/tabix/functions.nf @@ -1,4 +1,3 @@ - /* * ----------------------------------------------------- * Utility functions used in nf-core DSL2 module files @@ -31,7 +30,7 @@ def initOptions(Map args) { */ 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 + paths = paths.collect { it.trim().replaceAll("^[/]+|[/]+\$", "") } // Trim whitespace and trailing slashes return paths.join('/') } diff --git a/software/bcftools/tabix/main.nf b/software/tabix/tabix/main.nf similarity index 63% rename from software/bcftools/tabix/main.nf rename to software/tabix/tabix/main.nf index c1799bc3..0416a00d 100644 --- a/software/bcftools/tabix/main.nf +++ b/software/tabix/tabix/main.nf @@ -4,21 +4,22 @@ include { initOptions; saveFiles; getSoftwareName } from './functions' params.options = [:] def options = initOptions(params.options) -process BCFTOOLS_TABIX { +process TABIX_TABIX { tag "$meta.id" + label 'process_medium' 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(tab) output: tuple val(meta), path("*.tbi"), emit: tbi @@ -27,7 +28,8 @@ process BCFTOOLS_TABIX { script: def software = getSoftwareName(task.process) """ - tabix $options.args $vcf - echo \$(bcftools --version 2>&1) | sed 's/^.*bcftools //; s/ .*\$//' > ${software}.version.txt + tabix $options.args $tab + + echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/(.*\$//' > ${software}.version.txt """ } diff --git a/software/tabix/tabix/meta.yml b/software/tabix/tabix/meta.yml new file mode 100644 index 00000000..8075184a --- /dev/null +++ b/software/tabix/tabix/meta.yml @@ -0,0 +1,61 @@ +name: tabix_tabix +description: create tabix index from a sorted bgzip tab-delimited genome file +keywords: + - index + - tabix + - vcf +tools: + - tabix: + description: Generic indexer for TAB-delimited genome position files. + homepage: https://www.htslib.org/doc/tabix.html + documentation: https://www.htslib.org/doc/tabix.1.html + doi: 10.1093/bioinformatics/btq671 +params: + - outdir: + type: string + description: | + The pipeline's output directory. By default, the module will + output files into `$params.outdir/` + - publish_dir_mode: + type: string + description: | + Value for the Nextflow `publishDir` mode parameter. + Available: symlink, rellink, link, copy, copyNoFollow, move. + - enable_conda: + type: boolean + description: | + Run the module with Conda using the software specified + via the `conda` directive + - singularity_pull_docker_container: + type: boolean + description: | + Instead of directly downloading Singularity images for use with Singularity, + force the workflow to pull and convert Docker containers instead. +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - tab: + type: file + description: TAB-delimited genome position file compressed with bgzip + pattern: "*.{bed.gz,gff.gz,sam.gz,vcf.gz}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - tbi: + type: file + description: tabix index file + pattern: "*.{tbi}" + - version: + type: file + description: File containing software version + pattern: "*.{version.txt}" +authors: + - "@joseespinosa" + - "@drpatelh" + - "@maxulysse" diff --git a/tests/data/bed/B.bed.gz b/tests/data/bed/B.bed.gz new file mode 100644 index 00000000..36164ad1 Binary files /dev/null and b/tests/data/bed/B.bed.gz differ diff --git a/tests/data/gff/a.gff3.gz b/tests/data/gff/a.gff3.gz new file mode 100644 index 00000000..3561b5ed Binary files /dev/null and b/tests/data/gff/a.gff3.gz differ diff --git a/tests/software/bcftools/tabix/main.nf b/tests/software/bcftools/tabix/main.nf deleted file mode 100644 index 8a0f8ec6..00000000 --- a/tests/software/bcftools/tabix/main.nf +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { BCFTOOLS_TABIX } from '../../../../software/bcftools/tabix/main.nf' addParams( options: [:] ) - -workflow test_bcftools_tabix { - - def input = [] - input = [ [ id:'test' ], // meta map - [ file("${launchDir}/tests/data/vcf/test.vcf.gz", checkIfExists: true) ] ] - - BCFTOOLS_TABIX ( input ) -} diff --git a/tests/software/bcftools/tabix/test.yml b/tests/software/bcftools/tabix/test.yml deleted file mode 100644 index 0356b1a8..00000000 --- a/tests/software/bcftools/tabix/test.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: bcftools tabix - command: nextflow run ./tests/software/bcftools/tabix -entry test_bcftools_tabix -c tests/config/nextflow.config - tags: - - bcftools - - bcftools_tabix - files: - - path: output/bcftools/test.vcf.gz.tbi - md5sum: 06d52177f819730dd409157914534e8d diff --git a/tests/software/tabix/tabix/main.nf b/tests/software/tabix/tabix/main.nf new file mode 100644 index 00000000..38e82a70 --- /dev/null +++ b/tests/software/tabix/tabix/main.nf @@ -0,0 +1,31 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { TABIX_TABIX as TABIX_BED } from '../../../../software/tabix/tabix/main.nf' addParams( options: ['args': '-p bed'] ) +include { TABIX_TABIX as TABIX_GFF } from '../../../../software/tabix/tabix/main.nf' addParams( options: ['args': '-p gff'] ) +include { TABIX_TABIX as TABIX_VCF } from '../../../../software/tabix/tabix/main.nf' addParams( options: ['args': '-p vcf'] ) + +workflow test_tabix_tabix_bed { + def input = [] + input = [ [ id:'B.bed' ], // meta map + [ file("${launchDir}/tests/data/bed/B.bed.gz", checkIfExists: true) ] ] + + TABIX_BED ( input ) +} + +workflow test_tabix_tabix_gff { + def input = [] + input = [ [ id:'a.gff3' ], // meta map + [ file("${launchDir}/tests/data/gff/a.gff3.gz", checkIfExists: true) ] ] + + TABIX_GFF ( input ) +} + +workflow test_tabix_tabix_vcf { + def input = [] + input = [ [ id:'test.vcf' ], // meta map + [ file("${launchDir}/tests/data/vcf/test.vcf.gz", checkIfExists: true) ] ] + + TABIX_VCF ( input ) +} diff --git a/tests/software/tabix/tabix/test.yml b/tests/software/tabix/tabix/test.yml new file mode 100644 index 00000000..64b5145b --- /dev/null +++ b/tests/software/tabix/tabix/test.yml @@ -0,0 +1,27 @@ +- name: tabix tabix bed + command: nextflow run ./tests/software/tabix/tabix -entry test_tabix_tabix_bed -c tests/config/nextflow.config + tags: + - tabix + - tabix_tabix + - bed + files: + - path: output/tabix/B.bed.gz.tbi + md5sum: 6d657159c283200109f2ed082296f853 +- name: tabix tabix gff + command: nextflow run ./tests/software/tabix/tabix -entry test_tabix_tabix_gff -c tests/config/nextflow.config + tags: + - tabix + - tabix_tabix + - gff + files: + - path: output/tabix/a.gff3.gz.tbi + md5sum: 77f666b63da45c6af8a394ab5642602e +- name: tabix tabix vcf + command: nextflow run ./tests/software/tabix/tabix -entry test_tabix_tabix_vcf -c tests/config/nextflow.config + tags: + - tabix + - tabix_tabix + - vcf + files: + - path: output/tabix/test.vcf.gz.tbi + md5sum: a03f56d3e968f32256ffb9f6b7d01812 \ No newline at end of file