Update dsh-bio modules to version 2.0.4 (#482)

* Update dsh-bio modules to version 2.0.4

* update docker tag

* update md5 checksums

* Update software/dshbio/filtergff3/main.nf

* Update software/dshbio/splitgff3/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
This commit is contained in:
Michael L Heuer 2021-05-04 08:28:44 -05:00 committed by GitHub
parent 6ade84b5cd
commit e3cf4c822c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 405 additions and 54 deletions

View file

@ -4,18 +4,18 @@ include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
process DSH_FILTERBED { process DSHBIO_FILTERBED {
tag "${meta.id}" tag "${meta.id}"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
conda (params.enable_conda ? "bioconda::dsh-bio=2.0.3" : null) conda (params.enable_conda ? "bioconda::dsh-bio=2.0.4" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/dsh-bio:2.0.3--0" container "https://depot.galaxyproject.org/singularity/dsh-bio:2.0.4--hdfd78af_0"
} else { } else {
container "quay.io/biocontainers/dsh-bio:2.0.3--0" container "quay.io/biocontainers/dsh-bio:2.0.4--hdfd78af_0"
} }
input: input:
@ -29,7 +29,8 @@ process DSH_FILTERBED {
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
""" """
dsh-filter-bed \\ dsh-bio \\
filter-bed \\
$options.args \\ $options.args \\
-i $bed \\ -i $bed \\
-o ${prefix}.bed.gz -o ${prefix}.bed.gz

View file

@ -1,9 +1,9 @@
name: dsh_filterbed name: dshbio_filterbed
description: Filter features in gzipped BED format description: Filter features in gzipped BED format
keywords: keywords:
- bed - bed
tools: tools:
- dsh: - dshbio:
description: | description: |
Reads, features, variants, assemblies, alignments, genomic range trees, pangenome Reads, features, variants, assemblies, alignments, genomic range trees, pangenome
graphs, and a bunch of random command line tools for bioinformatics. LGPL version 3 graphs, and a bunch of random command line tools for bioinformatics. LGPL version 3

View file

@ -0,0 +1,40 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
options = initOptions(params.options)
process DSHBIO_FILTERGFF3 {
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), meta:meta, publish_by_meta:['id']) }
conda (params.enable_conda ? "bioconda::dsh-bio=2.0.4" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/dsh-bio:2.0.4--hdfd78af_0"
} else {
container "quay.io/biocontainers/dsh-bio:2.0.4--hdfd78af_0"
}
input:
tuple val(meta), path(gff3)
output:
tuple val(meta), path("*.gff3.gz"), emit: gff3
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
dsh-bio \\
filter-gff3 \\
$options.args \\
-i $gff3 \\
-o ${prefix}.gff3.gz
echo \$(dsh-bio --version 2>&1) | grep -o 'dsh-bio-tools .*' | cut -f2 -d ' ' > ${software}.version.txt
"""
}

View file

@ -0,0 +1,38 @@
name: dshbio_filtergff3
description: Filter features in gzipped GFF3 format
keywords:
- gff3
tools:
- dshbio:
description: |
Reads, features, variants, assemblies, alignments, genomic range trees, pangenome
graphs, and a bunch of random command line tools for bioinformatics. LGPL version 3
or later.
homepage: https://github.com/heuermh/dishevelled-bio
documentation: https://github.com/heuermh/dishevelled-bio
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- gff3:
type: file
description: Features in gzipped GFF3 format
pattern: "*.{gff3.gz}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- gff3:
type: file
description: Features in gzipped GFF3 format
pattern: "*.{gff3.gz}"
- version:
type: file
description: File containing software version
pattern: "*.{version.txt}"
authors:
- "@heuermh"

View file

@ -0,0 +1,70 @@
/*
* -----------------------------------------------------
* 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"
}
}
}

View file

@ -4,18 +4,18 @@ include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
process DSH_SPLITBED { process DSHBIO_SPLITBED {
tag "${meta.id}" tag "${meta.id}"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) } saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
conda (params.enable_conda ? "bioconda::dsh-bio=2.0.3" : null) conda (params.enable_conda ? "bioconda::dsh-bio=2.0.4" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/dsh-bio:2.0.3--0" container "https://depot.galaxyproject.org/singularity/dsh-bio:2.0.4--hdfd78af_0"
} else { } else {
container "quay.io/biocontainers/dsh-bio:2.0.3--0" container "quay.io/biocontainers/dsh-bio:2.0.4--hdfd78af_0"
} }
input: input:
@ -29,7 +29,8 @@ process DSH_SPLITBED {
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
""" """
dsh-split-bed \\ dsh-bio \\
split-bed \\
$options.args \\ $options.args \\
-p $prefix \\ -p $prefix \\
-s '.bed.gz' \\ -s '.bed.gz' \\

View file

@ -1,9 +1,9 @@
name: dsh_splitbed name: dshbio_splitbed
description: Split features in gzipped BED format description: Split features in gzipped BED format
keywords: keywords:
- bed - bed
tools: tools:
- dsh: - dshbio:
description: | description: |
Reads, features, variants, assemblies, alignments, genomic range trees, pangenome Reads, features, variants, assemblies, alignments, genomic range trees, pangenome
graphs, and a bunch of random command line tools for bioinformatics. LGPL version 3 graphs, and a bunch of random command line tools for bioinformatics. LGPL version 3

View file

@ -0,0 +1,70 @@
/*
* -----------------------------------------------------
* 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"
}
}
}

View file

@ -0,0 +1,41 @@
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
options = initOptions(params.options)
process DSHBIO_SPLITGFF3 {
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), meta:meta, publish_by_meta:['id']) }
conda (params.enable_conda ? "bioconda::dsh-bio=2.0.4" : null)
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/dsh-bio:2.0.4--hdfd78af_0"
} else {
container "quay.io/biocontainers/dsh-bio:2.0.4--hdfd78af_0"
}
input:
tuple val(meta), path(gff3)
output:
tuple val(meta), path("*.gff3.gz"), emit: gff3
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
dsh-bio \\
split-gff3 \\
$options.args \\
-p $prefix \\
-s '.gff3.gz' \\
-i $gff3
echo \$(dsh-bio --version 2>&1) | grep -o 'dsh-bio-tools .*' | cut -f2 -d ' ' > ${software}.version.txt
"""
}

