address review comments

This commit is contained in:
Matthias De Smet 2022-05-16 20:51:39 +02:00
parent 98f204fd1f
commit a79b9adeee
5 changed files with 42 additions and 10 deletions

View file

@ -12,7 +12,9 @@ process BIOBAMBAM_BAMMERGE {
output:
tuple val(meta), path("${prefix}.bam") ,emit: bam
tuple val(meta), path("*.bam.bai") ,optional:true, emit: bam_index
tuple val(meta), path("${indexfilename}") ,optional:true, emit: bam_index
tuple val(meta), path("${md5filename}") ,optional:true, emit: checksum
path "versions.yml" ,emit: versions
when:
@ -21,6 +23,8 @@ process BIOBAMBAM_BAMMERGE {
script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
indexfilename = args.contains("indexfilename=") ? args =~ /indexfilename=([^\s]+)/ : ""
md5filename = args.contains("md5filename=") ? args =~ /md5filename=([^\s]+)/ : ""
def input_string = bam.join(" I=")
"""
@ -31,7 +35,7 @@ process BIOBAMBAM_BAMMERGE {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bammerge: \$( bammerge --version |& sed '1!d; s/.*version //; s/.$//' )
bammerge: \$( bammerge --version |& sed '1!d; s/.*version //; s/.\$//' )
END_VERSIONS
"""
}

View file

@ -33,7 +33,11 @@ output:
- bam_index:
type: file
description: BAM index file
pattern: "*.{bai}"
pattern: "*"
- checksum:
type: file
description: Checksum file
pattern: "*"
- versions:
type: file
description: File containing software versions

View file

@ -4,7 +4,7 @@ nextflow.enable.dsl = 2
include { BIOBAMBAM_BAMMERGE } from '../../../../modules/biobambam/bammerge/main.nf'
workflow test_biobambam_bammerge {
workflow test_biobambam_bammerge_paired {
input = [
[ id:'test', single_end:false ], // meta map
@ -16,3 +16,15 @@ workflow test_biobambam_bammerge {
BIOBAMBAM_BAMMERGE ( input )
}
workflow test_biobambam_bammerge_single {
input = [
[ id:'test', single_end:false ], // meta map
[
file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true),
]
]
BIOBAMBAM_BAMMERGE ( input )
}

View file

@ -1,5 +1,8 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}
withName: BIOBAMBAM_BAMMERGE {
ext.args = "md5=1 md5filename=test.md5 index=1 indexfilename=test.bam.bai"
}
}

View file

@ -1,8 +1,17 @@
- name: biobambam bammerge test_biobambam_bammerge
command: nextflow run ./tests/modules/biobambam/bammerge -entry test_biobambam_bammerge -c ./tests/config/nextflow.config -c ./tests/modules/biobambam/bammerge/nextflow.config
- name: biobambam bammerge test_biobambam_bammerge_paired
command: nextflow run ./tests/modules/biobambam/bammerge -entry test_biobambam_bammerge_paired -c ./tests/config/nextflow.config -c ./tests/modules/biobambam/bammerge/nextflow.config
tags:
- biobambam/bammerge
- biobambam
- biobambam/bammerge
files:
- path: output/biobambam/test.bam
md5sum: 676157f300c774a58dd3b7b554e00f11
md5sum: bc3d32ab6a54d1894ca7cc79387dec57
- name: biobambam bammerge test_biobambam_bammerge_single
command: nextflow run ./tests/modules/biobambam/bammerge -entry test_biobambam_bammerge_single -c ./tests/config/nextflow.config -c ./tests/modules/biobambam/bammerge/nextflow.config
tags:
- biobambam
- biobambam/bammerge
files:
- path: output/biobambam/test.bam
md5sum: 86185d3d6895a7722d3b3a09c6f91bfc