Converts a SNPDataLong object to a data.frame, runs PCA, and performs anticlustering grouping.

runAnticlusteringPCA(object, K = 2, n_pcs = 20, center = TRUE, scale = TRUE)

Arguments

object

An object of class SNPDataLong.

K

Number of groups for anticlustering.

n_pcs

Number of top principal components to use (default: 20).

center

Logical or numeric. Center columns before PCA (default: TRUE).

scale

Logical or numeric. Scale columns before PCA (default: TRUE).

Value

A list with: - groups: vector with group assignments. - pca: the PCA result object (prcomp). - pcs: matrix of top PCs used in anticlustering.

Examples

if (FALSE) { # \dontrun{
res <- runAnticlusteringPCA(nelore_imputed, K = 2, n_pcs = 20)
table(res$groups)
} # }