IPCAPS2
is an unsupervised clustering algorithm based on iterative
pruning to capture population structure. This version supports ordinal
data which can be applied directly to SNP data to identify fine-level
population structure and it is built on the iterative pruning Principal
Component Analysis (ipPCA) algorithm by Intarapanich et al. (2009)
\<doi: 10.1186/1471-2105-10-382> and Limpiti et al. (2011)\<doi:
10.1186/1471-2105-12-255>. The IPCAPS2 involves an iterative process
using multiple splits based on multivariate Gaussian mixture modeling of
principal components and Clustering EM estimation as in Lebret et
al. (2015) \<doi: 10.18637/jss.v067.i06>. In each iteration, rough
clusters and outliers are also identified using the function
rubikclust()
from the R package KRIS
.
You can install the released version of IPCAPS2 from CRAN with:
install.packages("IPCAPS2")
Alternatively, you can install the dev version of IPCAPS2 from Github with
install.packages("remotes")
remotes::install_github("kridsadakorn/ipcaps2", dependencies = TRUE)
You can see the reference manual from: https://www.biostatgen.org/ipcaps/
This is a basic example which shows you how to use the packages:
library(IPCAPS2)
BED.file <- system.file("extdata", "ipcaps_example.bed", package = "IPCAPS2")
LABEL.file <- system.file("extdata", "ipcaps_example_individuals.txt.gz",
package = "IPCAPS2")
my.cluster1 <- ipcaps2(bed = BED.file, label.file = LABEL.file, lab.col = 2,
out = tempdir(), silence = TRUE)
The function ipcaps
does unsupervised clusering, and here is the
result:
table(my.cluster1$cluster$label, my.cluster1$cluster$group)
#>
#> 1 2 3 4 5
#> outlier3 1 1 1 0 0
#> pop1 0 0 0 50 0
#> pop2 0 0 0 0 50
The output directory will be indicated in the console or in
my.cluster1$output.dir
. All result files are saved at:You can naviage
to check the html
visualizations in the output directory.
print(my.cluster1$output.dir)
#> [1] "/var/folders/sp/hhmj9xvx53z4g4dktf5f503r0000gp/T//RtmprvfefM/cluster_output"
list.files(my.cluster1$output.dir)
#> [1] "groups.txt" "images"
#> [3] "RData" "tree_scatter_cluster.html"
#> [5] "tree_scatter_label.html" "tree_scree.html"
#> [7] "tree_text.html"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.