mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-21 18:58:16 +00:00
bugfix: when there is a single input file, stageAs("?/*) returns the path directly, not in a list (#2114)
* bugfix: when there is a single input file, stageAs("?/*) returns the path directly, not in a list * Added a test * Added a test * Added MD5 checksum Co-authored-by: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com>
This commit is contained in:
parent
83b05a8dc0
commit
e9bc33485e
6 changed files with 41 additions and 4 deletions
|
@ -20,7 +20,7 @@ process CAT_FASTQ {
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def readList = reads.collect{ it.toString() }
|
def readList = reads instanceof List ? reads.collect{ it.toString() } : [reads.toString()]
|
||||||
if (meta.single_end) {
|
if (meta.single_end) {
|
||||||
if (readList.size >= 1) {
|
if (readList.size >= 1) {
|
||||||
"""
|
"""
|
||||||
|
@ -51,7 +51,7 @@ process CAT_FASTQ {
|
||||||
|
|
||||||
stub:
|
stub:
|
||||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def readList = reads.collect{ it.toString() }
|
def readList = reads instanceof List ? reads.collect{ it.toString() } : [reads.toString()]
|
||||||
if (meta.single_end) {
|
if (meta.single_end) {
|
||||||
if (readList.size > 1) {
|
if (readList.size > 1) {
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -25,7 +25,7 @@ process SAMTOOLS_MERGE {
|
||||||
script:
|
script:
|
||||||
def args = task.ext.args ?: ''
|
def args = task.ext.args ?: ''
|
||||||
prefix = task.ext.prefix ?: "${meta.id}"
|
prefix = task.ext.prefix ?: "${meta.id}"
|
||||||
def file_type = input_files[0].getExtension()
|
def file_type = input_files instanceof List ? input_files[0].getExtension() : input_files.getExtension()
|
||||||
def reference = fasta ? "--reference ${fasta}" : ""
|
def reference = fasta ? "--reference ${fasta}" : ""
|
||||||
"""
|
"""
|
||||||
samtools \\
|
samtools \\
|
||||||
|
@ -44,7 +44,7 @@ process SAMTOOLS_MERGE {
|
||||||
|
|
||||||
stub:
|
stub:
|
||||||
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
|
||||||
def file_type = input_files[0].getExtension()
|
def file_type = input_files instanceof List ? input_files[0].getExtension() : input_files.getExtension()
|
||||||
"""
|
"""
|
||||||
touch ${prefix}.${file_type}
|
touch ${prefix}.${file_type}
|
||||||
|
|
||||||
|
|
|
@ -47,3 +47,12 @@ workflow test_cat_fastq_paired_end_same_name {
|
||||||
|
|
||||||
CAT_FASTQ ( input )
|
CAT_FASTQ ( input )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
workflow test_cat_fastq_single_end_single_file {
|
||||||
|
input = [
|
||||||
|
[ id:'test', single_end:true ], // meta map
|
||||||
|
[ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)]
|
||||||
|
]
|
||||||
|
|
||||||
|
CAT_FASTQ ( input )
|
||||||
|
}
|
||||||
|
|
|
@ -38,6 +38,15 @@
|
||||||
- path: ./output/cat/test_2.merged.fastq.gz
|
- path: ./output/cat/test_2.merged.fastq.gz
|
||||||
md5sum: fe9f266f43a6fc3dcab690a18419a56e
|
md5sum: fe9f266f43a6fc3dcab690a18419a56e
|
||||||
|
|
||||||
|
- name: cat fastq single-end-single-file
|
||||||
|
command: nextflow run ./tests/modules/cat/fastq -entry test_cat_fastq_single_end_single_file -c ./tests/config/nextflow.config -c ./tests/modules/cat/fastq/nextflow.config
|
||||||
|
tags:
|
||||||
|
- cat
|
||||||
|
- cat/fastq
|
||||||
|
files:
|
||||||
|
- path: ./output/cat/test.merged.fastq.gz
|
||||||
|
md5sum: e325ef7deb4023447a1f074e285761af
|
||||||
|
|
||||||
- name: cat fastq single-end stub
|
- name: cat fastq single-end stub
|
||||||
command: nextflow run ./tests/modules/cat/fastq -entry test_cat_fastq_single_end -c ./tests/config/nextflow.config -c ./tests/modules/cat/fastq/nextflow.config -stub-run
|
command: nextflow run ./tests/modules/cat/fastq -entry test_cat_fastq_single_end -c ./tests/config/nextflow.config -c ./tests/modules/cat/fastq/nextflow.config -stub-run
|
||||||
tags:
|
tags:
|
||||||
|
|
|
@ -27,3 +27,13 @@ workflow test_samtools_merge_cram {
|
||||||
fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||||
SAMTOOLS_MERGE ( input, fasta, fai )
|
SAMTOOLS_MERGE ( input, fasta, fai )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
workflow test_samtools_merge_single_file {
|
||||||
|
input = [ [ id: 'test' ], // meta map
|
||||||
|
[
|
||||||
|
file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam'], checkIfExists: true),
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
SAMTOOLS_MERGE ( input, [], [] )
|
||||||
|
}
|
||||||
|
|
|
@ -13,3 +13,12 @@
|
||||||
- samtools/merge
|
- samtools/merge
|
||||||
files:
|
files:
|
||||||
- path: output/samtools/test.cram
|
- path: output/samtools/test.cram
|
||||||
|
|
||||||
|
- name: samtools merge test_samtools_merge_single_file
|
||||||
|
command: nextflow run ./tests/modules/samtools/merge -entry test_samtools_merge_single_file -c ./tests/config/nextflow.config -c ./tests/modules/samtools/merge/nextflow.config
|
||||||
|
tags:
|
||||||
|
- samtools
|
||||||
|
- samtools/merge
|
||||||
|
files:
|
||||||
|
- path: output/samtools/test.bam
|
||||||
|
md5sum: 6e38ae132fadae4cb4915814d6f872b2
|
||||||
|
|
Loading…
Reference in a new issue