-
Notifications
You must be signed in to change notification settings - Fork 24
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
Refactor CNV frequencies functions to their own module #665
Conversation
I think I found a solution (let's hope it doesn't break everything else). |
Note: I had to modify the test for |
Thank you @alimanfoo for the code showing how to generate coverage. It looks like variant_query is indeed the only part that is not covered. The other thing is |
Hi @jonbrenas, out of interest, were you thinking to aim to merge this first, and then #630 afterwards? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, thanks so much @jonbrenas. Couple of suggestions...
Co-authored-by: Alistair Miles <alimanfoo@googlemail.com>
…riagen-data-python into 663-move-cnv-frequencies
I still need to add the 'variant_query' test and, maybe, 'nobs_mode`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed a small simplification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looking good!
|
tests/test_ag3.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jonbrenas, I just realised, now that you have all the new unit tests in the tests/anoph/test_cnv_frq.py module, you can rip out all the old CNV-related tests against real data in the tests/test_ag3.py and tests/test_af1.py modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw part of the motivation for the refactoring was to move all tests to using simulated data. The CNV-related tests are basically almost all that's remaining of the legacy tests against real data. It will be great to remove them, very close then to completing the mission!
Merge complete and all legacy cnv tests have been removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jonbrenas. Looks like the _check_frequency()
function in test_ag3.py can also be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
Resolves #663 and works towards #366.
This passed all tests locally ... despite the fact that some parameters in the functions in the new file were not defined at all which leads be to believe that we never created tests for these functions (maybe a notebook or a legacy tests was used instead). I will try to remedy this.
Note (mostly to myself): The utility functions shared between all frequency analyses are imported from
snp_frq.py
here (because that's still where they are) but depending on the order in which PRs get merged, this may need to be changed.