Fix flash and cat/fastq modules (#759)

* Fix version commands: round 3

* Fix seqkit/split2 modules

* Fix flash and cat/fastq modules

* Remove md5sums on gz files
This commit is contained in:
Harshil Patel 2021-09-28 21:14:11 +01:00 committed by GitHub
parent 5c463ca6b4
commit b932210f27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 32 deletions

View file

@ -1,5 +1,5 @@
// Import generic module functions // Import generic module functions
include { initOptions; saveFiles } from './functions' include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
params.options = [:] params.options = [:]
options = initOptions(params.options) options = initOptions(params.options)
@ -23,6 +23,7 @@ process CAT_FASTQ {
output: output:
tuple val(meta), path("*.merged.fastq.gz"), emit: reads tuple val(meta), path("*.merged.fastq.gz"), emit: reads
path "versions.yml" , emit: version
script: script:
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
@ -31,6 +32,11 @@ process CAT_FASTQ {
if (readList.size > 1) { if (readList.size > 1) {
""" """
cat ${readList.sort().join(' ')} > ${prefix}.merged.fastq.gz cat ${readList.sort().join(' ')} > ${prefix}.merged.fastq.gz
cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//')
END_VERSIONS
""" """
} }
} else { } else {
@ -41,6 +47,11 @@ process CAT_FASTQ {
""" """
cat ${read1.sort().join(' ')} > ${prefix}_1.merged.fastq.gz cat ${read1.sort().join(' ')} > ${prefix}_1.merged.fastq.gz
cat ${read2.sort().join(' ')} > ${prefix}_2.merged.fastq.gz cat ${read2.sort().join(' ')} > ${prefix}_2.merged.fastq.gz
cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//')
END_VERSIONS
""" """
} }
} }

View file

@ -21,23 +21,23 @@ process FLASH {
tuple val(meta), path(reads) tuple val(meta), path(reads)
output: output:
tuple val(meta), path("*.merged.*.fastq.gz"), emit: reads tuple val(meta), path("*.fastq.gz"), emit: reads
path "versions.yml" , emit: version path "versions.yml" , emit: version
script: script:
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}"
def merged = "-o ${prefix}.merged"
def input_reads = "${reads[0]} ${reads[1]}"
""" """
flash \\ flash \\
$options.args \\ $options.args \\
$merged \\ -o ${prefix} \\
-z \\ -z \\
$input_reads ${reads[0]} \\
${reads[1]}
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}: ${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(flash --version) ${getSoftwareName(task.process)}: \$(echo \$(flash --version 2>&1) | sed 's/^.*FLASH v//; s/ .*\$//')
END_VERSIONS END_VERSIONS
""" """
} }

View file

@ -2,24 +2,26 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { CAT_FASTQ } from '../../../../modules/cat/fastq/main.nf' addParams( options: [:] ) include { CAT_FASTQ } from '../../../../modules/cat/fastq/main.nf' addParams( options: [publish_dir:'cat'] )
workflow test_cat_fastq_single_end { workflow test_cat_fastq_single_end {
input = [ [ id:'test', single_end:true ], // meta map input = [
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), [ id:'test', single_end:true ], // meta map
file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true) ] [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
] file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true) ]
]
CAT_FASTQ ( input ) CAT_FASTQ ( input )
} }
workflow test_cat_fastq_paired_end { workflow test_cat_fastq_paired_end {
input = [ [ id:'test', single_end:false ], // meta map input = [
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true), [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true), file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test2_2_fastq_gz'], checkIfExists: true) ] file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true),
] file(params.test_data['sarscov2']['illumina']['test2_2_fastq_gz'], checkIfExists: true) ]
]
CAT_FASTQ ( input ) CAT_FASTQ ( input )
} }

View file

@ -4,7 +4,7 @@
- cat - cat
- cat/fastq - cat/fastq
files: files:
- path: ./output/merged_fastq/test.merged.fastq.gz - path: ./output/cat/test.merged.fastq.gz
md5sum: 59f6dbe193741bb40f498f254aeb2e99 md5sum: 59f6dbe193741bb40f498f254aeb2e99
- name: cat fastq fastqc_paired_end - name: cat fastq fastqc_paired_end
@ -13,7 +13,7 @@
- cat - cat
- cat/fastq - cat/fastq
files: files:
- path: ./output/merged_fastq/test_2.merged.fastq.gz - path: ./output/cat/test_2.merged.fastq.gz
md5sum: d2b1a836eef1058738ecab36c907c5ba md5sum: d2b1a836eef1058738ecab36c907c5ba
- path: ./output/merged_fastq/test_1.merged.fastq.gz - path: ./output/cat/test_1.merged.fastq.gz
md5sum: 59f6dbe193741bb40f498f254aeb2e99 md5sum: 59f6dbe193741bb40f498f254aeb2e99

View file

@ -5,10 +5,11 @@ nextflow.enable.dsl = 2
include { FLASH } from '../../../modules/flash/main.nf' addParams( options: [args:'-m 20 -M 100'] ) include { FLASH } from '../../../modules/flash/main.nf' addParams( options: [args:'-m 20 -M 100'] )
workflow test_flash { workflow test_flash {
input = [ [ id:'test', single_end:false ], // meta map input = [
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
] file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ]
]
FLASH ( input ) FLASH ( input )
} }

View file

@ -3,9 +3,6 @@
tags: tags:
- flash - flash
files: files:
- path: output/flash/test.merged.notCombined_2.fastq.gz - path: output/flash/test.notCombined_2.fastq.gz
md5sum: 96ec044281fe60e0061976d928810314 - path: output/flash/test.extendedFrags.fastq.gz
- path: output/flash/test.merged.extendedFrags.fastq.gz - path: output/flash/test.notCombined_1.fastq.gz
md5sum: da20afa705e8ea881e66960bb75607c9
- path: output/flash/test.merged.notCombined_1.fastq.gz
md5sum: 32451c87f89172c764bec19136592d29