| .ibdCluster | R Documentation |
Internal helper that applies a sliding-window clustering procedure across a
genotype matrix. For each window of markers, individuals are grouped using
an opposing-homozygote style criterion (controlled by maxOH) via a
native C++ routine.
.ibdCluster(genotype, cpus, windowsSize, maxOH)
genotype |
A numeric matrix of genotypes with individuals in rows and markers/SNPs in columns. This function treats genotype code '1' (heterozygote) as missing by converting it to '9' prior to calling the native routine. |
cpus |
Integer scalar. Requested number of CPU threads. The underlying C++ implementation uses OpenMP; the actual number of threads may depend on how R and your compiler toolchain were built and configured. |
windowsSize |
Integer scalar giving the window size (in markers). Must
be between 1 and |
maxOH |
Integer scalar. Maximum allowed opposing-homozygote count (or a similar mismatch threshold) used by the native grouping algorithm within each window. |
This function is a thin R wrapper around the native routine
ibdCluster implemented in C++ and called via .Call().
The function scans windows of consecutive markers. For each window starting
at marker i, it clusters individuals based on the submatrix
genotype[, i:(i+windowsSize-1)] after recoding heterozygotes ('1') to
missing ('9'). Computation is parallelized in C++ using OpenMP across window
start positions.
A list (R "list" object) of length ncol(genotype) - (windowsSize - 1).
Each element corresponds to one sliding window position and contains an
integer vector of group assignments produced by the native implementation.
(Exact encoding of groups is defined by the underlying mhMat grouping
routine.)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.