Skip to content

Dev main#151

Merged
smasongarrison merged 57 commits into
mainfrom
dev_main
May 27, 2026
Merged

Dev main#151
smasongarrison merged 57 commits into
mainfrom
dev_main

Conversation

@smasongarrison
Copy link
Copy Markdown
Member

This pull request introduces several enhancements and refactors to the pedigree modeling functionality, particularly improving the handling of variance components, memory optimization for large models, and usability for simulating and fitting pedigree data. The changes also include bug fixes, documentation improvements, and new utility functions.

Key changes include:

New Features and Enhancements

  • Added the simulatePedigrees() function to easily simulate multiple families at once and return them as a single combined data frame. [1] [2]
  • Introduced the condenseMatrixSlots function and a corresponding condenseMatrixSlots parameter to optimize memory usage for large OpenMx models by condensing matrix slots. This is now used throughout the pedigree model-building pipeline. [1] [2] [3] [4] [5] [6] [7]
  • Added a lbound parameter to variance component constructors to ensure positive variance components during optimization, with a default lower bound of 1e-10. [1] [2]
  • Improved the handling of the extended family environment matrix (Extmat): now, if a non-matrix value is supplied, a unit matrix is automatically created so all members share the environment equally. [1] [2]

Refactoring and Code Simplification

  • Refactored the construction of variance component matrices and algebra terms to use specification lists and filtering, reducing code repetition and improving extensibility. [1] [2]
  • Updated documentation to use @inheritParams for better DRYness and clarity, and improved parameter descriptions. [1] [2] [3]

Usability Improvements

  • Added the extraTries parameter to allow users to control the number of optimization attempts in fitPedigreeModel. [1] [2] [3]
  • Exported new user-facing functions and added necessary imports for improved API coverage and functionality. [1] [2]

Bug Fixes

  • Fixed a bug in the GEDCOM reader that caused document records to be added to the last person in the pedigree.

Miscellaneous

  • Updated .Rbuildignore and DESCRIPTION for build and documentation improvements. [1] [2]
  • Updated the NEWS.md with a summary of these changes. [1] [2]

These changes collectively make the codebase more robust, efficient, and user-friendly, especially for large-scale pedigree analyses.


References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22]

smasongarrison and others added 22 commits April 13, 2026 16:08
commit 42ae819
Author: Mason Garrison <garrissm@wfu.edu>
Date:   Mon Apr 13 16:08:31 2026 -0400

    Update test-makeLinks.R
…-multiple-families

Add `simulatePedigrees()` for simulating multiple families in one call
Add importFrom(stats, setNames) to NAMESPACE and annotate initializeRecord with @importFrom to ensure stats::setNames is available. Substantially revise and clarify readGedcom R and man documentation (parameter descriptions, details, return value, and examples) to improve wording and add missing info about post-processing and attributes. Minor man page formatting tweak for collapseNames. Reformat test-makeLinkslegacy.R for argument alignment and expect_true wrapping; no functional logic changes aside from the import and doc edits.
Update documentation for pedigree modeling: add @inheritParams buildOneFamilyGroup to buildPedigreeMx roxygen docs; expand man/fitPedigreeModel.Rd to document additional relatedness matrices (Addmat, Nucmat, Extmat, Mtdmat, Amimat, Dmgmat) and note Extmat behavior; add S. Mason Garrison to package authors in man/BGmisc-package.Rd. These changes enhance parameter docs and authorship metadata.
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 23, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Add mtdna parameter to sliceFamilies (default TRUE) and allow .write_bin_data to accept mit_val = NULL to produce bin files that are not split by mitRel. Update sliceFamilies to call .write_bin_data with mit_val=NULL when mtdna is FALSE and add verbose messages. Adjust .write_bin_data to build file paths for mit_val present or NULL and only write when rows exist. Add tests to verify mitRel=0/1 and mit_val=NULL output files and their contents. Also micro-optimizations: replace repeated ifelse(u %in% v$i, ...) patterns in makeLinks with match-based indexing to avoid %in% overhead and NA issues, and speed up readGedcom's pattern counting by using vapply over file$X1 with fixed = TRUE. Update NEWS.md with a note about the optimized gedcom reader and sliceFamilies change.
Export new functions ped2addFocal and ped2focal in NAMESPACE, add their man pages, and expand tests. Documentation for both functions was generated (roxygen-style) and includes usage, arguments and details. Tests were updated to assert correct alignment of focal-relatedness columns with pedigree rows, add mitochondrial-component checks, handle shuffled pedigrees and inbreeding datasets, and improve value/range checks and labels.
smasongarrison and others added 4 commits May 24, 2026 13:09
Introduce generational-distance functionality: add getGenDist, ped2genDist, ped2genDistFocal and internal .pairDistFromAnc to compute pairwise/focal generational distances (methods: rank, path, mrca_min, mrca_max; mrca_all left unimplemented). Update ped2com/buildComponent to support a new "distance" component (ancestor distance matrix recording and return), and extend adjacency construction to include "distance". Add a ped2genFocal wrapper and make ped2focal more robust to different relatedness matrix types (matrix, sparse, list, vector). Update NAMESPACE exports, man pages, NEWS, and add comprehensive tests for the new APIs and adjacency-method consistency.
smasongarrison and others added 2 commits May 24, 2026 20:35
Replace the abbreviated "Countess of S." with the full "Countess of Strathmore and Kinghorne" for personID 146 (Cecilia Nina Cavendish-Bentin). Updated the raw CSV, the data-raw cleaning script to set attribute_title for personID 146, and the saved data file (royal92.rda) to reflect the change for consistency and clarity.
smasongarrison and others added 16 commits May 26, 2026 13:01
Correct numerous birth/death date errors and add date overrides. Updated data-raw/royal92.csv with corrected birth/death values (e.g. Alice Montagu‑Douglas‑Scott, Birgitte of Denmark, Angus Ogilvy, Katharine Worsley, Frances Burke Roche, and many historical figures) and expanded date_overrides in data-raw/df_royal92.R to capture corrected, uncertain, and living dates. Regenerated binary data/royal92.rda to reflect these fixes.
@smasongarrison smasongarrison merged commit a855d33 into main May 27, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants