Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
f2ee256
Add draft of FASTQ_REMOVE_ADAPTERS_AND_MERGE subworkflow with tests
kornkv Dec 8, 2025
060b52d
Add ontologies to tcoffee/regressive and upp/align modules (#9484)
mirpedrol Dec 1, 2025
a03e263
Add module PBMARKDUP (#9457)
sainsachiko Dec 1, 2025
e505244
Enable complex contrast strings in DESeq2 (#9473)
delfiterradas Dec 1, 2025
26d5803
Declare deepvariant optional html output (#9469)
peterpru Dec 2, 2025
dbadf9c
utils_nfcore_pipeline: fix small lang server error (#9492)
matthdsm Dec 2, 2025
e97aaf4
Fix hisat2/align to support large genome indices (.ht2l) (#9493)
pinin4fjords Dec 2, 2025
51369d0
Update shinyngs modules to latest release (#9488)
delfiterradas Dec 2, 2025
7130774
Update semibin/singleeasybin environment (#9495)
dialvarezs Dec 2, 2025
e188efd
add new ontology term to tcoffee align (#9497)
mirpedrol Dec 3, 2025
74834d8
tcoffee_extractfrompdb test: sort file listing so "first" file is det…
nathanweeks Dec 3, 2025
f69fa14
Sambamba depth add region bed input (#9498)
peterpru Dec 3, 2025
2629da3
fix fasta_index_methylseq and fastq_align_dedup workflows (#9496)
sateeshperi Dec 3, 2025
19b67c4
Update test files for Glimpse (#9467)
LouisLeNezet Dec 4, 2025
819155d
meta.yml schema: add `containers` section, fix order and simplify (#9…
mashehu Dec 4, 2025
53675cf
update and add topics to snakemake module (#9454)
maxulysse Dec 5, 2025
b8c8f85
fix sambamba depth stub version (#9509)
fellen31 Dec 5, 2025
6c99c79
anota2seq: wrong variable name for batch assignment (#9511)
suhrig Dec 5, 2025
28bea76
fix(anota2seq): add gene IDs and handle empty results (#9510)
pinin4fjords Dec 5, 2025
dabd880
fix(decoupler): reorder imports and ensure environment variables are …
atrigila Dec 7, 2025
2d52823
Add strdrop/build (#9512)
fellen31 Dec 7, 2025
60239ed
chore(deps): update infrastructural dependencies
renovate[bot] Dec 8, 2025
7b3c6f4
🔧 update image and bioconda container for VueGen to latest version (#…
enryH Dec 8, 2025
6963d50
qsv/cat: bump version (#9518)
dialvarezs Dec 8, 2025
76c51e7
Update haplogrep3 recipe to use topics (#9523)
ramprasadn Dec 8, 2025
36c4abb
semibin/singleeasybin: bump version + migrate to topics (#9517)
dialvarezs Dec 8, 2025
9239334
remove unused folder
vagkaratzas Dec 8, 2025
ced4270
rename
vagkaratzas Dec 8, 2025
66b909c
Merge branch 'master' into fastq_remove_adapters_and_merge
vagkaratzas Dec 8, 2025
a68276a
trimmomatic revisit
vagkaratzas Dec 8, 2025
c7ef10c
cutadapt revisit
vagkaratzas Dec 8, 2025
ca4db62
trimgalore revisit
vagkaratzas Dec 8, 2025
54863da
bbduk revisit
vagkaratzas Dec 8, 2025
697d943
fastp revisit
vagkaratzas Dec 8, 2025
a0b1a41
Merge branch 'master' into fastq_remove_adapters_and_merge
vagkaratzas Dec 9, 2025
77cdc8c
adapterremoval revisit
vagkaratzas Dec 9, 2025
209581d
leehom checkpoint (#9534)
vagkaratzas Dec 9, 2025
5854017
remove ngmerge because cant deal with /1 /2 paired reads
vagkaratzas Dec 9, 2025
3001aa7
paired end no merge test
vagkaratzas Dec 9, 2025
beba663
Merge branch 'master' into fastq_remove_adapters_and_merge
vagkaratzas Dec 9, 2025
8637cb1
New module: clusty (#9533)
Joon-Klaps Dec 9, 2025
a7bc445
Bump TRGT to 4.1.0 (#9514)
fellen31 Dec 9, 2025
68d6485
fix missing quotes (#9535)
mashehu Dec 9, 2025
690f067
Fix dream to show more than 10 results (#9507)
delfiterradas Dec 9, 2025
2b65b43
rename to more appropriate fastq_preprocess_seqkit (#9537)
vagkaratzas Dec 9, 2025
08f0cec
New module - TD2 (added modules for td2.longorfs & td2.predict) (#9475)
khersameesh24 Dec 9, 2025
8293491
Bump ichorCNA package build in ichorcna/createpon and ichorcna/run (#…
lbeltrame Dec 10, 2025
a78cc00
RSeQC split_bam.py module implementation (#9536)
rhassaine Dec 10, 2025
56445cb
remove topics from multiqc (#9530)
nvnieuwk Dec 10, 2025
66d0bdd
bump to MultiQC version 1.33 (#9538)
FriederikeHanssen Dec 10, 2025
f3f9582
Add strdrop/call (#9513)
fellen31 Dec 10, 2025
0bac4f6
Bump TRGT to 5.0.0 (#9541)
fellen31 Dec 10, 2025
a939428
Channel -> channel in some subwfs (#9542)
nvnieuwk Dec 10, 2025
9d6f628
Migrate cat/fastq to topic channel (#9543)
Aratz Dec 10, 2025
7a6165f
Add module picard/collectvariantcallingmetrics (#9502)
georgiakes Dec 10, 2025
24b5c0c
fix tabix/tabix stub (#9544)
nvnieuwk Dec 10, 2025
f13b9a9
Unify msa modules (#9539)
mirpedrol Dec 10, 2025
e2c9156
Fix missing version from subworkflow snapshot (#9548)
Aratz Dec 10, 2025
b686830
New module: whatshap/phase (#9431)
HaidYi Dec 10, 2025
196f22c
Bump version cat/cat to pigz 2.8 & rewrite nf-test & topic channel (#…
Joon-Klaps Dec 10, 2025
5649f8a
plastid metagene_generate, make_wiggle, psite (#9482)
suhrig Dec 10, 2025
a0e5a8b
Add index and threads to trgt/merge (#9545)
fellen31 Dec 10, 2025
6b2c2fb
Fix test path modification (#9465)
LouisLeNezet Dec 10, 2025
ea2d4f0
Update xenium ranger modules and subworkflows (#9525)
an-altosian Dec 11, 2025
41ac464
Version update: Modkit repair, callmods and bedmethyltobigwig (#9547)
jkh00 Dec 11, 2025
37dbe45
Update `GLIMPSE` sbwf (#9524)
LouisLeNezet Dec 11, 2025
03cae33
Add quilt imputation subworkflow (#9443)
LouisLeNezet Dec 11, 2025
1f66a1e
Update glimpse2 imputation subworkflow (#9434)
LouisLeNezet Dec 11, 2025
e23f119
Add `BEAGLE5` imputation subworkflow (#9550)
LouisLeNezet Dec 11, 2025
2c74f42
Add minimac4 imputation subworkfllow (#9451)
LouisLeNezet Dec 11, 2025
1e8cb18
Add BBSplit stats to MultiQC in fastq_qc_trim_filter_setstrandedness …
pinin4fjords Dec 11, 2025
51ffcb6
Update cutadapt (#9551)
vagkaratzas Dec 12, 2025
02ae283
Merge branch 'master' into fastq_remove_adapters_and_merge
vagkaratzas Dec 12, 2025
4999717
added cutadapt to stub now that stub gz is properly created, and remo…
vagkaratzas Dec 12, 2025
a0a1406
single-end test with tool skips
vagkaratzas Dec 12, 2025
54a78b6
Standarize and alignment for all imputation and alignment modules (#9…
LouisLeNezet Dec 13, 2025
460be27
Update Infrastructural dependencies
renovate[bot] Dec 15, 2025
0b1640f
Remove .view() (#9567)
LouisLeNezet Dec 15, 2025
f12328e
Bump strdrop to 0.3.1 (#9565)
fellen31 Dec 15, 2025
2ed958f
Remove unecessary tags (#9568)
LouisLeNezet Dec 15, 2025
6546c99
Update trimgalore (#9570)
vagkaratzas Dec 15, 2025
ad92ee7
trimgalore output versions removed
vagkaratzas Dec 15, 2025
2f5aefa
Merge branch 'master' into fastq_remove_adapters_and_merge
vagkaratzas Dec 15, 2025
3ca7400
structure for subworkflow outputs in meta.yml file
vagkaratzas Dec 16, 2025
efbaae6
Merge branch 'master' into fastq_remove_adapters_and_merge
vagkaratzas Dec 16, 2025
f5cb4ca
Merge branch 'master' into fastq_remove_adapters_and_merge
vagkaratzas Dec 19, 2025
e73c143
Update subworkflows/nf-core/fastq_removeadapters_merge/main.nf
vagkaratzas Dec 19, 2025
7184754
Update subworkflows/nf-core/fastq_removeadapters_merge/main.nf
vagkaratzas Dec 19, 2025
36a9fff
main and meta updated with new one-tool logic
vagkaratzas Dec 19, 2025
d7519d6
nf-tests updated
vagkaratzas Dec 19, 2025
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
1 change: 0 additions & 1 deletion setup-nextflow
Submodule setup-nextflow deleted from 6c2e22
128 changes: 128 additions & 0 deletions subworkflows/nf-core/fastq_removeadapters_merge/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// both SE and PE
include { TRIMMOMATIC } from '../../../modules/nf-core/trimmomatic/main'
include { CUTADAPT } from '../../../modules/nf-core/cutadapt/main'
include { TRIMGALORE } from '../../../modules/nf-core/trimgalore/main'
include { BBMAP_BBDUK } from '../../../modules/nf-core/bbmap/bbduk/main'
include { LEEHOM } from '../../../modules/nf-core/leehom/main'
// both SE and PE, plus merging
include { FASTP } from '../../../modules/nf-core/fastp/main'
include { ADAPTERREMOVAL as ADAPTERREMOVAL_SE } from '../../../modules/nf-core/adapterremoval/main'
include { ADAPTERREMOVAL as ADAPTERREMOVAL_PE } from '../../../modules/nf-core/adapterremoval/main'

workflow FASTQ_REMOVEADAPTERS_MERGE {

take:
ch_input_reads // channel: [mandatory] meta, reads
val_adapter_tool // string: [mandatory] tool_name // choose from: ["trimmomatic", "cutadapt", "trimgalore", "bbduk", "leehom", "fastp", "adapterremoval"]
ch_adapters // channel: [optional] {fasta,txt} // fasta, for bbduk or fastp, or txt, for adapterremoval
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity of a pipeline dev maybe ch_adapters_file or a ch_custom_adapters_file?

val_save_merged // boolean: [mandatory] if true, will return the merged reads instead, for fastp and adapterremoval
val_fastp_discard_trimmed_pass // boolean: [mandatory] // only for fastp
val_fastp_save_trimmed_fail // boolean: [mandatory] // only for fastp

main:

ch_discarded_reads = channel.empty() // from trimmomatic, trimgalore, leehom, fastp, adapterremoval
ch_paired_interleaved = channel.empty() // from adapterremoval
ch_log = channel.empty() // from trimmomatic, trimgalore, fastp
ch_report = channel.empty() // from trimmomatic, trimgalore, fastp
ch_versions = channel.empty()
ch_multiqc_files = channel.empty() // from trimmomatic, cutadapt, bbduk, leehom, fastp, adapterremoval

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a validation check here to make sure whatever is given to val_adapter_tool is recognised by the subworkflow.

if (val_adapter_tool == "trimmomatic") {
TRIMMOMATIC( ch_input_reads )

ch_processed_reads = TRIMMOMATIC.out.trimmed_reads
ch_discarded_reads = ch_discarded_reads.mix(TRIMMOMATIC.out.unpaired_reads.transpose()) // .transpose() because paired reads have 2 unpaired files in an array
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by 2 unpaired files in an array? Do they represent different 'discarded' files? Or the discarded reads from each of the R1/R2? In the latter case does ti makes sense to separated them?

ch_log = TRIMMOMATIC.out.trim_log
ch_report = TRIMMOMATIC.out.summary
ch_versions = ch_versions.mix(TRIMMOMATIC.out.versions.first())
ch_multiqc_files = ch_multiqc_files.mix(TRIMMOMATIC.out.out_log)
} else if (val_adapter_tool == "cutadapt") {
CUTADAPT( ch_input_reads )

ch_processed_reads = CUTADAPT.out.reads
ch_multiqc_files = ch_multiqc_files.mix(CUTADAPT.out.log)
} else if (val_adapter_tool == "trimgalore") {
TRIMGALORE( ch_input_reads )

ch_processed_reads = TRIMGALORE.out.reads
ch_discarded_reads = ch_discarded_reads.mix(TRIMGALORE.out.unpaired)
ch_log = TRIMGALORE.out.log
ch_report = TRIMGALORE.out.html.mix(TRIMGALORE.out.zip)
} else if (val_adapter_tool == "bbduk") {
BBMAP_BBDUK( ch_input_reads, ch_adapters )

ch_processed_reads = BBMAP_BBDUK.out.reads
ch_versions = ch_versions.mix(BBMAP_BBDUK.out.versions.first())
ch_multiqc_files = ch_multiqc_files.mix(BBMAP_BBDUK.out.log)
} else if (val_adapter_tool == "leehom") {
LEEHOM( ch_input_reads )

ch_processed_reads = LEEHOM.out.fq_pass
.join(LEEHOM.out.unmerged_r1_fq_pass, by: 0, remainder: true)
.join(LEEHOM.out.unmerged_r2_fq_pass, by: 0, remainder: true)
.map { meta, single, r1, r2 ->
if (meta.single_end) {
return [meta, single]
} else {
return [meta, [r1, r2]]
}
}
ch_discarded_reads = ch_discarded_reads.mix(LEEHOM.out.fq_fail, LEEHOM.out.unmerged_r1_fq_fail, LEEHOM.out.unmerged_r2_fq_fail)
ch_versions = ch_versions.mix(LEEHOM.out.versions.first())
ch_multiqc_files = ch_multiqc_files.mix(LEEHOM.out.log)
} else if (val_adapter_tool == "fastp") {
FASTP(
ch_input_reads.map { meta, files -> [ meta, files, ch_adapters ] },
val_fastp_discard_trimmed_pass,
val_fastp_save_trimmed_fail,
val_save_merged
)

if (val_save_merged) {
ch_processed_reads = FASTP.out.reads_merged
} else {
ch_processed_reads = FASTP.out.reads
}
ch_discarded_reads = ch_discarded_reads.mix(FASTP.out.reads_fail.transpose()) // .transpose() because paired reads have 3 fail files in an array
ch_log = FASTP.out.log
ch_report = FASTP.out.html
ch_versions = ch_versions.mix(FASTP.out.versions.first())
ch_multiqc_files = ch_multiqc_files.mix(FASTP.out.json)
} else if (val_adapter_tool == "adapterremoval") {
ch_adapterremoval_in = ch_input_reads
.branch { meta, _reads ->
single: meta.single_end
paired: !meta.single_end
}

ADAPTERREMOVAL_SE( ch_adapterremoval_in.single, ch_adapters )
ADAPTERREMOVAL_PE( ch_adapterremoval_in.paired, ch_adapters )

if (val_save_merged) {
ch_processed_reads = ADAPTERREMOVAL_SE.out.collapsed
.mix(
ADAPTERREMOVAL_PE.out.collapsed,
ADAPTERREMOVAL_SE.out.collapsed_truncated,
ADAPTERREMOVAL_PE.out.collapsed_truncated
)
} else {
ch_processed_reads = ADAPTERREMOVAL_SE.out.singles_truncated.mix(ADAPTERREMOVAL_PE.out.paired_truncated)
}
Comment on lines +103 to +111
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check against

https://github.com/nf-core/eager/blob/52da7b420a47b3703cc1bf12941409ad9ab61455/subworkflows/local/preprocessing_adapterremoval.nf#L38-L92

Preparing the AdapterRemoval reads is a little more complicated than just mixing, and you appear to have a mistake (there is no ADAPTERREMOVAL_SE.out.collapsed_truncated -> collapsed here means merged, but you don't get merged SE data).

What I would recommend is to offer as 'single' output:

  • SE (singles_truncated)
  • Unmerged Pairs (paird_truncated)
  • Merged pairs (collapsed + collapsed_truncated)

ch_discarded_reads = ch_discarded_reads.mix(ADAPTERREMOVAL_SE.out.discarded, ADAPTERREMOVAL_PE.out.discarded)
ch_paired_interleaved = ADAPTERREMOVAL_SE.out.paired_interleaved.mix(ADAPTERREMOVAL_PE.out.paired_interleaved)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be hones,t I think it's very rare anyone uses these... IU would maybe drop support for them to simplify

ch_versions = ch_versions.mix(ADAPTERREMOVAL_SE.out.versions.first(), ADAPTERREMOVAL_PE.out.versions.first())
ch_multiqc_files = ch_multiqc_files.mix(ADAPTERREMOVAL_PE.out.settings, ADAPTERREMOVAL_SE.out.settings)
} else {
error('Please choose one of the available adapter removal and merging tools: ["trimmomatic", "cutadapt", "trimgalore", "bbduk", "leehom", "fastp", "adapterremoval"]')
}

emit:
processed_reads = ch_processed_reads // channel: [ val(meta), [ fastq.gz ] ]
discarded_reads = ch_discarded_reads // channel: [ val(meta), [ fastq.gz ] ]
paired_interleaved = ch_paired_interleaved // channel: [ val(meta), [ fastq.gz ] ]
logfile = ch_log // channel: [ val(meta), [ {log,txt} ] ]
report = ch_report // channel: [ val(meta), [ {summary,html,zip} ] ]
versions = ch_versions // channel: [ versions.yml ]
multiqc_files = ch_multiqc_files
}
97 changes: 97 additions & 0 deletions subworkflows/nf-core/fastq_removeadapters_merge/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json
name: "fastq_removeadapters_merge"
description: Remove adapters and merge reads based on various module choices
keywords:
- adapters
- removal
- short reads
- merge
- trim
components:
- trimmomatic
- cutadapt
- trimgalore
- bbmap/bbduk
- leehom
- fastp
- adapterremoval
input:
- ch_input_reads:
type: file
description: |
List of FastQ files of size 1 and 2 for single-end and paired-end data, respectively.
Structure: [ val(meta), [ path(reads) ] ]
- val_adapter_tool:
type: string
description: |
Choose one of the available adapter removal and/or merging tools
enum: ["trimmomatic", "cutadapt", "trimgalore", "bbduk", "leehom", "fastp", "adapterremoval"]
- ch_adapters:
type: file
description: |
Optional reference files, containing adapter and/or contaminant sequences for removal.
In fasta format for bbmap/bbduk and fastp, or in text format for AdapterRemoval (one adapter per line).
- val_save_merged:
type: boolean
description: |
Specify true to output merged reads instead
Used by fastp and adapterremoval
- val_fastp_discard_trimmed_pass:
type: boolean
description: |
Used only by fastp.
Specify true to not write any reads that pass trimming thresholds from the fastp process.
This can be used to use fastp for the output report only.
- val_fastp_save_trimmed_fail:
type: boolean
description: |
Used only by fastp.
Specify true to save files that failed to pass fastp trimming thresholds
output:
- processed_reads:
type: file
description: |
Structure: [ val(meta), path(fastq.gz) ]
The trimmed/modified single or paired end or merged fastq reads
pattern: "*.fastq.gz"
- discarded_reads:
type: file
description: |
Structure: [ val(meta), path(fastq.gz) ]
The discarded reads
pattern: "*.fastq.gz"
- paired_interleaved:
type: file
description: |
Structure: [ val(meta), path(fastq.gz) ]
Adapterremoval paired-end reads in a single file, interleaving mate 1 and mate 2 reads
pattern: "*.paired.fastq.gz"
- logfile:
type: file
description: |
Execution log file
(trimmomatic {log}, trimgalore {txt}, fastp {log})
pattern: "*.{log,txt}"
- report:
type: file
description: |
Execution report
(trimmomatic {summary}, trimgalore {html,zip}, fastp {html})
pattern: "*.{summary,html,zip}"
- versions:
type: file
description: |
File containing software versions
Structure: [ path(versions.yml) ]
pattern: "versions.yml"
- multiqc_files:
type: file
description: |
MultiQC-compatible output files from tools used in preprocessing
(trimmomatic, cutadapt, bbduk, leehom, fastp, adapterremoval)
authors:
- "@kornkv"
- "@vagkaratzas"
maintainers:
- "@kornkv"
- "@vagkaratzas"
Loading