Skip to content

Add basic subworkflow for unzipping and indexing fasta - #12663

Open
DLBPointon wants to merge 4 commits into
masterfrom
setup_fasta
Open

Add basic subworkflow for unzipping and indexing fasta#12663
DLBPointon wants to merge 4 commits into
masterfrom
setup_fasta

Conversation

@DLBPointon

@DLBPointon DLBPointon commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

A pretty simple pattern i've seen in alot of places is unzipping fasta, cleaning and then index/sizes generation.

Thought I'd make it a subworkflow seeing as it's so common.

Linked to: sanger-tol/nf-core-modules#274

Further dev:

  • Could potentially add something to clean headers too, alot of the tools we use don't like headers with any special characters or even spaces in a couple of cases.

EDIT: Just realised that it's set up for Sanger-tol data. I'll get that sorted.

include { GAWK as GAWK_UPPER_SEQUENCE } from '../../../modules/nf-core/gawk/main'
include { SAMTOOLS_FAIDX } from "../../../modules/nf-core/samtools/faidx/main"

workflow GUNZIP_FASTA_INDEX {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
workflow GUNZIP_FASTA_INDEX {
workflow FASTA_UNZIP_UPPER_GAWK {

Following the naming guidelines: https://nf-co.re/docs/specifications/components/subworkflows/naming-conventions#name-format-of-subworkflow-files

Anyone else have a better suggestion? I'm not used to the subworkflow naming conventions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is a #subworkflows channel on the slack, good to ask there.
I think maybe something more general like FASTA_PREPARE

@DLBPointon

Copy link
Copy Markdown
Contributor Author

Just spoke with Matthieu

Adding a header cleaner is likely a good idea, we already have a tool to do this in ASCC. Could also include some basic information about the fasta too (max_seq_length, total_length, n_seqs) in json format so that we don't pollute the meta.

@SPPearce

Copy link
Copy Markdown
Contributor

Maybe we could generate the dict file as well, for the tools that require that.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants