pcairPartition
is used to partition a sample from a genetic study into an ancestry representative 'unrelated subset' and a 'related subset'. The 'unrelated subset' contains individuals who are all mutually unrelated to each other and representative of the ancestries of all individuals in the sample, and the 'related subset' contains individuals who are related to someone in the 'unrealted subset'.pcairPartition(kinMat, kin.thresh = 2^(-11/2), divMat = NULL, div.thresh = -2^(-11/2), unrel.set = NULL)
kin.thresh
and unrel.set
. IDs for each individual must be set as the row and column names of the matrix.kinMat
used for declaring each pair of individuals as related or unrelated. The default value is 0.025. See 'Details' for how this interacts with kinMat
.div.thresh
. IDs for each individual must be set as the row and column names of the matrix.divMat
used for deciding if each pair of individuals is ancestrally divergent. The default value is -0.025. See 'Details' for how this interacts with divMat
.kinMat
.kinMat
. Any pair of individuals with a pairwise kinship greater than kin.thresh
will be declared 'related.' Kinship coefficient estimates from the KING-robust software are typically used as measures of ancestry divergence in divMat
. Any pair of individuals with a pairwise divergence measure less than div.thresh
will be declared ancestrally 'divergent'. Typically, kin.thresh
and div.thresh
are set to be the amount of error around 0 expected in the estimate for a pair of truly unrelated individuals. If unrel.set = NULL
, the PC-AiR algorithm is used to find an 'optimal' partition (see 'References' for a paper describing the algorithm). If unrel.set
and kinMat
are both specified, then all individuals with IDs in unrel.set
are forced in the 'unrelated subset' and the PC-AiR algorithm is used to partition the rest of the sample; this is especially useful for including reference samples of known ancestry in the 'unrelated subset'.
pcair
which uses this function for finding principal components in the presence of related individuals.
king2mat
for creating a matrix of kinship coefficent estimates or pairwise ancestry divergence measures from KING output text files that can be used as kinMat
or divMat
.
# load saved matrix of KING-robust estimates
data("HapMap_ASW_MXL_KINGmat")
# partition the sample
part <- pcairPartition(kinMat = HapMap_ASW_MXL_KINGmat,
divMat = HapMap_ASW_MXL_KINGmat)
Run the code above in your browser using DataLab