View file

@ -0,0 +1,38 @@
name: dshbio_splitgff3
description: Split features in gzipped GFF3 format
keywords:
- gff3
tools:
- dshbio:
description: |
Reads, features, variants, assemblies, alignments, genomic range trees, pangenome
graphs, and a bunch of random command line tools for bioinformatics. LGPL version 3
or later.
homepage: https://github.com/heuermh/dishevelled-bio
documentation: https://github.com/heuermh/dishevelled-bio
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- gff3:
type: file
description: Features in gzipped GFF3 format to split
pattern: "*.{gff3.gz}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- gff3:
type: file
description: Features in split gzipped GFF3 formatted files
pattern: "*.{gff3.gz}"
- version:
type: file
description: File containing software version
pattern: "*.{version.txt}"
authors:
- "@heuermh"

View file

@ -190,13 +190,21 @@ deeptools/plotprofile:
- software/deeptools/plotprofile/** - software/deeptools/plotprofile/**
- tests/software/deeptools/plotprofile/** - tests/software/deeptools/plotprofile/**
dsh/filterbed: dshbio/filterbed:
- software/dsh/filterbed/** - software/dshbio/filterbed/**
- tests/software/dsh/filterbed/** - tests/software/dshbio/filterbed/**
dsh/splitbed: dshbio/filtergff3:
- software/dsh/splitbed/** - software/dshbio/filtergff3/**
- tests/software/dsh/splitbed/** - tests/software/dshbio/filtergff3/**
dshbio/splitbed:
- software/dshbio/splitbed/**
- tests/software/dshbio/splitbed/**
dshbio/splitgff3:
- software/dshbio/splitgff3/**
- tests/software/dshbio/splitgff3/**
fastp: fastp:
- software/fastp/** - software/fastp/**

View file

@ -1,13 +0,0 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { DSH_FILTERBED } from '../../../../software/dsh/filterbed/main.nf' addParams( options: [suffix: '.filtered', args: '--range chr1:0-1000'] )
workflow test_dsh_filterbed {
input = [ [ id:'test' ], // meta map
[ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ]
]
DSH_FILTERBED ( input )
}

View file

@ -1,8 +0,0 @@
- name: dsh filterbed
command: nextflow run ./tests/software/dsh/filterbed -entry test_dsh_filterbed -c tests/config/nextflow.config
tags:
- dsh
- dsh/filterbed
files:
- path: ./output/dsh/test.filtered.bed.gz
md5sum: 163be0a88c70ca629fd516dbaadad96a

View file

@ -1,10 +0,0 @@
- name: dsh splitbed
command: nextflow run ./tests/software/dsh/splitbed -entry test_dsh_splitbed -c tests/config/nextflow.config
tags:
- dsh
- dsh/splitbed
files:
- path: ./output/dsh/test.1.bed.gz
md5sum: 967ba338f361740eb015304003ababe7
- path: ./output/dsh/test.0.bed.gz
md5sum: 8b884d8cf5c57955f218f1c6dbf02d54

View file

@ -0,0 +1,13 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { DSHBIO_FILTERBED } from '../../../../software/dshbio/filterbed/main.nf' addParams( options: [suffix: '.filtered', args: '--range chr1:0-1000'] )
workflow test_dshbio_filterbed {
input = [ [ id:'test' ], // meta map
[ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ]
]
DSHBIO_FILTERBED ( input )
}

View file

@ -0,0 +1,8 @@
- name: dshbio filterbed
command: nextflow run ./tests/software/dshbio/filterbed -entry test_dshbio_filterbed -c tests/config/nextflow.config
tags:
- dshbio
- dshbio/filterbed
files:
- path: ./output/dshbio/test.filtered.bed.gz
md5sum: 163be0a88c70ca629fd516dbaadad96a

View file

@ -0,0 +1,13 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { DSHBIO_FILTERGFF3 } from '../../../../software/dshbio/filtergff3/main.nf' addParams( options: [suffix: '.filtered', args: '--range MT192765.1:0-1000'] )
workflow test_dshbio_filtergff3 {
input = [ [ id:'test' ], // meta map
[ file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true) ]
]
DSHBIO_FILTERGFF3 ( input )
}

View file

@ -0,0 +1,8 @@
- name: dshbio filtergff3
command: nextflow run ./tests/software/dshbio/filtergff3 -entry test_dshbio_filtergff3 -c tests/config/nextflow.config
tags:
- dshbio
- dshbio/filtergff3
files:
- path: ./output/dshbio/test.filtered.gff3.gz
md5sum: 89d320cf91c0ca8fd200cfa9688954e3

View file

@ -2,12 +2,12 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { DSH_SPLITBED } from '../../../../software/dsh/splitbed/main.nf' addParams( options: [suffix: '.', args: '--records 2'] ) include { DSHBIO_SPLITBED } from '../../../../software/dshbio/splitbed/main.nf' addParams( options: [suffix: '.', args: '--records 2'] )
workflow test_dsh_splitbed { workflow test_dshbio_splitbed {
input = [ [ id:'test' ], // meta map input = [ [ id:'test' ], // meta map
[ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ] [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) ]
] ]
DSH_SPLITBED ( input ) DSHBIO_SPLITBED ( input )
} }

View file

@ -0,0 +1,10 @@
- name: dshbio splitbed
command: nextflow run ./tests/software/dshbio/splitbed -entry test_dshbio_splitbed -c tests/config/nextflow.config
tags:
- dshbio
- dshbio/splitbed
files:
- path: ./output/dshbio/test.1.bed.gz
md5sum: 967ba338f361740eb015304003ababe7
- path: ./output/dshbio/test.0.bed.gz
md5sum: 8b884d8cf5c57955f218f1c6dbf02d54

View file

@ -0,0 +1,13 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { DSHBIO_SPLITGFF3 } from '../../../../software/dshbio/splitgff3/main.nf' addParams( options: [suffix: '.', args: '--records 15'] )
workflow test_dshbio_splitgff3 {
input = [ [ id:'test' ], // meta map
[ file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true) ]
]
DSHBIO_SPLITGFF3 ( input )
}

View file

@ -0,0 +1,10 @@
- name: dshbio splitgff3
command: nextflow run ./tests/software/dshbio/splitgff3 -entry test_dshbio_splitgff3 -c tests/config/nextflow.config
tags:
- dshbio
- dshbio/splitgff3
files:
- path: ./output/dshbio/test.1.gff3.gz
md5sum: 0742895e81fe080c01f43f9dd616baae
- path: ./output/dshbio/test.0.gff3.gz
md5sum: 9aed611b89093f5e0db4e63cb56d8416