Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the genomic selection modules to use AGHmatrix’s Gmatrix for computing additive relationship matrices instead of rrBLUP’s A.mat.
- Switched A.mat calls to Gmatrix with VanRaden method and additional parameters.
- Commented out the custom
convert_genotypefunction and its usages in favor of raw genotype inputs. - Adjusted
get_relationship_matandformat_geno_matrixto integrate Gmatrix logic.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| R/mod_GS.R | Switched from A.mat to Gmatrix, commented out unused genotype conversion logic, added AGHmatrix import |
| R/GS_functions.R | Replaced A.mat with Gmatrix in get_relationship_mat, refined condition in format_geno_matrix |
Comments suppressed due to low confidence (4)
R/GS_functions.R:203
- After switching to Gmatrix, consider adding or updating unit tests to cover the new relationship matrix logic and parameter handling.
Geno.mat <- Gmatrix(t(geno_input),
R/GS_functions.R:203
- The variable
ploidyis referenced in the Gmatrix call but is not defined or passed intoget_relationship_mat. Consider adding aploidyparameter to the function signature or deriving it appropriately.
Geno.mat <- Gmatrix(t(geno_input),
R/mod_GS.R:644
- [nitpick] The
convert_genotypefunction and its usages are commented out and no longer needed. Removing this dead code will improve readability and maintainability.
#convert_genotype <- function(genotype_matrix, ploidy) {
R/GS_functions.R:385
- [nitpick] In R, use
&&for scalar logical comparisons instead of&to avoid unintended vectorized operations.
if(model == "rrBLUP" & ploidy == 2 & pred_matrix == "Gmatrix") {
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.
Updated the genomic selection tabs to use Gmatrix for the additive relationship matrices.