Skip to content
Closed
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
89b4a73
initial commit
freerkvandijk Mar 17, 2026
3102b60
Restructured and added subworkflows
freerkvandijk Mar 17, 2026
507bbff
Refactor: Add untracked files from rebase, remove old tests and added…
freerkvandijk Mar 18, 2026
1684943
Changed UMI_LOCAL_SAMTOOLS_VIEW to alias nf-core samtools_view
freerkvandijk Mar 18, 2026
36f309a
Removed disable plugins
freerkvandijk Mar 18, 2026
7933c9d
Updated test.yml with test data
freerkvandijk Mar 19, 2026
ddc7d5c
Deleted unused files
freerkvandijk Mar 19, 2026
c541b4f
small fix to test.yml
freerkvandijk Mar 19, 2026
ce80126
Moved umi consensus docs to appropriate files and updated metro_map
freerkvandijk Mar 19, 2026
f4c05bb
Dropped usage.md snippet per request
freerkvandijk Mar 19, 2026
ffaea3f
refactor, import call into existing samtools_convert
freerkvandijk Mar 19, 2026
28070ac
Added channel for umi_family_sizes histogram output to be used in mul…
freerkvandijk Mar 19, 2026
e3a5c4e
nf-core modules update
freerkvandijk Mar 23, 2026
730a14c
Fixed FASTQ_ALIGN_DNA map now uses BAM idx file
freerkvandijk Mar 23, 2026
af40ce7
Merged samtools view, collate, fixmate, sort in a single local proces…
freerkvandijk Mar 23, 2026
0f46c7a
Tuple based UMI_FGBIO_ZIPPERBAMS
freerkvandijk Mar 23, 2026
9ae06ab
UMI_consensus input now is aligned BAM/BAI + removed alignment
freerkvandijk Mar 23, 2026
5640bf4
Created local module UMI_SAMTOOLS_PREP_TEMPLATE
freerkvandijk Mar 23, 2026
9afc2a4
Removed unused tests
freerkvandijk Mar 24, 2026
fd9c77f
Added tests
freerkvandijk Mar 24, 2026
36e2f6b
Added BWA/SNAP interleaved paired alignment in consensus step
freerkvandijk Mar 24, 2026
15306e7
Added SNAP and BWA consensus mapping option
freerkvandijk Mar 25, 2026
608a198
Moved changes from nf-core to separate modules
freerkvandijk Mar 25, 2026
c124ee8
Updated test
freerkvandijk Mar 25, 2026
b4ebadf
Updated code comments
freerkvandijk Mar 25, 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
20 changes: 20 additions & 0 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@
"description": "Run markdup in UMI-aware mode. This applies to Samtools only and requires the UMI to be in the read name.",
"default": false
},
"umi_consensus": {
"meta": ["umi_consensus"],
"type": "boolean",
"description": "Enable UMI consensus workflow based on KAPA/fgbio processing for this sample.",
"default": false
},
"umi_strategy": {
"meta": ["umi_strategy"],
"type": "string",
"description": "UMI consensus strategy to apply when umi_consensus is enabled.",
"enum": ["kapa"],
"default": "kapa"
},
"umi_min_reads": {
"meta": ["umi_min_reads"],
"type": "integer",
"description": "Minimum reads per family for consensus calling when UMI consensus is enabled.",
"minimum": 1,
"default": 2
},
"skip_trimming": {
"meta": ["skip_trimming"],
"type": "boolean",
Expand Down
20 changes: 20 additions & 0 deletions assets/schema_sampleinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,26 @@
"description": "Run markdup in UMI-aware mode. This applies to Samtools only and requires the UMI to be in the read name.",
"default": false
},
"umi_consensus": {
"meta": ["umi_consensus"],
"type": "boolean",
"description": "Enable UMI consensus workflow based on KAPA/fgbio processing for this sample.",
"default": false
},
"umi_strategy": {
"meta": ["umi_strategy"],
"type": "string",
"description": "UMI consensus strategy to apply when umi_consensus is enabled.",
"enum": ["kapa"],
"default": "kapa"
},
"umi_min_reads": {
"meta": ["umi_min_reads"],
"type": "integer",
"description": "Minimum reads per family for consensus calling when UMI consensus is enabled.",
"minimum": 1,
"default": 2
},
"skip_trimming": {
"meta": ["skip_trimming"],
"type": "boolean",
Expand Down
130 changes: 130 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,52 @@ process {
ext.args2 = "--fast"
}

// BWA aliases used by local wrappers
withName: '.*FASTQ_TO_CRAM:FASTQ_ALIGN_DNA:FASTQ_ALIGN_DNA_BWAMEM' {
cpus = 16
memory = 32.GB
ext.args = {
[
"-K 100000000",
"-v 3",
"-Y",
"-c 250",
meta.readgroup ? "-R \"@RG\\t" + meta.readgroup.findResults { rg -> rg.value?.trim() ? "${rg.key}:${rg.value}" : null }.join("\\t") + "\"" : "",
].join(" ").trim()
}
ext.args2 = "--fast"
}

withName: '.*FASTQ_TO_CRAM:UMI_CONSENSUS_KAPA:FASTQ_ALIGN_DNA_CONSENSUS:FASTQ_ALIGN_DNA_CONSENSUS_BWAMEM' {
cpus = 16
memory = 32.GB
ext.args = {
[
"-K 100000000",
"-p",
"-v 3",
"-Y",
"-c 250",
meta.readgroup ? "-R \"@RG\\t" + meta.readgroup.findResults { rg -> rg.value?.trim() ? "${rg.key}:${rg.value}" : null }.join("\\t") + "\"" : "",
].join(" ").trim()
}
ext.args2 = "--fast"
}

withName: '.*FASTQ_TO_CRAM:UMI_SAMTOOLS_SORT_PREP' {
cpus = 16
memory = 64.GB
ext.prefix = { "${meta.id}.umi_prep" }
ext.args = '-l 1 --output-fmt bam'
}

withName: '.*FASTQ_TO_CRAM:UMI_SAMTOOLS_MERGE_CRAM' {
cpus = 16
memory = 64.GB
ext.prefix = { "${meta.id}.umi_consensus_merged" }
ext.args = '--output-fmt cram,version=3.0 --output-fmt-option archive'
}

//// DRAGEN
withName: '.*FASTQ_ALIGN_DNA:DRAGMAP_ALIGN' {
cpus = 16
Expand Down Expand Up @@ -231,6 +277,90 @@ process {
}
}

withName: '.*FASTQ_TO_CRAM:UMI_.*' {
cpus = 16
memory = 64.GB
}

withName: '.*FASTQ_TO_CRAM:UMI_SAMTOOLS_PREP_TEMPLATE' {
ext.args = '-F 256 -bh --output-fmt bam'
ext.args2 = '-O -u --output-fmt bam'
ext.args3 = '-m --output-fmt bam'
ext.args4 = '--template-coordinate --output-fmt bam'
ext.prefix = { "${meta.id}.template" }
}

withName: '.*FASTQ_TO_CRAM:UMI_FGBIO_GROUPREADSBYUMI' {
ext.args = '--edits 1 -t RX'
}

withName: '.*FASTQ_TO_CRAM:UMI_FGBIO_CALLMOLECULARCONSENSUSREADS' {
cpus = 16
memory = 64.GB
ext.args = '--error-rate-pre-umi 45 --error-rate-post-umi 40 --max-reads 50 --output-per-base-tags false --read-name-prefix consensus'
}

withName: '.*FASTQ_TO_CRAM:UMI_FGBIO_FILTERCONSENSUSREADS' {
cpus = 16
memory = 64.GB
}

withName: '.*FASTQ_TO_CRAM:UMI_FGBIO_ZIPPERBAMS' {
ext.args2 = '--tags-to-reverse Consensus --tags-to-revcomp Consensus'
}

withName: '.*FASTQ_TO_CRAM:UMI_SAMTOOLS_SORT_FINAL' {
ext.args = '-l 9 --output-fmt bam'
}

withName: '.*FASTQ_TO_CRAM:UMI_CONSENSUS_KAPA:UMI_SAMTOOLS_SORT_ZIP_MAPPED' {
ext.prefix = { "${meta.id}.consensus_mapped_qname" }
ext.args = '-n -l 1 --no-PG --output-fmt bam'
}
withName: '.*UMI_CONSENSUS_KAPA:UMI_SAMTOOLS_SORT_ZIP_MAPPED' {
ext.prefix = { "${meta.id}.consensus_mapped_qname" }
ext.args = '-n -l 1 --no-PG --output-fmt bam'
}

withName: '.*FASTQ_TO_CRAM:UMI_CONSENSUS_KAPA:UMI_SAMTOOLS_SORT_ZIP_UNMAPPED' {
ext.prefix = { "${meta.id}.consensus_unmapped_qname" }
ext.args = '-n -l 1 --no-PG --output-fmt bam'
}
withName: '.*UMI_CONSENSUS_KAPA:UMI_SAMTOOLS_SORT_ZIP_UNMAPPED' {
ext.prefix = { "${meta.id}.consensus_unmapped_qname" }
ext.args = '-n -l 1 --no-PG --output-fmt bam'
}

withName: '.*FASTQ_TO_CRAM:UMI_CONSENSUS_KAPA:UMI_SAMTOOLS_STRIP_PG' {
ext.prefix = { "${meta.id}.consensus_mapped_qname_nopg" }
}
withName: '.*UMI_CONSENSUS_KAPA:UMI_SAMTOOLS_STRIP_PG$' {
ext.prefix = { "${meta.id}.consensus_mapped_qname_nopg" }
}

withName: '.*FASTQ_TO_CRAM:UMI_CONSENSUS_KAPA:UMI_SAMTOOLS_STRIP_PG_UNMAPPED' {
ext.prefix = { "${meta.id}.consensus_unmapped_qname_nopg" }
}
withName: '.*UMI_CONSENSUS_KAPA:UMI_SAMTOOLS_STRIP_PG_UNMAPPED' {
ext.prefix = { "${meta.id}.consensus_unmapped_qname_nopg" }
}

withName: '.*FASTQ_ALIGN_DNA_CONSENSUS:FASTQ_ALIGN_DNA_CONSENSUS_SNAP' {
ext.args = {
[
'-pairedInterleavedFastq',
'-b-',
'-sm 20',
'-I',
'-hc-',
'-S id',
'-sa',
'-xf 2',
meta.readgroup ? "-R \"@RG\\t" + meta.readgroup.findResults { rg -> rg.value?.trim() ? "${rg.key}:${rg.value}" : null }.join("\\t") + "\"" : "",
].join(' ').trim()
}
}

// coverage
//// Mosdepth
withName: '.*COVERAGE:MOSDEPTH' {
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The nf-cmgg/preprocessing documentation is split into the following pages:

- [Usage](usage.md)
- An overview of how the pipeline works, how to run it and a description of all of the different command-line flags.
- An overview of how the pipeline works, how to run it, command-line flags, and UMI consensus implementation details.
- [Output](output.md)
- An overview of the different results produced by the pipeline and how to interpret them.
- [Parameters](parameters.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/images/metro_map_dark.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ graph TD
FALCO -->|qc| MULTIQC_LIBRARY
FASTP -->|qc| MULTIQC_LIBRARY

FASTP -->|main| UMI_CONSENSUS
FASTP -->|main| ALIGN
UMI_CONSENSUS -->|main| ALIGN
ALIGN -->|main| MARKDUP
MARKDUP -->|main| CRAM_OUT

Expand Down
Loading