Iterative greedy algorithm that removes related individuals exceeding a
kinship threshold. First reduces large connected components via graph-based
pruning (removing highest-degree nodes), then applies
plinkQC::relatednessFilter iteratively until no related pairs remain.
Usage
filterRelatedness(
relatedness,
relatednessThreshold = 0.0625,
analysisType = c("maximizeUnrelated", "maximizeCases"),
columns = RelatednessColumnsParam(),
phenoData = NULL,
phenoCol = "pheno",
pruning = RelatednessPruningParam(),
plinkQcArgs = PlinkQcOptions(),
verbose = FALSE
)Arguments
A data.frame of pairwise relatedness estimates (e.g. KING .kin0 output). Must contain columns for IID1, IID2, and relatedness value.
Kinship threshold above which individuals are considered related (default 0.0625, i.e. 2nd degree).
- analysisType
One of
"maximizeUnrelated"(default) or"maximizeCases". The latter preserves cases in case-control studies.- columns
Which columns of
relatednesshold the pair identifiers and the relatedness measure. Build withRelatednessColumnsParam.- phenoData
A data.frame with columns
IIDand the column named byphenoCol. Required whenanalysisType = "maximizeCases".- phenoCol
Column name for the phenotype (default "pheno"). Expected to be binary (1 = case, 0 = control).
- pruning
Bounds on the graph pre-pruning and the iterative cleanup. Build with
RelatednessPruningParam.- plinkQcArgs
Additional arguments forwarded to
plinkQC::relatednessFilter. Build withPlinkQcOptions.- verbose
Logical, print progress messages (default FALSE).
Examples
rel <- data.frame(IID1 = c("s1", "s2"), IID2 = c("s2", "s3"),
value = c(0.5, 0.1))
filterRelatedness(rel, relatednessThreshold = 0.2,
columns = RelatednessColumnsParam(value = "value"))
#> Registered S3 method overwritten by 'igraph':
#> method from
#> plot.sir AMR
#> [1] "s1"