Skip to content

Commit c8a688b

Browse files
authored
Merge pull request #1851 from nf-core/refactor/split-prepare-genome
Split PREPARE_GENOME into REFERENCES + INDICES subworkflows
2 parents aff708e + 189ac63 commit c8a688b

20 files changed

Lines changed: 11031 additions & 5929 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- [PR #1848](https://github.com/nf-core/rnaseq/pull/1848) - Align `actions/checkout` SHA in `nf-test-arm.yml` and `nf-test-gpu.yml` with the template-derived `nf-test.yml` (`v6`) ([#1847](https://github.com/nf-core/rnaseq/issues/1847))
1414
- [PR #1849](https://github.com/nf-core/rnaseq/pull/1849) - Tidy-up batch addressing [#1845](https://github.com/nf-core/rnaseq/issues/1845): README/schema clarifications, `&``&&` in three guards, deduplicated `withName` blocks, and removal of the unmaintained `bin/fastq_dir_to_samplesheet.py` (use [nf-core/fetchngs](https://nf-co.re/fetchngs) for samplesheet generation)
1515
- [PR #1850](https://github.com/nf-core/rnaseq/pull/1850) - Use the active aligner's display name in the MultiQC `fail_mapped` per-sample status row, and drop the hardcoded "STAR" reference from the pipeline-completion `min_mapped_reads` warning, so Bowtie2 reports no longer mislabel the metric as STAR ([#1846](https://github.com/nf-core/rnaseq/issues/1846))
16+
- [PR #1851](https://github.com/nf-core/rnaseq/pull/1851) - Split `PREPARE_GENOME` into `PREPARE_GENOME_REFERENCES` (FASTA / GTF / BED / transcript FASTA / chrom.sizes / rRNA / Kraken DB) and `PREPARE_GENOME_INDICES` (per-aligner index build/load) for clearer ownership; no user-facing parameter, output, or behaviour change ([#1721](https://github.com/nf-core/rnaseq/issues/1721)).
1617
- [PR #1852](https://github.com/nf-core/rnaseq/pull/1852) - Flatten `workflows/rnaseq/assets/` back to top-level `assets/` so `nf-core pipelines bump-version` finds `assets/multiqc_config.yml` and updates the report-comment URLs automatically on release bumps
1718

1819
## [[3.26.0](https://github.com/nf-core/rnaseq/releases/tag/3.26.0)] - 2026-05-07

conf/modules/prepare_genome.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ process {
7878
]
7979
}
8080

81-
withName: '.*:PREPARE_GENOME:BOWTIE2_BUILD' {
81+
withName: '.*:PREPARE_GENOME_INDICES:BOWTIE2_BUILD' {
8282
publishDir = [
8383
path: { params.save_reference ? "${params.outdir}/genome/index" : params.outdir },
8484
mode: params.publish_dir_mode,
@@ -165,7 +165,7 @@ process {
165165
]
166166
}
167167

168-
withName: '.*:PREPARE_GENOME:BBMAP_BBSPLIT' {
168+
withName: '.*:PREPARE_GENOME_INDICES:BBMAP_BBSPLIT' {
169169
ext.args = 'build=1'
170170
ext.prefix = 'genome_transcriptome'
171171
publishDir = [

main.nf

Lines changed: 55 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ params.bowtie2_index = getGenomeAttribute('bowtie2')
3636
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3737
*/
3838

39-
include { RNASEQ } from './workflows/rnaseq'
40-
include { PREPARE_GENOME } from './subworkflows/local/prepare_genome'
41-
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
42-
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
43-
include { checkMaxContigSize } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
44-
include { defineQcTools } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
45-
include { isStarIndexLegacy } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
39+
include { RNASEQ } from './workflows/rnaseq'
40+
include { PREPARE_GENOME_REFERENCES } from './subworkflows/local/prepare_genome_references'
41+
include { PREPARE_GENOME_INDICES } from './subworkflows/local/prepare_genome_indices'
42+
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
43+
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
44+
include { checkMaxContigSize } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
45+
include { defineQcTools } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
46+
include { isStarIndexLegacy } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
4647

4748
/*
4849
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -58,18 +59,42 @@ workflow NFCORE_RNASEQ {
5859
main:
5960

6061
//
61-
// SUBWORKFLOW: Prepare reference genome files
62+
// SUBWORKFLOW: Prepare reference genome files (FASTA, GTF, BED, transcript FASTA, chrom.sizes, rRNA FASTAs, Kraken DB)
6263
//
63-
PREPARE_GENOME (
64+
PREPARE_GENOME_REFERENCES (
6465
params.fasta,
6566
params.gtf,
6667
params.gff,
6768
params.additional_fasta,
6869
params.transcript_fasta,
6970
params.gene_bed,
71+
params.ribo_database_manifest,
72+
params.kraken_db,
73+
params.gencode,
74+
params.gffread_transcript_fasta,
75+
params.featurecounts_group_type,
76+
params.aligner,
77+
params.pseudo_aligner,
78+
params.skip_gtf_filter,
79+
params.remove_ribo_rna ? params.ribo_removal_tool : null,
80+
params.skip_alignment,
81+
params.skip_pseudo_alignment,
82+
params.use_sentieon_star,
83+
params.contaminant_screening,
84+
params.prokaryotic ?: false
85+
)
86+
87+
//
88+
// SUBWORKFLOW: Build or load aligner / pseudo-aligner / filtering indices
89+
//
90+
PREPARE_GENOME_INDICES (
91+
PREPARE_GENOME_REFERENCES.out.fasta_fai,
92+
PREPARE_GENOME_REFERENCES.out.gtf,
93+
PREPARE_GENOME_REFERENCES.out.transcript_fasta,
94+
PREPARE_GENOME_REFERENCES.out.rrna_fastas,
95+
params.fasta ? true : false,
7096
params.splicesites,
7197
params.bbsplit_fasta_list,
72-
params.ribo_database_manifest,
7398
params.star_index,
7499
params.rsem_index,
75100
params.salmon_index,
@@ -78,30 +103,23 @@ workflow NFCORE_RNASEQ {
78103
params.bowtie2_index,
79104
params.bbsplit_index,
80105
params.sortmerna_index,
81-
params.kraken_db,
82-
params.gencode,
83-
params.gffread_transcript_fasta,
84-
params.featurecounts_group_type,
85106
params.aligner,
86107
params.pseudo_aligner,
87-
params.skip_gtf_filter,
88108
params.skip_bbsplit,
89109
params.remove_ribo_rna ? params.ribo_removal_tool : null,
90110
params.skip_alignment,
91111
params.skip_pseudo_alignment,
92112
params.use_sentieon_star,
93113
params.use_parabricks_star,
94-
params.contaminant_screening,
95-
params.prokaryotic ?: false,
96114
isStarIndexLegacy() ?: false
97115
)
98116

99117
// Check if contigs in genome fasta file > 512 Mbp
100118
if (!params.skip_alignment && !params.bam_csi_index) {
101-
PREPARE_GENOME
119+
PREPARE_GENOME_REFERENCES
102120
.out
103-
.fai
104-
.map { fai -> checkMaxContigSize(fai) }
121+
.fasta_fai
122+
.map { _meta, _fasta, fai -> checkMaxContigSize(fai) }
105123
}
106124

107125
//
@@ -110,31 +128,30 @@ workflow NFCORE_RNASEQ {
110128
ch_samplesheet = channel.value(file(params.input, checkIfExists: true))
111129

112130
// Bowtie2 rRNA index is built on-demand inside the fastq_remove_rrna subworkflow
113-
// rather than in PREPARE_GENOME, to avoid duplicating the rRNA FASTA preparation logic
131+
// rather than in PREPARE_GENOME_INDICES, to avoid duplicating the rRNA FASTA preparation logic
114132
ch_bowtie2_rrna_index = channel.empty()
115133

116134
def qc_tools = defineQcTools(params)
117135

118136
RNASEQ (
119137
ch_samplesheet,
120-
PREPARE_GENOME.out.fasta,
121-
PREPARE_GENOME.out.gtf,
122-
PREPARE_GENOME.out.fai,
123-
PREPARE_GENOME.out.chrom_sizes,
124-
PREPARE_GENOME.out.gene_bed,
125-
PREPARE_GENOME.out.transcript_fasta,
126-
PREPARE_GENOME.out.star_index,
127-
PREPARE_GENOME.out.rsem_index,
128-
PREPARE_GENOME.out.hisat2_index,
129-
PREPARE_GENOME.out.bowtie2_index,
130-
PREPARE_GENOME.out.salmon_index,
131-
PREPARE_GENOME.out.kallisto_index,
132-
PREPARE_GENOME.out.bbsplit_index,
133-
PREPARE_GENOME.out.rrna_fastas,
134-
PREPARE_GENOME.out.sortmerna_index,
138+
PREPARE_GENOME_REFERENCES.out.fasta_fai,
139+
PREPARE_GENOME_REFERENCES.out.gtf,
140+
PREPARE_GENOME_REFERENCES.out.chrom_sizes,
141+
PREPARE_GENOME_REFERENCES.out.gene_bed,
142+
PREPARE_GENOME_REFERENCES.out.transcript_fasta,
143+
PREPARE_GENOME_INDICES.out.star_index,
144+
PREPARE_GENOME_INDICES.out.rsem_index,
145+
PREPARE_GENOME_INDICES.out.hisat2_index,
146+
PREPARE_GENOME_INDICES.out.bowtie2_index,
147+
PREPARE_GENOME_INDICES.out.salmon_index,
148+
PREPARE_GENOME_INDICES.out.kallisto_index,
149+
PREPARE_GENOME_INDICES.out.bbsplit_index,
150+
PREPARE_GENOME_REFERENCES.out.rrna_fastas,
151+
PREPARE_GENOME_INDICES.out.sortmerna_index,
135152
ch_bowtie2_rrna_index,
136-
PREPARE_GENOME.out.splicesites,
137-
PREPARE_GENOME.out.kraken_db,
153+
PREPARE_GENOME_INDICES.out.splicesites,
154+
PREPARE_GENOME_REFERENCES.out.kraken_db,
138155
qc_tools
139156
)
140157

nf-test.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ config {
1414

1515
def baseIgnore = ['modules/nf-core/**/tests/*', 'subworkflows/nf-core/**/tests/*']
1616
def sentieonTests = ['tests/sentieon_default.nf.test', 'subworkflows/local/align_star/tests/main.sentieon.nf.test']
17-
def gpuTests = ['tests/parabricks_default.nf.test', 'tests/gpu_ribodetector.nf.test', 'subworkflows/local/align_star/tests/main.parabricks.nf.test', 'subworkflows/local/prepare_genome/tests/main.parabricks.nf.test']
17+
def gpuTests = ['tests/parabricks_default.nf.test', 'tests/gpu_ribodetector.nf.test', 'subworkflows/local/align_star/tests/main.parabricks.nf.test', 'subworkflows/local/prepare_genome_indices/tests/main.parabricks.nf.test']
1818

1919
ignore = baseIgnore + (skipSentieon ? sentieonTests : []) + (skipGpu ? gpuTests : [])
2020

0 commit comments

Comments
 (0)