| check_ped | R Documentation |
Reads a 3-column pedigree file (id, male_parent, female_parent) and performs quality checks, optionally correcting detected errors. Exact duplicates and missing parents are always corrected. Conflicting trios and inconsistent sex roles are corrected when their respective arguments are TRUE. Cycles are reported only and must be resolved manually.
check_ped(
ped.file,
seed = NULL,
verbose = TRUE,
correct_conflicting_trios = TRUE,
correct_inconsistent_sex_roles = TRUE
)
ped.file |
Path to the pedigree text file (TSV/CSV/TXT), OR a data.frame / data.table with columns: id, male_parent, female_parent. |
seed |
Optional integer seed for reproducibility. Pass NULL (default) to skip setting a seed. |
verbose |
Logical. If TRUE (default), prints the report to the console. |
correct_conflicting_trios |
Logical. If TRUE (default), sets conflicting male_parent and female_parent to 0 and collapses to one row per ID. |
correct_inconsistent_sex_roles |
Logical. If TRUE (default), sets male_parent and female_parent to 0 for rows involving IDs found as both, then removes any resulting exact duplicates. |
An invisible named list of data frames:
Exact duplicate rows found in the input.
IDs with conflicting male_parent or female_parent assignments.
Rows where a conflicting ID appears as male_parent or female_parent.
Parent IDs absent from id, added as founders.
Cycles detected in the pedigree. Must be resolved manually.
Corrected pedigree table.
Josue Chinchilla-Vargas
# Self-contained example using a data.frame
ped_df <- data.frame(
id = c("A", "B", "C", "C", "D"),
male_parent = c("0", "0", "A", "A", "B"),
female_parent = c("0", "0", "B", "B", "C"),
stringsAsFactors = FALSE
)
ped_errors <- check_ped(ped.file = ped_df, seed = 101919, verbose = FALSE)
names(ped_errors)
head(ped_errors$corrected_pedigree)
library(data.table)
ped_dt <- data.table(id = c("A", "B", "C"),
male_parent = c("0", "0", "A"),
female_parent = c("0", "0", "B"))
ped_errors <- check_ped(ped.file = ped_dt, verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.