Skip to content

Commit d7050b4

Browse files
maxulysseSPPearce
authored andcommitted
Downgrade dragmap to the previous functionning version (#8263)
* snapshot versions * downgrade dragmap to a working version * update tests and snapshots * improve tests + fix environment.yml * cursor :shakefist: * same warning text * fix linting * fix versions in environment.yml * update snapshots * channels
1 parent 982c072 commit d7050b4

8 files changed

Lines changed: 247 additions & 98 deletions

File tree

modules/nf-core/dragmap/align/environment.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
channels:
44
- conda-forge
55
- bioconda
6-
76
dependencies:
8-
- dragmap=1.3.0
9-
- pigz=2.8
10-
- samtools=1.18
7+
# WARN: Do not update this tool to 1.3.0 until https://github.com/Illumina/DRAGMAP/issues/47 is resolved
8+
- bioconda::dragmap=1.2.1
9+
- bioconda::samtools=1.19.2
10+
- conda-forge::pigz=2.3.4

modules/nf-core/dragmap/align/main.nf

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
process DRAGMAP_ALIGN {
2-
tag "$meta.id"
2+
tag "${meta.id}"
33
label 'process_high'
44

55
conda "${moduleDir}/environment.yml"
6-
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7-
'https://depot.galaxyproject.org/singularity/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:7eed251370ac7f3537c3d9472cdb2f9f5d8da1c5-0':
8-
'biocontainers/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:7eed251370ac7f3537c3d9472cdb2f9f5d8da1c5-0' }"
6+
// WARN: Do not update this tool to 1.3.0 until https://github.com/Illumina/DRAGMAP/issues/47 is resolved
7+
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
8+
? 'https://depot.galaxyproject.org/singularity/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:df80ed8d23d0a2c43181a2b3dd1b39f2d00fab5c-0'
9+
: 'biocontainers/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:df80ed8d23d0a2c43181a2b3dd1b39f2d00fab5c-0'}"
910

1011
input:
11-
tuple val(meta) , path(reads)
12+
tuple val(meta), path(reads)
1213
tuple val(meta2), path(hashmap)
1314
tuple val(meta3), path(fasta)
14-
val sort_bam
15+
val sort_bam
1516

1617
output:
17-
tuple val(meta), path("*.sam") , emit: sam , optional: true
18-
tuple val(meta), path("*.bam") , emit: bam , optional: true
19-
tuple val(meta), path("*.cram") , emit: cram , optional: true
20-
tuple val(meta), path("*.crai") , emit: crai , optional: true
21-
tuple val(meta), path("*.csi") , emit: csi , optional: true
22-
tuple val(meta), path('*.log') , emit: log
23-
path "versions.yml" , emit: versions
18+
tuple val(meta), path("*.sam"), emit: sam, optional: true
19+
tuple val(meta), path("*.bam"), emit: bam, optional: true
20+
tuple val(meta), path("*.cram"), emit: cram, optional: true
21+
tuple val(meta), path("*.crai"), emit: crai, optional: true
22+
tuple val(meta), path("*.csi"), emit: csi, optional: true
23+
tuple val(meta), path('*.log'), emit: log
24+
path "versions.yml", emit: versions
2425

