Skip to content

Fix fastANI module#9583

Open
Ethan-Hetrick wants to merge 46 commits intonf-core:masterfrom
Ethan-Hetrick:master
Open

Fix fastANI module#9583
Ethan-Hetrick wants to merge 46 commits intonf-core:masterfrom
Ethan-Hetrick:master

Conversation

@Ethan-Hetrick
Copy link

@Ethan-Hetrick Ethan-Hetrick commented Dec 17, 2025

PR checklist

Fixes several issues with the fastANI module:

  • Replaced custom meta field for module flow control with standard meta.id fields and logic

  • Added --threads $task.cpus to ensure proper multi-threading

  • Made output file names descriptive

  • Added stub block

  • Added optional outputs

  • This comment contains a description of changes (with reason).

  • If you've fixed a bug or added code that should be tested, add tests!

  • If you've added a new tool - have you followed the module conventions in the contribution docs

  • If necessary, include test data in your PR.

  • Remove all TODO statements.

  • Emit the versions.yml file.

  • Follow the naming conventions.

  • Follow the parameters requirements.

  • Follow the input/output options guidelines.

  • Add a resource label

  • Use BioConda and BioContainers if possible to fulfil software requirements.

  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:

    • For modules:
      • nf-core modules test <MODULE> --profile docker
      • nf-core modules test <MODULE> --profile singularity
      • nf-core modules test <MODULE> --profile conda
    • For subworkflows:
      • nf-core subworkflows test <SUBWORKFLOW> --profile docker
      • nf-core subworkflows test <SUBWORKFLOW> --profile singularity
      • nf-core subworkflows test <SUBWORKFLOW> --profile conda

Copy link
Contributor

@vagkaratzas vagkaratzas left a comment

Choose a reason for hiding this comment

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

Valiant first effort, but will require some more updates.

Ethan-Hetrick and others added 9 commits December 18, 2025 13:23
Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
Copy link
Contributor

@vagkaratzas vagkaratzas left a comment

Choose a reason for hiding this comment

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

Hey! Nice, it starts to be more clear! Some more comments for additions.

Copy link
Contributor

@vagkaratzas vagkaratzas left a comment

Choose a reason for hiding this comment

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

It seems that some of the tests are failing. Try to fix linting errors locally before pushing, with the command nf-core modules lint fastani, and also use the pre-commit command when you have staged your files, before git commit.

Some output files from the tests are changing, so you will need a bit more sophisticated checks than just workflow.out.ani, since for example the all.txt file is changing during tests for tag "'sarscov2 - referece vs contigs - fastANI - all vs all mode'". Something like counting number of lines. Take other existing modules nf-tests as an example.

Copy link
Contributor

@vagkaratzas vagkaratzas left a comment

Choose a reason for hiding this comment

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

Left another round of points, mostly formatting. Make sure the snapshots are updated and the proper assertions are made ( { assert snapshot( process.out.ani, might not work for your last failing test if result not deterministic).

[
"FASTANI",
"fastani",
""
Copy link
Contributor

Choose a reason for hiding this comment

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

version not showing here

[

],
"all.txt:md5,616c232d14c8f9ad3cda307154fa895e"
Copy link
Contributor

Choose a reason for hiding this comment

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

The failed test is for this one. You either forgot to update its snapshot, or the result all.txt is not deterministic, so instead of checking its md5sum, you will have to make another assertion such as stable number of file lines, or containing specific lines, or worst case scenario just that the name exists. Have a look at how other modules in the repo do this.

Copy link
Author

Choose a reason for hiding this comment

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

Went with the line count check, addressed in 00098ca

Comment on lines 3 to 14
tag "fastani"
script "../main.nf"
process "FASTANI"
config "./nextflow.config"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please cleanup up here, remove duplicates and follow the usual order of things, just like every other nf-core module. Example:

nextflow_process {

    name "Test Process ABACAS"
    script "../main.nf"
    process "ABACAS"
    config "./nextflow.config"
    tag "modules"
    tag "modules_nfcore"
    tag "abacas"

Copy link
Author

Choose a reason for hiding this comment

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

Addressed in 09bf7ad

Ethan-Hetrick and others added 10 commits February 13, 2026 12:13
Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
Copy link
Contributor

@vagkaratzas vagkaratzas left a comment

Choose a reason for hiding this comment

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

Great work!
The error got fixed by merging the master branch into yours (there were some issues with versions I think yesterday).
Can you please move the two assertions I suggested inside the snapshot block and redo the snapshot for that nf-test?
Will be approved after this last bit :D

Comment on lines +81 to +82
def aniFile = path(process.out.ani[0][1])
assert aniFile.exists()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you instead of these two lines, add soemthing like this inside the assert snapshot block?

file(process.out.ani[0][1]).name

Comment on lines +83 to +84
def lines = aniFile.readLines()
assert lines.size() == 4 : "Expected 4 ANI comparisons but found ${lines.size()}"
Copy link
Contributor

Choose a reason for hiding this comment

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

And instead of these two, do this inside the snapshot block again:

path(workflow.out.ani[0][1]).readLines().size(),

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