Correctly account for isolated samples in normalisation of pair_coalescence_* methods#3460
Open
nspope wants to merge 1 commit into
Open
Correctly account for isolated samples in normalisation of pair_coalescence_* methods#3460nspope wants to merge 1 commit into
pair_coalescence_* methods#3460nspope wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3460 +/- ##
==========================================
+ Coverage 91.67% 91.68% +0.01%
==========================================
Files 38 38
Lines 32186 32248 +62
Branches 5150 5167 +17
==========================================
+ Hits 29505 29567 +62
Misses 2348 2348
Partials 333 333
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Contributor
Author
|
Added an additional test into the C suite for "ancestor-descendant" sample pairs |
53a8d74 to
be9f67f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3459
There's the somewhat thorny issue of what the correct normalisation is when only one of$\int p(x) dx / (b - a)$ for "pair normalisation" (so the units are "sequence length per pair") -- this reduces to ${n \choose 2}$ when there's no isolated samples which agrees with the original implementation. Similarly I normalise by the "average pair span" $\int p(x) dx / {n \choose 2}$ for "span normalisation" (so that the units are "# of sample pairs") -- which simplifies to $b - a$ as per the original implementation where there are no isolated samples.
span_normaliseorpair_normaliseareTrue. In this case (using the notation of the linked issue), what I've done is normalise by the "average number of pairs"So the output (for the $i$th node or time window) is one of:
The above assumes that there's no missing trees over the interval--- if there are, replace$b - a$ by "nonmissing span" (the original implementation discounted missing span as well)