Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6d90c3f
Add dragen and dragenutils
rernst Aug 14, 2026
13ea4da
Fix typo
rernst Aug 14, 2026
ed573e3
Move dragen to dragen wgs
rernst Aug 17, 2026
3d2f193
Fix dragen tests
rernst Aug 18, 2026
47e6064
Update to smaller container
rernst Aug 18, 2026
5aed942
Remove wgs specific args
rernst Aug 18, 2026
d6b6b97
Use prefix
rernst Aug 18, 2026
9653af8
Add prefix to test
rernst Aug 18, 2026
dd19f8e
Switch quotes
rernst Aug 18, 2026
e17708c
Remove todo
rernst Aug 18, 2026
134f915
Fix version one more time...
rernst Aug 18, 2026
e0a8d3e
Remove set -ex
rernst Aug 19, 2026
e24cc82
Fix version
rernst Aug 19, 2026
9d24eba
Update snap
rernst Aug 20, 2026
ff6695d
Bump dragen utils containers to 1.0.0
rernst Aug 26, 2026
162aa61
Add BAM and BAI output files to dragen
Jorisvansteenbrugge Aug 21, 2026
e70ebc7
include bai in snapshot
Jorisvansteenbrugge Aug 21, 2026
b31f4e2
genome tar processing flow
Jorisvansteenbrugge Aug 28, 2026
04800c4
run dragen with preprocessed genome tar
Jorisvansteenbrugge Aug 28, 2026
5d8f653
remove job array param ref
Jorisvansteenbrugge Aug 28, 2026
d725faa
fix linting
Jorisvansteenbrugge Aug 28, 2026
f0cc613
Add BAM and BAI output files to dragen
Jorisvansteenbrugge Aug 21, 2026
46ab520
include bai in snapshot
Jorisvansteenbrugge Aug 21, 2026
444c50a
Merge branch 'main' into feature/dragen_genome_untar
Jorisvansteenbrugge Aug 28, 2026
d00aff8
joint output bam and bai as tuple
Jorisvansteenbrugge Aug 28, 2026
c6d070b
Merge branch 'feature/dragen_genome_untar' into feature/dragen_bam
Jorisvansteenbrugge Aug 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions modules/UMCUGenetics/dragen/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ process DRAGEN {
container '079623148045.dkr.ecr.eu-central-1.amazonaws.com/cp-prod/f1b7ad6a-11ac-4bc1-b705-b275ff2887ad:latest'

input:
// TODO: Move ref_tar unpacking to a separate process to avoid unpacking the reference for every sample? -> added in prs branch
tuple val(meta), path(r1_fastq), path(r2_fastq)
path fastq_list
path ref_tar
tuple val(meta2), path(ref_dir)
path repeat_genotype_specs

output:
tuple val(meta), path("*"), emit: output
tuple val(meta), path('*.csv'), emit: csv
tuple val(meta), path("${prefix}.bam"), path("${prefix}.bam.bai"), emit: bam_bai
tuple val(meta), path("${prefix}.wgs_coverage_metrics.csv"), optional: true, emit: wgs_coverage_metrics
tuple val(meta), path("${prefix}.cnv_metrics.csv"), optional: true, emit: cnv_metrics
tuple val(meta), path("${prefix}.mapping_metrics.csv"), optional: true, emit: mapping_metrics
Expand All @@ -31,24 +31,18 @@ process DRAGEN {
script:
prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args ?: ''

if (repeat_genotype_specs) {
args = args + " --repeat-genotype-enable true --repeat-genotype-specs " + repeat_genotype_specs
}

def repeat_specs = repeat_genotype_specs ? "--repeat-genotype-enable true --repeat-genotype-specs ${repeat_genotype_specs}" : ""
"""
mkdir -p /scratch/reference
tar -C /scratch/reference -xf ${ref_tar}

/opt/edico/bin/dragen --partial-reconfig HMM --ignore-version-check true

/opt/edico/bin/dragen --lic-instance-id-location /opt/instance-identity \\
--ref-dir /scratch/reference/DRAGEN/9 \\
--ref-dir ${ref_dir} \\
--fastq-list ${fastq_list} \\
--fastq-list-sample-id ${meta.id} \\
--output-file-prefix ${prefix} \\
--output-directory ./ \\
--intermediate-results-dir /scratch \\
${repeat_specs} \\
${args}
"""

Expand All @@ -59,6 +53,7 @@ process DRAGEN {
echo ${args}

touch ${prefix}.bam
touch ${prefix}.bam.bai
touch ${prefix}.wgs_coverage_metrics.csv
touch ${prefix}.cnv_metrics.csv
touch ${prefix}.mapping_metrics.csv
Expand Down
31 changes: 30 additions & 1 deletion modules/UMCUGenetics/dragen/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,34 @@ nextflow_process {

tag "modules"
tag "modules_UMCUGenetics"
tag "subworkflows/prepare_ica_references"
tag "dragen"


setup{
nfcoreInitialise("${launchDir}/library/")
nfcoreInstall(
"${launchDir}/library/",
[
"samtools/faidx",
"gatk4/createsequencedictionary"
]
)
nfcoreLink("${launchDir}/library/", "${baseDir}/modules/")

run("PREPARE_ICA_REFERENCES") {
script "../../../../subworkflows/UMCUGenetics/prepare_ica_references/main.nf"
workflow {
"""
input[0] = channel.of([
[id: 'genome'],
file(params.subworkflows_umcu_testdata_base_path + "prepare_ica_references/genome.tar.gz", checkIfExists: true)
])
"""
}
}
}

test("dragen - stub") {
options '-stub'
when {
Expand All @@ -19,7 +45,7 @@ nextflow_process {
[]
]
input[1] = []
input[2] = []
input[2] = PREPARE_ICA_REFERENCES.out.genome_dir
input[3] = []
"""
}
Expand All @@ -33,5 +59,8 @@ nextflow_process {
).match() }
)
}
cleanup {
nfcoreUnlink("${launchDir}/library/", "${baseDir}/modules/")
}
}
}
34 changes: 27 additions & 7 deletions modules/UMCUGenetics/dragen/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
[
"sample1.bam:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.cnv_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.gvcf_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.mapping_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e",
Expand Down Expand Up @@ -36,48 +37,66 @@
{
"id": "sample1"
},
"sample1.wgs_coverage_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
"sample1.bam:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"3": [
[
{
"id": "sample1"
},
"sample1.cnv_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
"sample1.wgs_coverage_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"4": [
[
{
"id": "sample1"
},
"sample1.mapping_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
"sample1.cnv_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"5": [
[
{
"id": "sample1"
},
"sample1.ploidy_estimation_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
"sample1.mapping_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"6": [
[
{
"id": "sample1"
},
"sample1.gvcf_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
"sample1.ploidy_estimation_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"7": [
[
{
"id": "sample1"
},
"sample1.gvcf_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"8": [
[
"DRAGEN",
"dragen",
"bash: line 1: dragen: command not found"
]
],
"bam_bai": [
[
{
"id": "sample1"
},
"sample1.bam:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"cnv_metrics": [
[
{
Expand Down Expand Up @@ -123,6 +142,7 @@
},
[
"sample1.bam:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.cnv_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.gvcf_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.mapping_metrics.csv:md5,d41d8cd98f00b204e9800998ecf8427e",
Expand Down Expand Up @@ -165,10 +185,10 @@
]
}
],
"timestamp": "2026-08-18T11:08:58.003281",
"timestamp": "2026-08-28T16:31:56.534107",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.2"
"nextflow": "26.04.6"
}
}
}
32 changes: 27 additions & 5 deletions modules/UMCUGenetics/untar/genome/main.nf
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
process UNTAR_GENOME {
tag "${archive}"
tag "${meta.id}"
label 'process_single'

container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/52/52ccce28d2ab928ab862e25aae26314d69c8e38bd41ca9431c67ef05221348aa/data'
: 'community.wave.seqera.io/library/coreutils_grep_gzip_lbzip2_pruned:838ba80435a629f8'}"

input:
tuple val(meta), path(archive)
tuple val(meta), path(genome_tar)

output:
tuple val(meta), path('genome'), emit: untar
tuple val(meta), path('dragen_ref'), emit: dragen_ref
tuple val(meta), path('genome.fa'), emit: fasta
tuple val(meta), path("genes.gtf.gz"), emit: gtf
tuple val("${task.process}"), val('UNTAR'), eval('echo 1.0.0'), emit: versions_untar_genome, topic: versions

when:
task.ext.when == null || task.ext.when

script:
def hashtable_version = params.dragen_hashtable_version ?: ''
"""
mkdir genome
tar -xavf ${archive} -C genome
tar -xzf ${genome_tar}
mapfile -t hts < <(find . -name hash_table.cfg -printf '%h\\n' | grep -E '/[0-9]+\$' | sort -V)

if [ \${#hts[@]} -eq 0 ]; then
echo "ERROR: no DRAGEN hashtable (hash_table.cfg) found in ${genome_tar}" >&2
exit 1
fi


if [ -n "${hashtable_version}" ]; then
ref_dir=\$(printf '%s\\n' "\${hts[@]}" | grep -E "/${hashtable_version}\$") || {
echo "ERROR: hashtable v${hashtable_version} not found. Available: \${hts[*]}" >&2
exit 1
}
else
ref_dir=\${hts[-1]} # Highest version
fi

echo "Using DRAGEN ref-dir: \$ref_dir" >&2
ln -s "\$(realpath \$ref_dir)" dragen_ref

"""
}
5 changes: 4 additions & 1 deletion modules/UMCUGenetics/untar/genome/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ nextflow_process {
"""
input[0] = channel.of([
[id: 'genome'],
file(params.subworkflows_umcu_testdata_base_path + "prepare_ica_references/genome.tar", checkIfExists: true)
file(params.subworkflows_umcu_testdata_base_path + "prepare_ica_references/genome.tar.gz", checkIfExists: true)
])
"""
}
}
then{
assertAll(
{ assert process.success },
{ assert path(process.out.dragen_ref[0][1]).exists() },
{ assert path(process.out.fasta[0][1]).exists() },
{ assert path(process.out.gtf[0][1]).exists() },
{ assert snapshot(
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
Expand Down
2 changes: 1 addition & 1 deletion modules/UMCUGenetics/untar/genome/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]
}
],
"timestamp": "2026-08-21T11:44:44.991954",
"timestamp": "2026-08-28T10:56:51.250213",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
Expand Down
1 change: 0 additions & 1 deletion subworkflows/UMCUGenetics/bam_prs/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ process {
cpus = 2
memory = { 10.GB * task.attempt }
time = { 30.m * task.attempt }
array = params.job_array_size
ext.args = {
[
"--allow-extra-chr",
Expand Down
13 changes: 4 additions & 9 deletions subworkflows/UMCUGenetics/prepare_ica_references/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,18 @@ workflow PREPARE_ICA_REFERENCES {

UNTAR_GENOME(genome_tar)

genome_fasta = UNTAR_GENOME.out.untar
.map{ meta, dir -> [meta, file("${dir}/genome.fa",
checkIfExists: !workflow.stubRun)
]}

SAMTOOLS_FAIDX(
genome_fasta.map {meta, fasta -> [meta, fasta, []]},
UNTAR_GENOME.out.fasta.map {meta, fasta -> [meta, fasta, []]},
false
)

GATK4_CREATESEQUENCEDICTIONARY(genome_fasta)
GATK4_CREATESEQUENCEDICTIONARY(UNTAR_GENOME.out.fasta)


emit:
genome_fasta = genome_fasta
genome_fasta = UNTAR_GENOME.out.fasta
genome_fai = SAMTOOLS_FAIDX.out.fai
genome_dict = GATK4_CREATESEQUENCEDICTIONARY.out.dict
genome_dir = UNTAR_GENOME.out.untar
genome_dir = UNTAR_GENOME.out.dragen_ref

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ nextflow_workflow {
}

test("Validate genome untar and processing") {
options "-stub"
when{
workflow{
"""
input[0] = channel.of([
[id: 'genome'],
file(params.subworkflows_umcu_testdata_base_path + "prepare_ica_references/genome.tar", checkIfExists: true)
file(params.subworkflows_umcu_testdata_base_path + "prepare_ica_references/genome.tar.gz", checkIfExists: true)
])
"""
}
}
then {
assertAll(
{ assert workflow.success },
{ assert snapshot(
workflow.out.genome_fasta,
workflow.out.genome_fai,
workflow.out.genome_dict
).match()}
{ assert path(workflow.out.genome_fasta[0][1]).exists() },
{ assert path(workflow.out.genome_fai[0][1]).exists() },
{ assert path(workflow.out.genome_dict[0][1]).exists() },
{ assert path(workflow.out.genome_dir[0][1]).exists() },
)
}

Expand Down

This file was deleted.

Loading