Skip to content

Conversation

@smasongarrison
Copy link
Member

This pull request addresses an issue with the ped2fam function's handling of character or factor ID variables, which previously could lead to warnings or incorrect behavior when converting IDs to numeric. The update ensures more robust handling and user notification in such cases.

Bug fix and improved error handling:

  • Improved the ped2fam function in R/segmentPedigree.R to detect and warn the user if converting character or factor IDs to numeric results in all IDs becoming NA, helping to prevent silent data issues.
  • Added a corresponding entry in NEWS.md to document the fix for handling character ID variables in ped2fam.

Resolved a warning in ped2fam when handling character ID variables by conditionally converting IDs to numeric only when appropriate. Updated NEWS.md to document this fix.
@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.45%. Comparing base (65d4569) to head (fc988b9).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
R/checkParents.R 68.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #105      +/-   ##
==========================================
- Coverage   84.58%   84.45%   -0.13%     
==========================================
  Files          25       25              
  Lines        3930     3957      +27     
==========================================
+ Hits         3324     3342      +18     
- Misses        606      615       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Refactored ped2fam to better handle cases where IDs are character or factor variables, avoiding coercion to NA and providing clearer warnings. Added comprehensive tests to verify correct behavior with both numeric and string IDs.
Phantom parents created during pedigree repair now inherit famID where available. Updated addParentRow to accept famID, adjusted logic in checkParentIDs and addRowlessParents to assign famID, and expanded tests to verify famID handling for phantom parents.
@smasongarrison smasongarrison merged commit 2e38d01 into main Dec 24, 2025
20 of 22 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