Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nf test for everyone ! #111

Merged
merged 10 commits into from
Aug 23, 2024
Merged

Nf test for everyone ! #111

merged 10 commits into from
Aug 23, 2024

Conversation

LouisLeNezet
Copy link
Collaborator

@LouisLeNezet LouisLeNezet commented Jul 18, 2024

Add nf-test for all subworkflows, workflows, modules and functions.
Fix in the same time multiple imports and names.

  • 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 pipeline conventions in the contribution docs
  • If necessary, also make a PR on the nf-core/phaseimpute branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

@LouisLeNezet LouisLeNezet self-assigned this Jul 18, 2024
@LouisLeNezet LouisLeNezet added the enhancement New feature or request label Jul 18, 2024
@LouisLeNezet LouisLeNezet added this to the v0.99.0 milestone Jul 18, 2024
@LouisLeNezet LouisLeNezet linked an issue Jul 18, 2024 that may be closed by this pull request
@LouisLeNezet LouisLeNezet requested a review from atrigila July 18, 2024 18:02
Copy link
Collaborator

@atrigila atrigila left a comment

Choose a reason for hiding this comment

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

Great job using the new plugins! They are really useful, especially in this pipeline.
I've left some initial comments, but, overall, instead of merging as-is, I would strongly consider submitting each module and subworkflow with their tests individually to nf-core, for a couple of reasons. First, this would ensure that the community approves the design of the new module structure, and they could also suggest additional tests. The community could take into consideration how some of these modules/subworkflows can be used in other pipelines (and therefore, which assertions would be useful), which would then translate in making each test more robust. Second, this would also ensure that we mostly have community-approved modules/subworkflows instead of local ones. I would do this before merging this PR, so that you would only have to change modules/local/ or subworkflows/local/ for the nf-core directory.

conf/steps/imputation_glimpse1.config Show resolved Hide resolved
@@ -0,0 +1,97 @@
nextflow_workflow {

name "Test Subworkflow BAM_DOWNSAMPLE_SAMTOOLS"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This subworkflow could be of great value to the community

workflow "BAM_IMPUTE_GLIMPSE1"

tag "subworkflows"
tag "subworkflows_local"
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should update the nf-core version to match this one

workflows/phaseimpute/tests/main.nf.test.snap Show resolved Hide resolved
}
}

test("Normalize vcf with computing frequencies after removing samples") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It could be asserted that the number of samples in the final vcf is less than the original number of samples in the vcf

}
}

test("Normalize vcf with computing frequencies after removing samples") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps the recalculated frequencies could also be assessed for any particular variant that changed.

{ assert snapshot(workflow.out).match() },
{ assert snapshot(workflow.out.vcf_tbi.collect{
path(it[1]).vcf.summary
}).match("Concat content")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could assert that the new total number of variants is the sum of the original vcfs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is apparently already a nf-core subworkflow for this usage I will update to it.

@LouisLeNezet
Copy link
Collaborator Author

Hi @atrigila,
I've solved some of your comment.
Unfortunately for some of them it doesn't seems that we can check the input files (so no comparison possible).
Concerning the contribution back to nf-core modules, not all the subworkflows might interest them.
I've open up an issue regarding this and we might solve it in following PRs.
I think the easiest would be to merge the current PR and then contribute to nf-core as it might take some times to merge on their side.

@LouisLeNezet LouisLeNezet merged commit c9322a0 into nf-core:dev Aug 23, 2024
8 checks passed
@LouisLeNezet LouisLeNezet deleted the nft_vcf branch October 1, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use nft-vcf
2 participants