fix: make HTSLIB_TABIX more modular

This commit is contained in:
MaxUlysse 2021-02-16 17:06:55 +01:00
parent fa34f806d2
commit 5e71dc94d6
4 changed files with 43 additions and 14 deletions

View file

@ -5,7 +5,7 @@ params.options = [:]
def options = initOptions(params.options)
process HTSLIB_TABIX {
tag "$vcf"
tag "$tab"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
@ -19,7 +19,7 @@ process HTSLIB_TABIX {
}
input:
path vcf
path tab
output:
path("*.tbi") , emit: tbi
@ -28,7 +28,7 @@ process HTSLIB_TABIX {
script:
def software = getSoftwareName(task.process)
"""
tabix -p vcf $vcf
tabix $options.args $tab
echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/(.*\$//' > ${software}.version.txt
"""

View file

@ -32,10 +32,10 @@ params:
Instead of directly downloading Singularity images for use with Singularity,
force the workflow to pull and convert Docker containers instead.
input:
- vcf:
- tab:
type: file
description: vcf.gz file
pattern: "*.{vcf.gz}"
description: TAB-delimited genome file
pattern: "*"
output:
- tbi:
type: file

View file

@ -2,8 +2,18 @@
nextflow.enable.dsl = 2
include { HTSLIB_TABIX } from '../../../../software/htslib/tabix/main.nf' addParams( options: [:] )
include { HTSLIB_TABIX as TABIX_BED } from '../../../../software/htslib/tabix/main.nf' addParams( options: ['args': '-p bed'] )
include { HTSLIB_TABIX as TABIX_GFF } from '../../../../software/htslib/tabix/main.nf' addParams( options: ['args': '-p gff'] )
include { HTSLIB_TABIX as TABIX_VCF } from '../../../../software/htslib/tabix/main.nf' addParams( options: ['args': '-p vcf'] )
workflow test_htslib_tabix {
HTSLIB_TABIX ( file("${launchDir}/tests/data/vcf/test.vcf.gz", checkIfExists: true) )
workflow test_htslib_tabix_bed {
TABIX_BED ( file("${launchDir}/tests/data/bed/B.bed.gz", checkIfExists: true) )
}
workflow test_htslib_tabix_gff {
TABIX_GFF ( file("${launchDir}/tests/data/gff/a.gff3.gz", checkIfExists: true) )
}
workflow test_htslib_tabix_vcf {
TABIX_VCF ( file("${launchDir}/tests/data/vcf/test.vcf.gz", checkIfExists: true) )
}

View file

@ -1,8 +1,27 @@
- name: htslib tabix
command: nextflow run ./tests/software/htslib/tabix -entry test_htslib_tabix -c tests/config/nextflow.config
- name: htslib tabix bed
command: nextflow run ./tests/software/htslib/tabix -entry test_htslib_tabix_bed -c tests/config/nextflow.config
tags:
- htslib
- htslib_tabix
- bed
files:
- path: output/htslib/test.vcf.gz.tbi
- path: output/tabix/B.bed.gz.tbi
md5sum: 6d657159c283200109f2ed082296f853
- name: htslib tabix gff
command: nextflow run ./tests/software/htslib/tabix -entry test_htslib_tabix_gff -c tests/config/nextflow.config
tags:
- htslib
- htslib_tabix
- gff
files:
- path: output/tabix/a.gff3.gz.tbi
md5sum: 77f666b63da45c6af8a394ab5642602e
- name: htslib tabix vcf
command: nextflow run ./tests/software/htslib/tabix -entry test_htslib_tabix_vcf -c tests/config/nextflow.config
tags:
- htslib
- htslib_tabix
- vcf
files:
- path: output/tabix/test.vcf.gz.tbi
md5sum: a03f56d3e968f32256ffb9f6b7d01812