Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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"
}
}
}
46 changes: 46 additions & 0 deletions modules/UMCUGenetics/ica/untargenomebundle/main.nf
Comment thread
Jorisvansteenbrugge marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
process ICA_UNTARGENOMEBUNDLE {
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(genome_tar)

output:
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('tar'), eval('tar --version | sed -n "s/.*tar)//p" | tr -d " "'), emit: versions_ica_untargenomebundle, topic: versions

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

script:
def hashtable_version = params.dragen_hashtable_version ?: ''
"""
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

"""
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
nextflow_process {
name "Test UNTAR_GENOME module"
name "Test ICA_UNTARGENOMEBUNDLE module"
script "../main.nf"
process "UNTAR_GENOME"
process "ICA_UNTARGENOMEBUNDLE"

tag "modules"
tag "modules_UMCUGenetics"
tag "modules/untar_genome"
tag "untar/genome"
tag "untar"
tag "modules/ica_untargenomebundle"
tag "ica/untargenomebundle"
tag "untargenomebundle"
tag "ica"

test("Validate genome untar") {
test("Validate ica untar genome bundle") {
when {
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
20 changes: 20 additions & 0 deletions modules/UMCUGenetics/ica/untargenomebundle/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"Validate ica untar genome bundle": {
"content": [
{
"versions_ica_untargenomebundle": [
[
"ICA_UNTARGENOMEBUNDLE",
"tar",
"1.34"
]
]
}
],
"timestamp": "2026-08-31T11:23:15.672213",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
}
}
24 changes: 0 additions & 24 deletions modules/UMCUGenetics/untar/genome/main.nf

This file was deleted.

20 changes: 0 additions & 20 deletions modules/UMCUGenetics/untar/genome/tests/main.nf.test.snap

This file was deleted.

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
Loading
Loading