Skip to content

Combine pedigrees with genotype relatedness

Ordinary association regression treats its residual observations as independent. A parent and child do not satisfy that assumption merely because their sample identifiers differ. The teaching analysis therefore selects a set that passes both the recorded pedigree rule and the declared genotype relatedness rule.

KING estimates come from one eligible SNP per 100-kb autosomal window. Within each window, the workflow chooses the lowest coordinate, then reference and alternate alleles in lexical order. This selection precedes phenotype creation and never uses an association result.

The conflict graph contains each pair with KING kinship above 0.0884 and each documented first-degree or second-degree relationship. The pedigree calculation includes shared parent identifiers even when that parent has no genotype row. An absent parent code of 0 does not connect two families.

Pedigree kinship uses the standard parental recursion with unrecorded founders treated as unrelated. The primary record preserves its assumptions and the relationships the available table establishes. Missing family metadata cannot prove that two people are unrelated.

PLINK’s KING documentation explains that the estimator does not use pedigree records and can underestimate kinship when parents come from different populations. A low KING value therefore does not cancel a documented close relationship. The workflow records discordant pairs and requires a source-bound review before it creates the simulated traits.

Each step removes the person with the most remaining conflict edges. Ties use higher sample missingness, then the lexically larger sample identifier. The code below independently reproduces that rule from the complete accepted conflict table and compares every exclusion with the primary run.

The rule produces a reproducible conflict-free set. It does not claim the largest possible set, and it does not select people to improve a phenotype association.

The genotype data come from Byrska-Bishop and colleagues and NYGC. The collection acknowledgment credits Coriell samples and NHGRI grants 3UM1HG008901-03S1 and 3UM1HG008901-04S2. This lesson calculates its own teaching summaries from the declared source selection.

source("/shared/population_utils.R")
accepted <- ReadAnalysis()
samples <- ReadSamples()
conflicts <- ReadTable("relatedness_conflicts.tsv")
missing <- ReadTable("complete_sample_missingness.tsv")
expected <- ReadTable("excluded_samples.tsv")
keep <- MarkerIds("unrelated.keep")
stopifnot(identical(samples$IID, missing$IID))
invisible(Sys.setlocale("LC_COLLATE", "C"))
neighbors <- rep(list(integer()), nrow(samples))
for (index in seq_len(nrow(conflicts))) {
left <- match(conflicts$IID1[index], samples$IID)
right <- match(conflicts$IID2[index], samples$IID)
stopifnot(!is.na(left), !is.na(right))
neighbors[[left]] <- c(neighbors[[left]], right)
neighbors[[right]] <- c(neighbors[[right]], left)
}
degree <- lengths(neighbors)
retained <- rep(TRUE, nrow(samples))
excluded <- data.frame(IID = character(), remaining_degree = integer(),
missing_fraction = numeric(),
remaining_neighbors = character())
while (any(degree > 0)) {
candidates <- which(retained & degree > 0)
ranking <- order(degree[candidates], missing$F_MISS[candidates],
samples$IID[candidates], decreasing = TRUE)
removed <- candidates[ranking[1]]
adjacent <- neighbors[[removed]][retained[neighbors[[removed]]]]
record <- data.frame(
IID = samples$IID[removed], remaining_degree = degree[removed],
missing_fraction = missing$F_MISS[removed],
remaining_neighbors = paste(sort(samples$IID[adjacent]), collapse = ",")
)
excluded <- rbind(excluded, record)
retained[removed] <- FALSE
degree[adjacent] <- degree[adjacent] - 1L
degree[removed] <- 0L
}
stopifnot(identical(samples$IID[retained], keep))
stopifnot(identical(excluded$IID, expected$IID))
stopifnot(identical(excluded$remaining_neighbors, expected$remaining_neighbors))
stopifnot(all(excluded$remaining_degree == expected$remaining_degree))
stopifnot(!any(conflicts$IID1 %in% keep & conflicts$IID2 %in% keep))
dir.create("outputs", showWarnings = FALSE)
write.table(excluded, "outputs/exclusions_r.tsv", sep = "\t",
row.names = FALSE, quote = FALSE)
known <- conflicts$pedigree_kinship > 0.0884
png("outputs/relatedness_r.png", width = 1100, height = 760, res = 130)
plot(conflicts$pedigree_kinship, conflicts$king_kinship,
col = ifelse(known, "#167c80", "#969ca3"), pch = 16, cex = 0.65,
xlab = "Kinship implied by the available pedigree",
ylab = "KING estimate on the preliminary sparse panel",
main = "Every accepted conflict pair before sample exclusions")
abline(h = 0.0884, lty = 2, col = "#9e4f22")
legend("right", c("Documented close relationship", "KING conflict only"),
col = c("#167c80", "#969ca3"), pch = 16, bty = "n")
invisible(dev.off())
discordant <- sum(known & conflicts$king_kinship <= 0.0884)
metrics <- list(input_samples = nrow(samples),
retained_samples = sum(retained),
excluded_samples = nrow(excluded),
conflict_pairs = nrow(conflicts),
discordant_pairs = discordant, retained_conflicts = 0)
WriteMetrics(metrics)
cat(sprintf("The rule retains %d of %d people.\n",
sum(retained), nrow(samples)))
cat(sprintf("It excludes %d people from %d conflict pairs.\n",
nrow(excluded), nrow(conflicts)))
cat(sprintf("The review records %d pedigree pairs below the KING cutoff.\n",
discordant))
cat("No retained pair violates either declared relatedness rule.\n")
The rule retains 2574 of 3202 people.
It excludes 628 people from 1267 conflict pairs.
The review records 0 pedigree pairs below the KING cutoff.
No retained pair violates either declared relatedness rule.

The R figure compares every conflict pair’s KING estimate with its pedigree expectation.

Zero on the pedigree axis means that the supplied family records do not establish a close relationship. It does not prove biological unrelatedness. Every plotted pair contributes a conflict before sample selection.

The primary workflow checks the retained genotypes again with PLINK’s KING cutoff calculation, which avoids relying only on rounded text estimates. It also checks every documented close pedigree pair against the retained list.

The final working PSAM clears parental fields only after these exclusions, so LD and PCA use all retained people. The original pedigree remains unchanged in the source fixture. Frequency reports explicitly include nonfounders before that working-file change.

  • PLINK KING relatedness

    The manual defines kinship scaling and notes that pedigree records are ignored. Its warning about parents from different populations explains why a low estimate cannot cancel documented relatives.

  • Byrska-Bishop and colleagues, expanded 1000 Genomes cohort

    The study explains the family structure in this high-coverage cohort. Those documented relationships remain relevant when a teaching analysis selects independent observations.