Skip to content

Add rgi/bwt#9585

Closed
vinisalazar wants to merge 20 commits intonf-core:masterfrom
vinisalazar:rgi/bwt
Closed

Add rgi/bwt#9585
vinisalazar wants to merge 20 commits intonf-core:masterfrom
vinisalazar:rgi/bwt

Conversation

@vinisalazar
Copy link
Copy Markdown
Contributor

Summary of changes:

  • rgi/bwt: add draft
  • rgi/bwt: editing input channel

cc @nickp60

  - Use template from rgi/main
  - Use fastq pair instead of single fasta file
@vinisalazar vinisalazar marked this pull request as draft December 18, 2025 01:31
  - add fastq extensions to 'pattern'
  - Trying to pass linter
  - build KMA/BWT index in workdir instead of program executable dir
  - update test snapshot
  - Don't check temp/ directory on snapshot, is different every time
  - Update snapshot
  - provide input.reads as list
  - don't check tsv snapshot (it's different every time)
  - json files are in random order so snapshot differs every time (I think)
@vinisalazar vinisalazar marked this pull request as ready for review December 18, 2025 06:08
@vinisalazar
Copy link
Copy Markdown
Contributor Author

@nickp60 we might want to adjust the output channels a little bit, looks to me as though these are the main files:

test.allele_mapping_data.txt
test.artifacts_mapping_stats.txt
test.gene_mapping_data.txt
test.overall_mapping_stats.txt
test.reference_mapping_stats.txt

Comment thread modules/nf-core/rgi/bwt/main.nf Outdated
Comment thread modules/nf-core/rgi/bwt/main.nf
Comment thread modules/nf-core/rgi/bwt/main.nf
@vinisalazar
Copy link
Copy Markdown
Contributor Author

@SPPearce thank you for the review, addressed your comments.

  - Use '--local' flag as default
@nickp60
Copy link
Copy Markdown

nickp60 commented Dec 31, 2025

@vinisalazar Thanks for doing all this! I agree with changing the output to specify those 5 outputs; that seems in line with the description in the docs

@vinisalazar
Copy link
Copy Markdown
Contributor Author

@SPPearce could this be merged as is, and I can have a go at @nickp60's suggestion on a later PR (along with updates to rgi/main, perhaps)?

@SPPearce
Copy link
Copy Markdown
Contributor

Sorry, missed your message last week.
This module looks a bit ugh, but I see it is based on the rgi/main module which has apparently been in nf-core/modules for years. I also see that @jfy133 has been updating that recently, so I'll just ping him to take a look too.
It would be useful for you to swap to using a topic channel for the version: https://nf-co.re/blog/2025/version_topics before we merge it in.

  - Create topics field in meta.yml
@vinisalazar
Copy link
Copy Markdown
Contributor Author

@nf-core-bot fix linting

@github-actions
Copy link
Copy Markdown

Nothing for me to do here! 🤷
This is probably because the linting errors come from nf-core lint and have to be fixed manually (or with nf-core lint --fix).

Copy link
Copy Markdown
Member

@jfy133 jfy133 left a comment

Choose a reason for hiding this comment

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

Ok first pass, some general things:

  • please remove unnecessary whitespace
  • If you don't want to EMIT the DB_VERSION etc., you can remove them entirely. I seem to remember we exported for downstream usage (e.g. hAMRonization, which may still be useful here!)


rgi \\
bwt \\
${args} \\
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
${args} \\
${args2} \\

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.

Sorry, where exactly would this args2 come from?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So the ext.args variables are defined in pipelines' modules.config file. You need one args variable for each command/section of a piped command 1, so you don't duplicate the same argument for two diffren tools/subcommands

Footnotes

  1. https://nf-co.re/docs/guidelines/components/modules#each-command-must-have-an-args-variable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i.e., in this case you don't use it for anything (even if it has to be there) but it would be defined in the pipeline logic :)

Comment thread modules/nf-core/rgi/bwt/main.nf Outdated
Comment on lines +28 to +29
def read_one = reads instanceof List ? reads[0] : reads
def read_two = reads instanceof List && reads.size() > 1 ? reads[1] : null
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please use the nf-core convention of using meta.single to decide how to inject single or paired end reads

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

An example:

input = meta.single_end ? "in=${fastq.join(',')}" : "in=${fastq[0]} in2=${fastq[1]}"

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.

