MultiPop: Add prototype calcGenParamPop() and genParamPop()#288
Draft
darizasu wants to merge 9 commits into
Draft
MultiPop: Add prototype calcGenParamPop() and genParamPop()#288darizasu wants to merge 9 commits into
calcGenParamPop() and genParamPop()#288darizasu wants to merge 9 commits into
Conversation
…tput were different
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## MultPop #288 +/- ##
==========================================
Coverage ? 46.79%
==========================================
Files ? 38
Lines ? 10232
Branches ? 0
==========================================
Hits ? 4788
Misses ? 5444
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
This PR adds a prototype implementation of two new functions for population-level genetic parameter summaries on
MultiPopobjects:calcGenParamPop(): internal/helper function computing trait-specific summaries per population with a user-defined function.genParamPop(): user-facing wrapper that iterates across traits and returns population-level outputs (e.g.gv,bv,dd, variances/covariances currently implemented).I also added basic roxygen documentation for both functions in
R/popSummary.R(kept intentionally concise) and tests intests/testthat/test-genParam.R(using Falconer's QG examples ofgenParam). These two functions were inspired by the functionality ofcalcGenParamandgenParam.The goal is to provide a first implementation for calculating genetic parameter summaries directly at the population level (including nested/partitioned
MultiPopworkflows).Current behavior and scope
This implementation works as expected for linear summaries (e.g.
FUN = mean,FUN = sum). It includes population-specific intercept handling so mean/sum behavior is consistent with the selected summary scale.However, for non-linear summaries (e.g.
FUN = prod,median,max), results should be interpreted with care, as the current decomposition is mathematically consistent for linear aggregation, but non-linear aggregators generally do not preserve the decomposition/equality with direct aggregation of individual totalgv.I'm making this a draft PR, so it's still a work-in-progress prototype.
@gregorgorjanc @gaynorr Please let me know your thoughts about it. I'd really appreciate feedback on the expected/desired behavior for non-linear
FUN.Related to #254