Dev main#151
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/R-Computing-Lab/BGmisc/sessions/9367c84a-deb8-4f13-a855-367a204cc843 Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
…ions Agent-Logs-Url: https://github.com/R-Computing-Lab/BGmisc/sessions/9367c84a-deb8-4f13-a855-367a204cc843 Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/R-Computing-Lab/BGmisc/sessions/9367c84a-deb8-4f13-a855-367a204cc843 Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/R-Computing-Lab/BGmisc/sessions/44f2511b-4beb-420a-924c-bd42c5f1de1f Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
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.
Up to standards ✅🟢 Issues
|
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.
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.
remove non-ASCII
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.
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.
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.
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
simulatePedigrees()function to easily simulate multiple families at once and return them as a single combined data frame. [1] [2]condenseMatrixSlotsfunction and a correspondingcondenseMatrixSlotsparameter 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]lboundparameter to variance component constructors to ensure positive variance components during optimization, with a default lower bound of 1e-10. [1] [2]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
@inheritParamsfor better DRYness and clarity, and improved parameter descriptions. [1] [2] [3]Usability Improvements
extraTriesparameter to allow users to control the number of optimization attempts infitPedigreeModel. [1] [2] [3]Bug Fixes
Miscellaneous
.RbuildignoreandDESCRIPTIONfor build and documentation improvements. [1] [2]NEWS.mdwith 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]