Don't rush on that one, let me discuss with James ;)

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.

I think the general consensus was to use meta.single_end for this as James said.

Comment thread modules/nf-core/rgi/bwt/main.nf
Comment thread modules/nf-core/rgi/bwt/meta.yml Outdated
Comment on lines +100 to +106
"content": [
null,
[
"test.temp.sam.temp.fsa"
],
null,
null
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks odd, is it epected all the output to be null?

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.

@nickp60 would you be able to clarify this one? I'm not super familiar with rgi output.

Copy link
Copy Markdown
Contributor

@prototaxites prototaxites left a comment

Choose a reason for hiding this comment

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

Little thought about arity :)

Comment thread modules/nf-core/rgi/bwt/main.nf Outdated
Comment thread modules/nf-core/rgi/bwt/main.nf Outdated
Co-authored-by: Jim Downie <19718667+prototaxites@users.noreply.github.com>
Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
@vinisalazar
Copy link
Copy Markdown
Contributor Author

@jfy133 @prototaxites thanks heaps for the review! I merged some of the suggestions and left comments in others.

@jfy133
Copy link
Copy Markdown
Member

jfy133 commented Jan 19, 2026

Responded - linting is failing though!

  - capture topics appropriately in meta.yml
@vinisalazar
Copy link
Copy Markdown
Contributor Author

vinisalazar commented Jan 20, 2026

@jfy133 @SPPearce I've tried a bunch of things and managed to bring the number of errors in the lint down to 1, but can't figure that one out, am out of my depth here, please help 🙏🏼

@vinisalazar vinisalazar closed this by deleting the head repository Feb 3, 2026
@SPPearce
Copy link
Copy Markdown
Contributor

SPPearce commented Feb 3, 2026

Hi @vinisalazar,
Sorry, I missed the last message.
If you still want help, we can get this finished off and merged, it is almost there.

@vinisalazar vinisalazar mentioned this pull request Feb 3, 2026
17 tasks
@vinisalazar
Copy link
Copy Markdown
Contributor Author

Thanks @SPPearce, I accidentally deleted this while cleaning some old repos from my profile, but created the new PR referenced above.

github-merge-queue Bot pushed a commit that referenced this pull request Mar 6, 2026
* rgi/bwt: add draft

  - Use template from rgi/main

* rgi/bwt: editing input channel

  - Use fastq pair instead of single fasta file

* rgi/bwt: edit meta.yaml

  - add fastq extensions to 'pattern'

* rgi/bwt: update meta.yaml

  - Trying to pass linter

* rgi/bwt: add test snapshot

* rgi/bwt: add '--local' flag

  - build KMA/BWT index in workdir instead of program executable dir
  - update test snapshot

* rgi/bwt: update snapshot

* rgi/bwt: fix tests

  - Don't check temp/ directory on snapshot, is different every time
  - Update snapshot

* rgi/bwt: continue to fix tests

  - provide input.reads as list
  - don't check tsv snapshot (it's different every time)

* rgi/bwt: remove json from snapshots

  - json files are in random order so snapshot differs every time (I think)

* rgi/bwt: remove task.ext value

  - Use '--local' flag as default

* rgi/bwt: move version to topics output

  - Code review from #9585

* rgi/bwt: update meta.yml

  - Create topics field in meta.yml

* Apply suggestions from code review

Co-authored-by: Jim Downie <19718667+prototaxites@users.noreply.github.com>
Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* rgi/bwt: fix tests and linting

  - capture topics appropriately in meta.yml

* rgi/bwt: formatting

* rgi/bwt: formatting

* rgi/bwt: formatting

* rgi/bwt: formatting

  - Remove whitespace

* rgi/bwt: update snapshot

  - Fix escape character in versions output

* rgi/bwt: fix module test dataset path

  Code review for #9873

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>

* rgi/bwt: apply suggestions from code review (#9873)

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>

* rgi/bwt: use file in test-datasets repo

  - Closes #9339

* Apply suggestions from code review

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>

* Update modules/nf-core/rgi/bwt/main.nf

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>

---------

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>
Co-authored-by: Jim Downie <19718667+prototaxites@users.noreply.github.com>
Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
Co-authored-by: Matthias Hörtenhuber <mashehu@users.noreply.github.com>
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.

5 participants