test fixes

This commit is contained in:
CMGG ICT Team 2022-04-22 15:02:41 +02:00
parent 7e883da904
commit b4af3f1475
2 changed files with 8 additions and 10 deletions

View file

@ -9,7 +9,6 @@ process BAMTOOLS_SPLIT {
input: input:
tuple val(meta), path(bam) tuple val(meta), path(bam)
path(bam_list)
output: output:
tuple val(meta), path("*.bam"), emit: bam tuple val(meta), path("*.bam"), emit: bam
@ -22,17 +21,13 @@ process BAMTOOLS_SPLIT {
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 input_list = bam.collect{"-in $it"}.join(' ') def input_list = bam.collect{"-in $it"}.join(' ')
if (bam_list) { def stub = !args.contains("-stub") ? "-stub ${prefix}" : ""
input_list += " -list $bam_list"
}
if (!args.contains("-stub")) {
args += " -stub ${prefix}"
}
""" """
bamtools merge \\ bamtools merge \\
${input_list} \\ ${input_list} \\
| bamtools split \\ | bamtools split \\
$stub \\
$args $args
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml

View file

@ -15,12 +15,15 @@ workflow test_bamtools_split_single_input {
BAMTOOLS_SPLIT_SINGLE ( input ) BAMTOOLS_SPLIT_SINGLE ( input )
} }
workflow test_bamtools_split_multiple_input { workflow test_bamtools_split_multiple {
input = [ input = [
[ id:'test', single_end:false ], // meta map [ id:'test', single_end:false ], // meta map
[file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true)] [file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
[ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true)]
]
BAMTOOLS_SPLIT_MULTIPLE ( input ) BAMTOOLS_SPLIT_MULTIPLE ( input )
} }