-
Notifications
You must be signed in to change notification settings - Fork 0
test: test by comparison to naive impls #30
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
base: main
Are you sure you want to change the base?
Conversation
laggycomputer
commented
Apr 9, 2025
- test: naive theta pi
- feat: naive watterson theta
tests/naive_stats.rs
Outdated
|
|
||
| pub fn from_vcf<R: BufRead>( | ||
| mut reader: noodles::vcf::io::Reader<R>, | ||
| ploidy: usize, |
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.
Are we unable to determine the ploidy from the VCF file itself? What happens if we get the value wrong during input?
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.
Looks like the VCF standard never defines a place where ploidy is specified and mixed ploidy is supported as well. Not sure we can do anything.
|
|
||
| use crate::model::{GenomeCollection, Site}; | ||
|
|
||
| trait NaiveGlobalStatistic: Default { |
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.
I would argue to drop these traits. I think we want the naive versions of each stat to be defined somewhere (preferably where they cannot access fields of the GenomeCollection), and have a definition like:
pub fn diversity_from_sites(iter: Iterator<Item=&Site>) -> f64 {todo!()}
pub fn diversity_from_samples(iter: Iterator<Item=Sample>) -> f64 {todo!()}
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.
GenomeCollecction.data is private so implementors already can't access it. We can redefine it in terms of iterators though, yes.
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.
GenomeCollecction.datais private so implementors already can't access it. We can redefine it in terms of iterators though, yes.
But you have the naive GlobalPi in the same source file, which brings up the potential to access internal fields.
|
One other comment: the conventional commit syntax for this pr should be |