{"id":32199419,"url":"https://github.com/darkeyes/ipadmixture","last_synced_at":"2025-10-22T03:15:33.993Z","repository":{"id":56936430,"uuid":"243974372","full_name":"DarkEyes/ipADMIXTURE","owner":"DarkEyes","description":"A data clustering package based on admixture ratios (Q matrix) of population structure analysis. ","archived":false,"fork":false,"pushed_at":"2025-05-07T09:27:23.000Z","size":2796,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-12T14:55:04.214Z","etag":null,"topics":["admixture","bioinformatics","data-clustering-algorithm","population-stratification","population-structure","r"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DarkEyes.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-02-29T13:32:42.000Z","updated_at":"2025-05-07T09:27:27.000Z","dependencies_parsed_at":"2025-09-08T15:52:01.525Z","dependency_job_id":null,"html_url":"https://github.com/DarkEyes/ipADMIXTURE","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DarkEyes/ipADMIXTURE","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkEyes%2FipADMIXTURE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkEyes%2FipADMIXTURE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkEyes%2FipADMIXTURE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkEyes%2FipADMIXTURE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DarkEyes","download_url":"https://codeload.github.com/DarkEyes/ipADMIXTURE/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkEyes%2FipADMIXTURE/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280371890,"owners_count":26319523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admixture","bioinformatics","data-clustering-algorithm","population-stratification","population-structure","r"],"created_at":"2025-10-22T03:15:31.875Z","updated_at":"2025-10-22T03:15:33.985Z","avatar_url":"https://github.com/DarkEyes.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"ipADMIXTURE: Iterative Pruning Population Admixture Inference Framework\n==========================================================\n[![minimal R version](https://img.shields.io/badge/R%3E%3D-3.5.0-6666ff.svg)](https://cran.r-project.org/)\n[![CRAN Status Badge](https://www.r-pkg.org/badges/version-last-release/ipADMIXTURE)](https://cran.r-project.org/package=ipADMIXTURE)\n[![Download](https://cranlogs.r-pkg.org/badges/grand-total/ipADMIXTURE)](https://cran.r-project.org/package=ipADMIXTURE)\n[![bioRxiv](https://img.shields.io/badge/bioRxiv-2020.03.21.001206-B31B1B)](https://doi.org/10.1101/2020.03.21.001206)\n[![License](https://img.shields.io/badge/License-GPL%203-orange.svg)](https://spdx.org/licenses/GPL-3.0-only.html)\n\n A data clustering package based on admixture ratios (Q matrix) of population structure.\n \n The framework is based on iterative Pruning procedure that performs data clustering by splitting a given population into subclusters until meeting the condition of stopping criteria the same as ipPCA, iNJclust, and IPCAPS frameworks. \n \nThe package also provides a function to retrieve phylogeny tree that construct a neighbor-joining tree based on a similar matrix between clusters. \n\nBy given multiple Q matrices with varying a number of ancestors (K), the framework define a similar value between clusters i,j as a minimum number K* that makes majority of members of two clusters are in the different clusters. This K* reflexes a minimum number of ancestors we need to splitting cluster i,j into different clusters if we assign K* clusters based on maximum admixture ratio of individuals.\n \n\nInstallation\n------------\nYou can install our package from CRAN.\n\n```r\ninstall.packages(\"ipADMIXTURE\")\n```\n\nFor the newest version on github, please call the following command in R terminal.\n\n``` r\nremotes::install_github(\"DarkEyes/ipADMIXTURE\")\n```\nThis requires a user to install the \"remotes\" package before installing ipADMIXTURE.\n\nEXAMPLE\n----------------------------------------------------------------------------------\n\nIn this example, we have data set of human 27 population data published by Xing, J., et al. (2009). The dataset consists of 544 individuals from 27 populations. The Q matrices from this data are provided in this package. The following steps are the simple way to use our package.\n\n\nStep1: running the  ipADMIXTURE using Human 27 population dataset where the number of ancestors K =12. \n```{r}\nlibrary(ipADMIXTURE)\n# # running area: ipADMIXTURE::human27pop_Qmat[[i]] is a Q matrix with K=i+1\nh27pop_obj\u003c-ipADMIXTURE(Qmat=ipADMIXTURE::human27pop_Qmat[[11]], admixRatioThs =0.15)\n```\n\nStep2: printing all cluster information in text mode.\n```{r}\nipADMIXTURE::printClustersFromLabels(h27pop_obj,human27pop_labels)\n```\n\nThen, the text looks like this\n```{r}\n[1] \"Overall labels\"\n[1] \"===============\"\n[1] \"Alur(10)Hema(15)Pygmy(25)Brahmin(25)Utah_N._European(25)Cambodian(5)Chinese(10)Tamil_LC(13)Irula(24)JPN2(13)Madiga(10)Mala(11)CEU(60)YRI(60)CHB(45)JPT(45)Luhya(24)Tuscan(25)Kung(13)Pedi(10)Sotho/Tswana(8)Stalskoe(5)Iban(25)TBrahmin(14)Urkarah(18)VN(7)Nguni(9)\"\n[1] \"===============\"\n[1] \"ID1, md0.05, N25\"\n[1] \"Pygmy(25/25)\"\n[1] \"===============\"\n[1] \"ID2, md0.13, N56\"\n[1] \"JPN2(12/13)JPT(44/45)\"\n[1] \"===============\"\n[1] \"ID3, md0.00, N12\"\n[1] \"Kung(12/13)\"\n[1] \"===============\"\n[1] \"ID4, md0.00, N25\"\n[1] \"Iban(25/25)\"\n[1] \"===============\"\n[1] \"ID5, md0.00, N69\"\n[1] \"Cambodian(5/5)Chinese(10/10)JPN2(1/13)CHB(45/45)JPT(1/45)VN(7/7)\"\n[1] \"===============\"\n[1] \"ID6, md0.06, N25\"\n[1] \"Utah_N._European(1/25)Tuscan(24/25)\"\n[1] \"===============\"\n[1] \"ID7, md0.09, N85\"\n[1] \"Utah_N._European(24/25)CEU(60/60)Tuscan(1/25)\"\n[1] \"===============\"\n[1] \"ID8, md0.00, N17\"\n[1] \"Urkarah(17/18)\"\n[1] \"===============\"\n[1] \"ID9, md0.00, N6\"\n[1] \"Stalskoe(5/5)Urkarah(1/18)\"\n[1] \"===============\"\n[1] \"ID10, md0.00, N4\"\n[1] \"Irula(4/24)\"\n[1] \"===============\"\n[1] \"ID11, md0.00, N10\"\n[1] \"Irula(10/24)\"\n[1] \"===============\"\n[1] \"ID12, md0.00, N9\"\n[1] \"Irula(9/24)\"\n[1] \"===============\"\n[1] \"ID13, md0.00, N33\"\n[1] \"Tamil_LC(13/13)Madiga(9/10)Mala(11/11)\"\n[1] \"===============\"\n[1] \"ID14, md0.08, N41\"\n[1] \"Brahmin(25/25)Irula(1/24)Madiga(1/10)TBrahmin(14/14)\"\n[1] \"===============\"\n[1] \"ID15, md0.00, N4\"\n[1] \"Pedi(2/10)Sotho/Tswana(2/8)\"\n[1] \"===============\"\n[1] \"ID16, md0.00, N20\"\n[1] \"Pedi(5/10)Sotho/Tswana(6/8)Nguni(9/9)\"\n[1] \"===============\"\n[1] \"ID17, md0.00, N4\"\n[1] \"Kung(1/13)Pedi(3/10)\"\n[1] \"===============\"\n[1] \"ID18, md0.04, N60\"\n[1] \"YRI(60/60)\"\n[1] \"===============\"\n[1] \"ID19, md0.00, N4\"\n[1] \"Hema(2/15)Luhya(2/24)\"\n[1] \"===============\"\n[1] \"ID20, md0.00, N2\"\n[1] \"Luhya(2/24)\"\n[1] \"===============\"\n[1] \"ID21, md0.07, N20\"\n[1] \"Luhya(20/24)\"\n[1] \"===============\"\n[1] \"ID22, md0.12, N23\"\n[1] \"Alur(10/10)Hema(13/15)\"\n```\nFor any cluster, it is separated from other cluster by \"===============\". The first line of cluster details is \"IDx, md0.xx, Nx\" and the second line is a detail of populations from the ground truth. \n\nFor example,\n[1] \"ID19, md0.00, N4\"\n[1] \"Hema(2/15)Luhya(2/24)\".\n\nThis is a cluster ID19 that has a maximum of manitude-difference of admixture ratios (md) as 0.00 and there are 4 individuals in this cluster. For a second line, there are 2 individuals from Hema population where the total number of Hema members is 15. There are also 2 individuals out of 24 from Luhya population.\n\n\nStep3: plotting admixture ratios and clustering assignment.\n\n```{r}\nipADMIXTURE::plotAdmixClusters(h27pop_obj)\n```\n\u003cimg src=\"https://github.com/DarkEyes/ipADMIXTURE/blob/master/man/FIG/admix.png\" width=\"550\"\u003e\n\nStep4: plotting clustering information in treemap plot\n\n```{r}\nipADMIXTURE::plotClusterLeaves(h27pop_obj)\n```\n\u003cimg src=\"https://github.com/DarkEyes/ipADMIXTURE/blob/master/man/FIG/treemap.png\" width=\"550\"\u003e\n\nStep5: Inferring phylogenetic tree of clusters based on a list of Q matrices that varies K using neighbor-joining (NJ) method. \n\n```{r}\nout\u003c-ipADMIXTURE::getPhyloTree(human27pop_Qmat,h27pop_obj$indexClsVec)\nplot(out$tree,type = \"unrooted\")\n```\n\u003cimg src=\"https://github.com/DarkEyes/ipADMIXTURE/blob/master/man/FIG/nj.png\" width=\"400\"\u003e\n\nThe leave nodes are cluster IDs. \n\nCreating Q matrix from .geno file using R\n---------------------------------------------------\nThere are two well-known software products for getting Q matrix: \u003ca href=\"https://dalexander.github.io/admixture/index.html\"\u003eADMIXTURE\u003c/a\u003e  and \u003ca href=\"https://web.stanford.edu/group/pritchardlab/structure.html\"\u003eSTRUCTURE\u003c/a\u003e. However, if you want to have everything in R, then here's the solution.\n\nWe can use \u003ca href=\"https://www.bioconductor.org/packages/release/bioc/html/LEA.html\"\u003eLEA package\u003c/a\u003e to convert .geno file into Q matrix. If you never install bioconductor, then you should run the following code.\n```{r}\nif (!requireNamespace(\"BiocManager\", quietly = TRUE))\n    install.packages(\"BiocManager\")\n```\nYou can install LEA package by the BiocManager below.\n```{r}\nBiocManager::install(\"LEA\")\n```\nSuppose we have \"yourfile.geno\" and we want to get the Q matrix with 4 ancestors, then we can run the following code.\n```{r}\nlibrary(LEA)\nK=4\nobj.snmf = LEA::snmf(input.file=\"yourfile.geno\", K = K, project = \"new\")\nQmat = LEA::Q(obj.snmf, K = K)\n```\n\nCitation\n----------------------------------------------------------------------------------\n- Chainarong Amornbunchornvej, Pongsakorn Wangkumhang, and Sissades Tongsima (2020). ipADMIXTURE: R package for inferring sub-population clusters based on genetic admixture.\nbioRxiv 2020.03.21.001206; doi: https://doi.org/10.1101/2020.03.21.001206\n\nContact\n----------------------------------------------------------------------------------\n- Developer: C. Amornbunchornvej\u003cdiv itemscope itemtype=\"https://schema.org/Person\"\u003e\u003ca itemprop=\"sameAs\" content=\"https://orcid.org/0000-0003-3131-0370\" href=\"https://orcid.org/0000-0003-3131-0370\" target=\"orcid.widget\" rel=\"noopener noreferrer\" style=\"vertical-align:top;\"\u003e\u003cimg src=\"https://orcid.org/sites/default/files/images/orcid_16x16.png\" style=\"width:1em;margin-right:.5em;\" alt=\"ORCID iD icon\"\u003ehttps://orcid.org/0000-0003-3131-0370\u003c/a\u003e\u003c/div\u003e\n- \u003ca href=\"https://www.nectec.or.th/en/research/dsarg/dsarg-sai.html\"\u003eStrategic Analytics Networks with Machine Learning and AI (SAI)\u003c/a\u003e, \u003ca href=\"https://www.nectec.or.th/en/\"\u003eNECTEC\u003c/a\u003e, Thailand\n- Homepage: \u003ca href=\"https://sites.google.com/view/amornbunchornvej/home\"\u003eLink\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkeyes%2Fipadmixture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkeyes%2Fipadmixture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkeyes%2Fipadmixture/lists"}