Add warning for negative distances during rate-adjustment #49
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.
During rate-adjustment, ksrates prints a warning if there are negative values for Ks distances, stating that they are artefacts.
More details below.
The rate-adjusted ortholog peak (K_AB) is derived through the following mathematical formulas, using three estimated ortholog distribution peaks (A: focal species, B: sister species, C: outgroup):
The numerator in (2) should always in principle be a positive number, as it is a measure of genetic distance. However, poor peak estimate for the three AC, AB and BC ortholog distributions might produce a negative sum, and therefore a negative K_OA value. The negative sign is then maintained also in (4).
Poor peak estimate is often due to the very old divergence age between the involved species or by bad quality sequence data.