Pedigree Reconstruction
Overview
Reconstruct pedigrees from genotype data, by optimising the likelihood over all possible pedigrees subject to given restrictions. Tailor-made plots facilitate evaluation of the output. This package is part of the 'pedsuite' ecosystem for pedigree analysis. In particular, it imports 'pedprobr' for calculating pedigree likelihoods and 'forrel' for estimating pairwise relatedness.
- **pedbuildr** now uses **mirai** for parallel likelihood computations in
reconstruct(), giving substantial speedups in many cases. Users can enable parallelisation by starting workers withmirai::daemons()before callingreconstruct(). See?reconstructfor details. - The
numCoresargument has been deprecated, as parallelisation is now controlled through the mirai framework. - More robust likelihood calculations. In particular, due to improved loop breaking in **pedtools** and **pedprobr**, many complex looped pedigrees that previously failed are now handled correctly.
buildPeds()is significantly faster than before in the default case withlinearInb = 0, i.e., when mating between lineally related individuals is disallowed.
From NEWS.md in the release
Install
Health
ERRORexamplesr-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-oldrel-windows-x86_64
r-oldrel-macos-arm64
Running examples in ‘pedbuildr-Ex.R’ failed The error most likely occurred in: > ### Name: buildPeds > ### Title: Build a list of pedigrees > ### Aliases: buildPeds > > ### ** Examples > > # Two individuals + 1 extra > plist = buildPeds(1:2, extra = 1, age = "1>2") Pedigree parameters: ID labels: 1, 2 Sex: 1, 1 Extra: 1 Age info: 1>2 Known PO: - Known non-PO: - No children: - Connected only: TRUE Symmetry filter: TRUE Max inbreeding: 0.0625 Linear inbreeding: FALSE Building pedigree list: All 2 + 0 extra: 1 solutions | 2 candidates (0.00019 secs) All 2 + 1 extra: 2 solutions | 2 candidates | 2 duplicates removed (0.00069 secs) Total solutions: 3 Converting to ped Excessive inbreeding: 0 Time used: 0.00222 secs > plot(plist) > > # Allow disconnected > plist2 = buildPeds(1:2, extra = 1, age = "1>2", connected = FALSE) Pedigree parameters: ID labels: 1, 2 Sex: 1, 1 Extra: 1 Age info: 1>2 Known PO: - Known non-PO: - No children: - C ...[truncated]... n non-PO: - No children: - Connected only: TRUE Symmetry filter: TRUE Max inbreeding: 1 Linear inbreeding: FALSE Building pedigree list: All 2 + 0 extra: 1 solutions | 2 candidates (0.000183 secs) All 2 + 1 extra: 2 solutions | 12 candidates | 11 duplicates removed (0.000993 secs) All 2 + 2 extra: 6 solutions | 6 candidates | 11 duplicates removed (0.00421 secs) Total solutions: 9 Converting to ped Time used: 0.00458 secs > plot(plist4) > > # Full sibs are also included when `extra = "parents"` > plist5 = buildPeds(1:2, extra = "parents", age = "1>2") Pedigree parameters: ID labels: 1, 2 Sex: 1, 1 Extra: parents Age info: 1>2 Known PO: - Known non-PO: - No children: - Connected only: TRUE Symmetry filter: TRUE Max inbreeding: 0.0625 Linear inbreeding: FALSE Building pedigree list: Error in allPOchar %notin% c(knownPOchar, notPOchar) : could not find function "%notin%" Calls: buildPeds -> buildPedsParents -> listPOsets Execution halted
r-oldrel-macos-x86_64
Running examples in ‘pedbuildr-Ex.R’ failed The error most likely occurred in: > ### Name: buildPeds > ### Title: Build a list of pedigrees > ### Aliases: buildPeds > > ### ** Examples > > # Two individuals + 1 extra > plist = buildPeds(1:2, extra = 1, age = "1>2") Pedigree parameters: ID labels: 1, 2 Sex: 1, 1 Extra: 1 Age info: 1>2 Known PO: - Known non-PO: - No children: - Connected only: TRUE Symmetry filter: TRUE Max inbreeding: 0.0625 Linear inbreeding: FALSE Building pedigree list: All 2 + 0 extra: 1 solutions | 2 candidates (0.000531 secs) All 2 + 1 extra: 2 solutions | 2 candidates | 2 duplicates removed (0.00214 secs) Total solutions: 3 Converting to ped Excessive inbreeding: 0 Time used: 0.00614 secs > plot(plist) > > # Allow disconnected > plist2 = buildPeds(1:2, extra = 1, age = "1>2", connected = FALSE) Pedigree parameters: ID labels: 1, 2 Sex: 1, 1 Extra: 1 Age info: 1>2 Known PO: - Known non-PO: - No children: - ...[truncated]... Known non-PO: - No children: - Connected only: TRUE Symmetry filter: TRUE Max inbreeding: 1 Linear inbreeding: FALSE Building pedigree list: All 2 + 0 extra: 1 solutions | 2 candidates (0.000558 secs) All 2 + 1 extra: 2 solutions | 12 candidates | 11 duplicates removed (0.0034 secs) All 2 + 2 extra: 6 solutions | 6 candidates | 11 duplicates removed (0.0427 secs) Total solutions: 9 Converting to ped Time used: 0.0438 secs > plot(plist4) > > # Full sibs are also included when `extra = "parents"` > plist5 = buildPeds(1:2, extra = "parents", age = "1>2") Pedigree parameters: ID labels: 1, 2 Sex: 1, 1 Extra: parents Age info: 1>2 Known PO: - Known non-PO: - No children: - Connected only: TRUE Symmetry filter: TRUE Max inbreeding: 0.0625 Linear inbreeding: FALSE Building pedigree list: Error in allPOchar %notin% c(knownPOchar, notPOchar) : could not find function "%notin%" Calls: buildPeds -> buildPedsParents -> listPOsets Execution halted
r-oldrel-windows-x86_64
Running examples in 'pedbuildr-Ex.R' failed The error most likely occurred in: > ### Name: buildPeds > ### Title: Build a list of pedigrees > ### Aliases: buildPeds > > ### ** Examples > > # Two individuals + 1 extra > plist = buildPeds(1:2, extra = 1, age = "1>2") Pedigree parameters: ID labels: 1, 2 Sex: 1, 1 Extra: 1 Age info: 1>2 Known PO: - Known non-PO: - No children: - Connected only: TRUE Symmetry filter: TRUE Max inbreeding: 0.0625 Linear inbreeding: FALSE Building pedigree list: All 2 + 0 extra: 1 solutions | 2 candidates (0.000887 secs) All 2 + 1 extra: 2 solutions | 2 candidates | 2 duplicates removed (0.00376 secs) Total solutions: 3 Converting to ped Excessive inbreeding: 0 Time used: 0.0102 secs > plot(plist) > > # Allow disconnected > plist2 = buildPeds(1:2, extra = 1, age = "1>2", connected = FALSE) Pedigree parameters: ID labels: 1, 2 Sex: 1, 1 Extra: 1 Age info: 1>2 Known PO: - Known non-PO: - No children: - C ...[truncated]... nown non-PO: - No children: - Connected only: TRUE Symmetry filter: TRUE Max inbreeding: 1 Linear inbreeding: FALSE Building pedigree list: All 2 + 0 extra: 1 solutions | 2 candidates (0.000571 secs) All 2 + 1 extra: 2 solutions | 12 candidates | 11 duplicates removed (0.00547 secs) All 2 + 2 extra: 6 solutions | 6 candidates | 11 duplicates removed (0.0287 secs) Total solutions: 9 Converting to ped Time used: 0.0307 secs > plot(plist4) > > # Full sibs are also included when `extra = "parents"` > plist5 = buildPeds(1:2, extra = "parents", age = "1>2") Pedigree parameters: ID labels: 1, 2 Sex: 1, 1 Extra: parents Age info: 1>2 Known PO: - Known non-PO: - No children: - Connected only: TRUE Symmetry filter: TRUE Max inbreeding: 0.0625 Linear inbreeding: FALSE Building pedigree list: Error in allPOchar %notin% c(knownPOchar, notPOchar) : could not find function "%notin%" Calls: buildPeds -> buildPedsParents -> listPOsets Execution halted
ERRORtestsr-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-oldrel-windows-x86_64
r-oldrel-macos-arm64
Running ‘testthat.R’ [1s/1s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(pedbuildr)
Loading required package: pedtools
>
> test_check("pedbuildr")
Saving _problems/test-buildPeds-9.R
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 10 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-buildPeds.R:8:3'): buildPeds cathces errors ──────────────────
`bp(1:3, sex = 1:3, verb = F)` threw an error with unexpected message.
Expected match: "Illegal elements found in `sex`"
Actual message: "could not find function \"%notin%\""
Backtrace:
▆
1. ├─testthat::expect_error(bp(1:3, sex = 1:3, verb = F), "Illegal elements found in `sex`") at test-buildPeds.R:8:3
2. │ └─testthat:::quasi_capture(...)
3. │ ├─testthat (local) .capture(...)
4. │ │ └─base::withCallingHandlers(...)
5. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
6. └─pedbuildr (local)
...[truncated]...
──────
Error in `allPOchar %notin% c(knownPOchar, notPOchar)`: could not find function "%notin%"
Backtrace:
▆
1. ├─testthat::expect_output(bp(1:3, age = c(1, 1, 1)), "Age info: -") at test-buildPeds.R:17:3
2. │ └─testthat:::quasi_capture(...)
3. │ ├─testthat (local) .capture(...)
4. │ │ └─testthat::capture_output_lines(code, print, width = width)
5. │ │ └─testthat:::eval_with_output(code, print = print, width = width)
6. │ │ ├─withr::with_output_sink(path, withVisible(code))
7. │ │ │ └─base::force(code)
8. │ │ └─base::withVisible(code)
9. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
10. └─pedbuildr (local) bp(1:3, age = c(1, 1, 1))
11. └─pedbuildr::buildPeds(ids, sex, verbose = verb, ...) at test-buildPeds.R:2:3
12. └─pedbuildr:::buildPedsParents(...)
13. └─pedbuildr:::listPOsets(...)
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 10 ]
Error:
! Test failures.
Execution haltedr-oldrel-macos-x86_64
Running ‘testthat.R’ [2s/5s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(pedbuildr)
Loading required package: pedtools
>
> test_check("pedbuildr")
Saving _problems/test-buildPeds-9.R
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 10 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-buildPeds.R:8:3'): buildPeds cathces errors ──────────────────
`bp(1:3, sex = 1:3, verb = F)` threw an error with unexpected message.
Expected match: "Illegal elements found in `sex`"
Actual message: "could not find function \"%notin%\""
Backtrace:
▆
1. ├─testthat::expect_error(bp(1:3, sex = 1:3, verb = F), "Illegal elements found in `sex`") at test-buildPeds.R:8:3
2. │ └─testthat:::quasi_capture(...)
3. │ ├─testthat (local) .capture(...)
4. │ │ └─base::withCallingHandlers(...)
5. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
6. └─pedbuildr (local)
...[truncated]...
──────
Error in `allPOchar %notin% c(knownPOchar, notPOchar)`: could not find function "%notin%"
Backtrace:
▆
1. ├─testthat::expect_output(bp(1:3, age = c(1, 1, 1)), "Age info: -") at test-buildPeds.R:17:3
2. │ └─testthat:::quasi_capture(...)
3. │ ├─testthat (local) .capture(...)
4. │ │ └─testthat::capture_output_lines(code, print, width = width)
5. │ │ └─testthat:::eval_with_output(code, print = print, width = width)
6. │ │ ├─withr::with_output_sink(path, withVisible(code))
7. │ │ │ └─base::force(code)
8. │ │ └─base::withVisible(code)
9. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
10. └─pedbuildr (local) bp(1:3, age = c(1, 1, 1))
11. └─pedbuildr::buildPeds(ids, sex, verbose = verb, ...) at test-buildPeds.R:2:3
12. └─pedbuildr:::buildPedsParents(...)
13. └─pedbuildr:::listPOsets(...)
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 10 ]
Error:
! Test failures.
Execution haltedr-oldrel-windows-x86_64
Running 'testthat.R' [4s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> library(testthat)
> library(pedbuildr)
Loading required package: pedtools
>
> test_check("pedbuildr")
Saving _problems/test-buildPeds-9.R
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 10 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-buildPeds.R:8:3'): buildPeds cathces errors ──────────────────
`bp(1:3, sex = 1:3, verb = F)` threw an error with unexpected message.
Expected match: "Illegal elements found in `sex`"
Actual message: "could not find function \"%notin%\""
Backtrace:
▆
1. ├─testthat::expect_error(bp(1:3, sex = 1:3, verb = F), "Illegal elements found in `sex`") at test-buildPeds.R:8:3
2. │ └─testthat:::quasi_capture(...)
3. │ ├─testthat (local) .capture(...)
4. │ │ └─base::withCallingHandlers(...)
5. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
6. └─pedbuildr (local) bp
...[truncated]...
──────
Error in `allPOchar %notin% c(knownPOchar, notPOchar)`: could not find function "%notin%"
Backtrace:
▆
1. ├─testthat::expect_output(bp(1:3, age = c(1, 1, 1)), "Age info: -") at test-buildPeds.R:17:3
2. │ └─testthat:::quasi_capture(...)
3. │ ├─testthat (local) .capture(...)
4. │ │ └─testthat::capture_output_lines(code, print, width = width)
5. │ │ └─testthat:::eval_with_output(code, print = print, width = width)
6. │ │ ├─withr::with_output_sink(path, withVisible(code))
7. │ │ │ └─base::force(code)
8. │ │ └─base::withVisible(code)
9. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
10. └─pedbuildr (local) bp(1:3, age = c(1, 1, 1))
11. └─pedbuildr::buildPeds(ids, sex, verbose = verb, ...) at test-buildPeds.R:2:3
12. └─pedbuildr:::buildPedsParents(...)
13. └─pedbuildr:::listPOsets(...)
[ FAIL 2 | WARN 0 | SKIP 0 | PASS 10 ]
Error:
! Test failures.
Execution haltedNOTER code for possible problemsr-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-oldrel-windows-x86_64
r-oldrel-macos-arm64, r-oldrel-macos-x86_64
listPOsets: no visible global function definition for ‘%notin%’ Undefined global functions or variables: %notin%
r-oldrel-windows-x86_64
listPOsets: no visible global function definition for '%notin%' Undefined global functions or variables: %notin%
- ERROR10 OK, 3 ERRORNow
- ERROR11 OK, 2 ERROR2026-06-26
- OK14 OK2026-03-10
Documentation
- Help pages
- 5 (1 internal)includes a package overview page
- Examples that run
- 100%4 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 0
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Releases over time
4 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/magnusdv/pedbuildr on 2026-10-21.
Dependencies
Installing pedbuildr adds 18 packages (7 with compiled code, 4.1 MB of source tarballs). Heaviest: nanonext 911 KB, kinship2 484 KB, knitr 479 KB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 0.4.0Latest
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 0.3.02023-08-22 · diff ↗
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 0.2.12021-03-16
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2021-03-16
- Total releases
- 3 / 5 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 4.2.0
- Bundled data
- 1.1 KB / 2 files
- Download size
- 159 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("pedbuildr")The package provides a citation file, so citation() returns the authors' own entry.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.