2526
when:
2627
task.ext.when == null || task.ext.when
@@ -29,22 +30,24 @@ process DRAGMAP_ALIGN {
2930
def args = task.ext.args ?: ''
3031
def args2 = task.ext.args2 ?: ''
3132
def prefix = task.ext.prefix ?: "${meta.id}"
32-
def reads_command = meta.single_end ? "-1 $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
33-
def samtools_command = sort_bam ? 'sort' : 'view'
34-
def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/
35-
def extension_matcher = (args2 =~ extension_pattern)
36-
def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam"
37-
def reference = fasta && extension=="cram" ? "--reference ${fasta}" : ""
38-
if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output"
33+
def reads_command = meta.single_end ? "-1 ${reads}" : "-1 ${reads[0]} -2 ${reads[1]}"
34+
def samtools_command = sort_bam ? 'sort' : 'view'
35+
def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/
36+
def extension_matcher = (args2 =~ extension_pattern)
37+
def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam"
38+
def reference = fasta && extension == "cram" ? "--reference ${fasta}" : ""
39+
if (!fasta && extension == "cram") {
40+
error("Fasta reference is required for CRAM output")
41+
}
3942

4043
"""
4144
dragen-os \\
42-
-r $hashmap \\
43-
$args \\
44-
--num-threads $task.cpus \\
45-
$reads_command \\
45+
-r ${hashmap} \\
46+
${args} \\
47+
--num-threads ${task.cpus} \\
48+
${reads_command} \\
4649
2> >(tee ${prefix}.dragmap.log >&2) \\
47-
| samtools $samtools_command $args2 --threads $task.cpus ${reference} -o ${prefix}.${extension} -
50+
| samtools ${samtools_command} ${args2} --threads ${task.cpus} ${reference} -o ${prefix}.${extension} -
4851
4952
cat <<-END_VERSIONS > versions.yml
5053
"${task.process}":
@@ -58,14 +61,17 @@ process DRAGMAP_ALIGN {
5861
def args2 = task.ext.args2 ?: ''
5962
def prefix = task.ext.prefix ?: "${meta.id}"
6063
def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/
61-
def extension_matcher = (args2 =~ extension_pattern)
64+
def extension_matcher = (args2 =~ extension_pattern)
6265
def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam"
63-
if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output"
66+
if (!fasta && extension == "cram") {
67+
error("Fasta reference is required for CRAM output")
68+
}
6469

6570
def create_index = ""
6671
if (extension == "cram") {
6772
create_index = "touch ${prefix}.crai"
68-
} else if (extension == "bam") {
73+
}
74+
else if (extension == "bam") {
6975
create_index = "touch ${prefix}.csi"
7076
}
7177

modules/nf-core/dragmap/align/tests/main.nf.test

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ nextflow_process {
4040
}
4141

4242
then {
43+
assert { process.success }
4344
assertAll (
44-
{ assert process.success },
4545
{ assert snapshot(
4646
file(process.out.bam[0][1]).name,
4747
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
48-
file(process.out.versions[0]).name
48+
process.out.versions,
49+
path(process.out.versions[0]).yaml
4950
).match() }
5051
)
5152
}
@@ -83,12 +84,13 @@ nextflow_process {
8384
}
8485

8586
then {
87+
assert { process.success }
8688
assertAll (
87-
{ assert process.success },
8889
{ assert snapshot(
8990
file(process.out.bam[0][1]).name,
9091
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
91-
file(process.out.versions[0]).name
92+
process.out.versions,
93+
path(process.out.versions[0]).yaml
9294
).match() }
9395
)
9496
}
@@ -129,12 +131,13 @@ nextflow_process {
129131
}
130132

131133
then {
134+
assert { process.success }
132135
assertAll (
133-
{ assert process.success },
134136
{ assert snapshot(
135137
file(process.out.bam[0][1]).name,
136138
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
137-
file(process.out.versions[0]).name
139+
process.out.versions,
140+
path(process.out.versions[0]).yaml
138141
).match() }
139142
)
140143
}
@@ -175,12 +178,13 @@ nextflow_process {
175178
}
176179

177180
then {
181+
assert { process.success }
178182
assertAll (
179-
{ assert process.success },
180183
{ assert snapshot(
181184
file(process.out.bam[0][1]).name,
182185
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
183-
file(process.out.versions[0]).name
186+
process.out.versions,
187+
path(process.out.versions[0]).yaml
184188
).match() }
185189
)
186190
}
@@ -221,12 +225,13 @@ nextflow_process {
221225
}
222226

223227
then {
228+
assert { process.success }
224229
assertAll (
225-
{ assert process.success },
226230
{ assert snapshot(
227231
file(process.out.bam[0][1]).name,
228232
file(process.out.log[0][1]).readLines().findAll { it.startsWith("decompHash") },
229-
file(process.out.versions[0]).name
233+
process.out.versions,
234+
path(process.out.versions[0]).yaml
230235
).match() }
231236
)
232237
}
@@ -268,16 +273,13 @@ nextflow_process {
268273
}
269274

270275
then {
276+
assert { process.success }
271277
assertAll (
272-
{ assert process.success },
273278
{ assert snapshot(
274-
file(process.out.bam[0][1]).name,
275-
file(process.out.log[0][1]).name,
276-
file(process.out.versions[0]).name
279+
process.out,
280+
path(process.out.versions[0]).yaml
277281
).match() }
278282
)
279283
}
280-
281284
}
282-
283285
}

0 commit comments

Comments
 (0)