Conversation
…le staging, added task.cpus to thread arg, created process stub, added optional tool outputs, and formatted input channels
vagkaratzas
left a comment
There was a problem hiding this comment.
Valiant first effort, but will require some more updates.
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>
vagkaratzas
left a comment
There was a problem hiding this comment.
Hey! Nice, it starts to be more clear! Some more comments for additions.
Modified outputs to be named based on first prefix Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
vagkaratzas
left a comment
There was a problem hiding this comment.
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.
Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
vagkaratzas
left a comment
There was a problem hiding this comment.
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", | ||
| "" |
There was a problem hiding this comment.
version not showing here
| [ | ||
|
|
||
| ], | ||
| "all.txt:md5,616c232d14c8f9ad3cda307154fa895e" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Went with the line count check, addressed in 00098ca
| tag "fastani" | ||
| script "../main.nf" | ||
| process "FASTANI" | ||
| config "./nextflow.config" |
There was a problem hiding this comment.
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"
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>
vagkaratzas
left a comment
There was a problem hiding this comment.
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
| def aniFile = path(process.out.ani[0][1]) | ||
| assert aniFile.exists() |
There was a problem hiding this comment.
Can you instead of these two lines, add soemthing like this inside the assert snapshot block?
file(process.out.ani[0][1]).name
| def lines = aniFile.readLines() | ||
| assert lines.size() == 4 : "Expected 4 ANI comparisons but found ${lines.size()}" |
There was a problem hiding this comment.
And instead of these two, do this inside the snapshot block again:
path(workflow.out.ani[0][1]).readLines().size(),
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.cpusto ensure proper multi-threadingMade 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.ymlfile.Follow the naming conventions.
Follow the parameters requirements.
Follow the input/output options guidelines.
Add a resource
labelUse 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:
nf-core modules test <MODULE> --profile dockernf-core modules test <MODULE> --profile singularitynf-core modules test <MODULE> --profile condanf-core subworkflows test <SUBWORKFLOW> --profile dockernf-core subworkflows test <SUBWORKFLOW> --profile singularitynf-core subworkflows test <SUBWORKFLOW> --profile conda