Skip to content

feat: add reference into channel to allow multiple refs - #48

Merged
mcolpus merged 2 commits into
developfrom
feat/multiple_refs
Sep 11, 2026
Merged

mcolpus merged 2 commits into
developfrom
feat/multiple_refs

Conversation

@mcolpus

@mcolpus mcolpus commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

A refactor to support multiple references when desired.
Will require changes to the main workflow

@bobturneruk
bobturneruk marked this pull request as draft August 14, 2026 12:16
@mcolpus
mcolpus marked this pull request as ready for review September 11, 2026 08:49

@bobturneruk bobturneruk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good. Couple of questions for my own education, really.

Comment thread main.nf
.ifEmpty { error("cannot find any reads matching ${params.input_single_suffix} in ${params.input_dir}") }
.map { it -> tuple(it.getName().replaceFirst(/(?i)\.(fastq|fq)\.gz$/, ""), it) }

ref = channel.fromPath("${params.ref_fasta}").first()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry I'm probably missing something obvious, but why .first() here, please?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's probably not needed anymore, but was definitely required with the previous setup. It ensures that the channel is a value channel: https://carpentries-incubator.github.io/workflows-nextflow/instructor/03-channels.html#channel-types

Comment thread main.nf
.map { it -> tuple(it[0], it[1]) }
invalid_model_ch = fastq_files
.filter { it -> it[4] != "failed" }
.map { it -> tuple(it[0], it[1], it[3], it[2]) }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Again, probably me not undertsanding but why swap the order here and not in the process?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That is just me avoiding needing to swap over all of the processes in the repo which would be a bit of a pain

@mcolpus
mcolpus merged commit 0f42216 into develop Sep 11, 2026
4 checks passed
@mcolpus
mcolpus deleted the feat/multiple_refs branch September 11, 2026 10:09
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.

2 participants