Skip to content

Add enhanced AnimalBreeding toolkit - #11

Open
meibujun wants to merge 1 commit into
masterfrom
codex/optimize-and-enhance-animalbreeding.jl
Open

Add enhanced AnimalBreeding toolkit#11
meibujun wants to merge 1 commit into
masterfrom
codex/optimize-and-enhance-animalbreeding.jl

Conversation

@meibujun

@meibujun meibujun commented Oct 2, 2025

Copy link
Copy Markdown
Owner

Summary

  • add a fully documented AnimalBreeding module with pedigree handling, relationship matrix construction, genomic matrix utilities, and mixed model solvers
  • extend functionality with single-step H-matrix support, SNP质量控制、K折交叉验证、可靠度计算等实用工具,全面提升可用性

Testing

  • not run (Julia runtime is unavailable in the execution environment)

https://chatgpt.com/codex/tasks/task_e_68de0fcb5d588321817528b786aa674e

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment thread AnimalBreeding.jl
Comment on lines +263 to +270
A12 = isempty(others) ? zeros(0, length(geno_idx)) : A[others, geno_idx]
A11 = isempty(others) ? zeros(0, 0) : A[others, others]

inv_term = inv(Matrix(Gt)) - inv(Matrix(A22))
top = isempty(others) ? Matrix(A22) : [A11 A12; transpose(A12) A22]
adj = zeros(size(top))
adj[end-length(geno_idx)+1:end, end-length(geno_idx)+1:end] = inv_term
return Symmetric(top + adj)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Construct H with G_t−A22 rather than inverse difference

The docstring promises the single-step H relationship matrix, but the implementation builds the A matrix block and then adds inv(Gt) - inv(A22) to the genomic block. That mixes a covariance matrix (A) with inverse covariances, so the result is neither the expected H matrix nor the usual H⁻¹ formulation (which would start from A⁻¹). Downstream mixed-model equations that rely on H therefore receive numerically inconsistent entries, even when G and A22 are positive definite.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant