Skip to content

enable a pre-built bowtie2 index for rrna removal - #1892

Draft
emmanuel-tan wants to merge 4 commits into
nf-core:devfrom
emmanuel-tan:enhancement/rrna-bt-index
Draft

enable a pre-built bowtie2 index for rrna removal#1892
emmanuel-tan wants to merge 4 commits into
nf-core:devfrom
emmanuel-tan:enhancement/rrna-bt-index

Conversation

@emmanuel-tan

@emmanuel-tan emmanuel-tan commented Jul 21, 2026

Copy link
Copy Markdown

Summary

Adds support for supplying a pre-built Bowtie2 index for rRNA removal (--ribo_removal_tool bowtie2), so users don't have to rebuild the index from --ribo_database_manifest on every run.

Addresses #1731

Changes made

  • Added --bowtie2_rrna_index to nextflow_schema.json (path or .tar.gz archive) with description/help text.

  • subworkflows/local/prepare_genome_indices/main.nf:

    • Added bowtie2_rrna_index as a take: input and a new emit output.
    • Added a bowtie2_rrna' branch to prepare_tool_indices (only added when ribo_removal_tool == 'bowtie2' and an index path is supplied).
    • New step 3b) untars the archive via a new UNTAR_BOWTIE2_RRNA_INDEX module (only if the path ends in .tar.gz) or passes the directory straight through if it's already unpacked. No index is built here as that stays in fastq_remove_rrna, this subworkflow only resolves/untars a pre-built one.
  • workflows/rnaseq/main.nf: make_bowtie2_index is now false whenever --bowtie2_rrna_index is set, skipping on-the-fly index construction.

  • main.nf: params.bowtie2_rrna_index is threaded into PREPARE_GENOME_INDICES, and its resolved bowtie2_rrna_index output is passed to RNASEQ.

  • subworkflows/nf-core/fastq_remove_rrna/main.nf: reverted to the nf-core version of this workflow; an earlier commit of mine incorrectly modified this.

  • tests/remove_ribo_rna.nf.test (+ .snap): two new nf-test cases (--bowtie2_rrna_index, normal and -stub) asserting the index-build steps (SEQKIT_REPLACE*, BOWTIE2_BUILD) are skipped and UNTAR_BOWTIE2_RRNA_INDEX runs instead. Pending PR that adds a small test index at add small bowtie2 index for tests test-datasets#2174 .

How index resolution now works

  1. --bowtie2_rrna_index unset → make_bowtie2_index = true, and fastq_remove_rrna builds the index from --ribo_database_manifest FASTAs as before.
  2. --bowtie2_rrna_index set → prepare_genome_indices resolves it (untarring if needed) and that channel is passed straight through to fastq_remove_rrna, which skips the build step entirely.

Outstanding items

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests! (nf-test cases added; blocked on official test-datasets index — see above)
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • If necessary, also make a PR on the nf-core/rnaseq branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core pipelines lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

@emmanuel-tan
emmanuel-tan force-pushed the enhancement/rrna-bt-index branch from 70ed748 to a58734d Compare August 1, 2026 04:34
@emmanuel-tan

Copy link
Copy Markdown
Author

Hi @pinin4fjords ! I just wanted to highlight this PR for your review. It does depend on PRs in the nf-core/test-datasets and the nf-core/modules repos so leaving as a draft first. Hope the approach taken makes sense! Open for further thoughts and discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant