{"id":35230389,"url":"https://github.com/guokai8/o2plsda","last_synced_at":"2026-04-02T01:36:07.220Z","repository":{"id":44427442,"uuid":"413478714","full_name":"guokai8/o2plsda","owner":"guokai8","description":"Omics data integration with o2plsda","archived":false,"fork":false,"pushed_at":"2025-12-02T01:35:08.000Z","size":301,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-29T21:55:21.693Z","etag":null,"topics":["integration","multi-omics","o2pls","omics","plsda"],"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/guokai8.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2021-10-04T15:23:56.000Z","updated_at":"2025-12-02T01:35:13.000Z","dependencies_parsed_at":"2025-02-18T03:21:18.069Z","dependency_job_id":"cfc2f135-a5cc-44f0-a273-f1cd0fb8a505","html_url":"https://github.com/guokai8/o2plsda","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/guokai8/o2plsda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokai8%2Fo2plsda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokai8%2Fo2plsda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokai8%2Fo2plsda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokai8%2Fo2plsda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guokai8","download_url":"https://codeload.github.com/guokai8/o2plsda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guokai8%2Fo2plsda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:05:07.454Z","status":"ssl_error","status_checked_at":"2026-04-02T00:56:46.496Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["integration","multi-omics","o2pls","omics","plsda"],"created_at":"2025-12-30T02:23:29.701Z","updated_at":"2026-04-02T01:36:07.215Z","avatar_url":"https://github.com/guokai8.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# o2plsda: Multiomics Data Integration\n# o2plsda [![Project Status:](http://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)  [![](https://img.shields.io/badge/devel%20version-0.0.28-green.svg)](https://github.com/guokai8/o2plsda) \u003ca href=\"https://cran.r-project.org/web/packages/o2plsda/index.html\"\u003e\u003cimg border=\"0\" src=\"https://www.r-pkg.org/badges/version/o2plsda\" alt=\"CRAN version\"\u003e ![Code Size:](https://img.shields.io/github/languages/code-size/guokai8/o2plsda)![](https://img.shields.io/badge/license-GPL--3-blue.svg)[![DOI](https://zenodo.org/badge/413478714.svg)](https://zenodo.org/badge/latestdoi/413478714)\u003cimg src=\"https://cranlogs.r-pkg.org/badges/grand-total/o2plsda\" alt=\"\"\u003e\n\n_o2plsda_ provides functions to do O2PLS-DA analysis for multiple omics integration.The algorithm came from \"O2-PLS, a two-block (X±Y) latent variable regression (LVR) method with an integral OSC filter\" which published by Johan Trygg and Svante Wold at 2003. O2PLS is a bidirectional multivariate regression method that aims to separate the covariance between two data sets (it was recently extended to multiple data sets) (Löfstedt and Trygg, 2011; Löfstedt et al., 2012) from the systematic sources of variance being specific for each data set separately. \n\n### Cross-Validation\n\nIn order to avoid overfitting of the model, the optimal number of latent variables for each model structure was estimated using group-balanced MCCV. The package could use the group information when we select the best paramaters with cross-validation. In cross-validation (CV) one minimizes a certain measure of error over some parameters that should be determined a priori. Here, we have three parameters: (nc, nx, ny). A popular measure is the prediction error ||Y - \\hat{Y}||, where \\hat{Y} is a prediction of Y. In our case the O2PLS method is symmetric in X and Y, so we minimize the sum of the prediction errors: \n||X - \\hat{X}||+||Y - \\hat{Y}||. \n\n\nHere nc should be a positive integer, and nx and ny should be non-negative. The best integers are then the minimizers of the prediction error.\n\nThe O2PLS-DA analysis was performed as described by Bylesjö et al. (2007); briefly, the O2PLS predictive variation [$TW^\\top$, $UC^\\top$] was used for a subsequent O2PLS-DA analysis. The Variable Importance in the Projection (VIP) value was calculated as a weighted sum of the squared correlations between the OPLS-DA components and the original variable.\n\n## Installation\n```{r,eval=FALSE}\nlibrary(devtools)\ninstall_github(\"guokai8/o2plsda\")\n``` \n## Examples\n```{r}\nlibrary(o2plsda)\nset.seed(123)\n# sample * values\nX = matrix(rnorm(5000),50,100)\n# sample * values\nY = matrix(rnorm(5000),50,100)\nrownames(X) \u003c- paste(\"S\",1:50,sep=\"\")\nrownames(Y) \u003c- paste(\"S\",1:50,sep=\"\")\ncolnames(X) \u003c- paste(\"Gene\",1:100,sep=\"\")\ncolnames(Y) \u003c- paste(\"Lipid\",1:100,sep=\"\")\nX = scale(X, scale=T)\nY = scale(Y, scale=T)\n## group factor could be omitted if you don't have any group \ngroup \u003c- rep(c(\"Ctrl\",\"Treat\"),each = 25)\n```\nDo cross validation with group information\n```{r}\nset.seed(123)\n## nr_folds : cross validation k-fold (suggest 10)\n## ncores : parallel paramaters for large datasets\ncv \u003c- o2cv(X,Y,1:5,1:3,1:3,group=group,nr_folds = 10)\n#####################################\nThe best parameters are nc = 1, nx = 2, ny = 3\n#####################################\nThe the RMSE is: 1.98186790425324\n#####################################\n```\n\nThen we can do the O2PLS analysis with nc = 1, nx = 2, ny =3. You can also select the best paramaters by looking at the cross validation results.\n```{r}\nfit \u003c- o2pls(X,Y,1,2,3)\nsummary(fit)\n######### Summary of the O2PLS results #########\n### Call o2pls(X, Y, nc= 1 , nx= 2 , ny= 3 ) ###\n### Total variation \n### X: 4900 ; Y: 4900  ###\n### Total modeled variation ### X: 0.12 ; Y: 0.16  ###\n### Joint, Orthogonal, Noise (proportions) ###\n               X     Y\nJoint      0.041 0.047\nOrthogonal 0.079 0.113\nNoise      0.880 0.840\n### Variation in X joint part predicted by Y Joint part: 0.934 \n### Variation in Y joint part predicted by X Joint part: 0.934 \n### Variation in each Latent Variable (LV) in Joint part: \n    LV1\nX 0.041\nY 0.047\n### Variation in each Latent Variable (LV) in X Orthogonal part: \n    LV1   LV2\nX 0.044 0.035\n### Variation in each Latent Variable (LV) in Y Orthogonal part: \n    LV1   LV2   LV3\nY 0.046 0.035 0.033\n\n############################################\n\n```\n\nExtract the loadings and scores from the fit results\n\n```{r}\nXl \u003c- loadings(fit,loading=\"Xjoint\")\nXs \u003c- scores(fit,score=\"Xjoint\")\nplot(fit,type=\"score\",var=\"Xjoint\", group=group)\nplot(fit,type=\"loading\",var=\"Xjoint\", group=group,repel=F,rotation=TRUE)\n```\n\nDo the OPLSDA based on the O2PLS results\n```{r}\nres \u003c- oplsda(fit,group, nc=1)\nplot(res,type=\"score\", group=group)\nvip \u003c- vip(res)\nplot(res,type=\"vip\", group = group, repel = FALSE,order=TRUE)\n```\n\n## Note\nThe package is still under development.\n\n## Citation\nIf you like this package, please contact me for the citation.\n\n## Contact information\n\nFor any questions please contact guokai8@gmail.com or https://github.com/guokai8/o2plsda/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguokai8%2Fo2plsda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguokai8%2Fo2plsda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguokai8%2Fo2plsda/lists"}