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

Propr propr #4817

Merged
merged 24 commits into from
Feb 13, 2024
Merged

Propr propr #4817

merged 24 commits into from
Feb 13, 2024

Conversation

suzannejin
Copy link
Contributor

Add propr/propr module to perform compositional data analysis on rna-seq data

PR checklist

Closes #XXX

  • 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:
    • PROFILE=docker pytest --tag <MODULE> --symlink --keep-workflow-wd --git-aware
    • PROFILE=singularity pytest --tag <MODULE> --symlink --keep-workflow-wd --git-aware
    • PROFILE=conda pytest --tag <MODULE> --symlink --keep-workflow-wd --git-aware

@suzannejin suzannejin requested a review from a team as a code owner January 30, 2024 17:12
Copy link
Member

@pinin4fjords pinin4fjords left a comment

Choose a reason for hiding this comment

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

Really nice work- very tidy. Just curious why you're not snapshotting or otherwise checking the other outputs?

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.matrix).match("Test propr/propr using default options") },
Copy link
Member

Choose a reason for hiding this comment

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

Why only snapshotting the matrix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The FDR file is calculated based on a random sampling, so I don´t think we can snapshot.
Then the rds is the R object including the matrix, and the fdr, and more stuff that could be useful to run propr again if the user wants. So, same problem cannot be snapshot and have the same md5

Copy link
Member

Choose a reason for hiding this comment

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

Can you use set.seed() to make the FDR reproducible? You're right on the rds of course

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would require to change the package code and rebuild container and so on...
It is really a test that shuffles the input data and run multiple times the function used to create the matrix output, so I think if the matrix output is consistent, this step should not have problem too

Copy link
Member

Choose a reason for hiding this comment

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

You need to check this file in some way I think.

One thing you could do is e.g. extract the last line of the file, and check that the first value matches a test value to a limited number of decimal places (hopefully the FDR is stable to a limited extent). You could adapt from https://nf-co.re/docs/contributing/tutorials/nf-test_assertions#file-contains-check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pinin4fjords now it should be fine. I added a way to fix the seed for fdr reproducibility

@@ -1,2619 +1,3577 @@
adapterremovalfixprefix:
- modules/nf-core/adapterremovalfixprefix/**
- tests/modules/nf-core/adapterremovalfixprefix/**

Copy link
Member

Choose a reason for hiding this comment

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

Don't think you need to be changing this file- probably just something funny on your branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cuz it always give me merging conflicts with the master... what should I do then?

Copy link
Member

Choose a reason for hiding this comment

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

Probably something funny in your git history. Try literally copying in the file from master in a new commit?

Copy link
Member

@pinin4fjords pinin4fjords left a comment

Choose a reason for hiding this comment

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

Thanks for sorting out the seed - I think that really helps. You're just missing the FDR check on the first test.

assertAll(
{ assert process.success },
{ assert snapshot(process.out.matrix).match("Test propr/propr using default options - matrix") },
{ assert snapshot(process.out.versions).match("versions") }
Copy link
Member

Choose a reason for hiding this comment

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

missing fdr check here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hey there! fdr is an optional output actually. Here in the default test, I did not ask to compute fdr.

Copy link
Member

Choose a reason for hiding this comment

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

Ahh, my bad, thanks for explanation

assertAll(
{ assert process.success },
{ assert snapshot(process.out.matrix).match("Test propr/propr while running clr+pcor.bshrink explicitly - matrix")},
{ assert snapshot(process.out.fdr).match("Test propr/propr while running clr+pcor.bshrink explicitly - fdr")}
Copy link
Member

Choose a reason for hiding this comment

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

Conventionally, we have a version check in every test. But I won't insist.

@suzannejin
Copy link
Contributor Author

@pinin4fjords Thank you for the review!

@suzannejin suzannejin added this pull request to the merge queue Feb 13, 2024
Merged via the queue into nf-core:master with commit e467c09 Feb 13, 2024
11 checks passed
@suzannejin suzannejin deleted the propr_propr branch February 13, 2024 11:04
jch-13 pushed a commit to jch-13/modules that referenced this pull request Mar 19, 2024
* modified affy/justrma to allow the user get the unlog data when --keep.log2 FALSE

* after prettier

* trailing whitespace

* added final newline

* fix issue

* updated snapshot

* corrected md5sum issues with inconsistent decimals

* corrected round matrix method

* .

* copied pytest_modules.yml

* .

* updated container version and added reproducible test for fdr
jennylsmith pushed a commit to RSC-RP/modules that referenced this pull request Mar 20, 2024
* modified affy/justrma to allow the user get the unlog data when --keep.log2 FALSE

* after prettier

* trailing whitespace

* added final newline

* fix issue

* updated snapshot

* corrected md5sum issues with inconsistent decimals

* corrected round matrix method

* .

* copied pytest_modules.yml

* .

* updated container version and added reproducible test for fdr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants