Skip to content

Conversation

@lucaspatel
Copy link

PR checklist

Closes #9653

This PR adds ViralConsensus as an nf-core/module.

  • 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.
  • Broadcast software version numbers to topic: versions - See version_topics
  • 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

@SPPearce SPPearce left a comment

Choose a reason for hiding this comment

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

Can you take a look at:
https://nf-co.re/docs/guidelines/components/modules#configuration-of-extargs-in-tests
and configure the ext.args that way please.
Or if they are all the same after you change the ext., then I guess just have the one nextflow.config

Comment on lines 84 to 87
{ assert process.out.fasta },
{ assert process.out.pos_counts },
{ assert process.out.ins_counts },
{ assert snapshot(process.out.versions_viralconsensus).match("optional_versions") }
Copy link
Contributor

Choose a reason for hiding this comment

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

Are none of these files stable and able to be put into the snapshot?

Copy link
Contributor

@SPPearce SPPearce left a comment

Choose a reason for hiding this comment

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

Comments made

Comment on lines 31 to 34
{ assert snapshot(
process.out.fasta,
process.out.findAll { key, val -> key.startsWith("versions") }
).match() }
Copy link
Contributor

Choose a reason for hiding this comment

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

This could probably just be

Suggested change
{ assert snapshot(
process.out.fasta,
process.out.findAll { key, val -> key.startsWith("versions") }
).match() }
{ assert snapshot(process.out.fasta).match() }

i.e. you are just testing everything that is generated.
Same applies to the others too by the looks of it.


input:
tuple val(meta), path(bam)
path fasta
Copy link
Contributor

Choose a reason for hiding this comment

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

We generally add a meta map to the fasta, to help for pipelines that want to consider multiple genomes.

@lucaspatel
Copy link
Author

Thanks @SPPearce for the review(s). The latest changes are addressed, at the cost of passing linting (at least based on nf-core modules lint locally, unsure about the CI yet).

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.fasta).match() }
Copy link
Contributor

Choose a reason for hiding this comment

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

Apologies, this should have been

Suggested change
{ assert snapshot(process.out.fasta).match() }
{ assert snapshot(process.out).match() }

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.fasta).match() }
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{ assert snapshot(process.out.fasta).match() }
{ assert snapshot(process.out).match() }

[
"VIRALCONSENSUS",
"viralconsensus",
"viral_consensus v1.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't being trimmed properly, should just be 1.0.0 here.

tuple val(meta), path("*.consensus.fa"), emit: fasta
tuple val(meta), path("*.pos_counts.tsv"), optional: true, emit: pos_counts
tuple val(meta), path("*.ins_counts.json"), optional: true, emit: ins_counts
tuple val("${task.process}"), val('viralconsensus'), eval("viral_consensus --version 2>&1 | head -n1 | sed 's/ViralConsensus //'"), topic: versions, emit: versions_viralconsensus
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 simplify this command, combining the sed and head. AI is very good at this.

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.

new module: ViralConsensus

2 participants