{"id":19448481,"url":"https://github.com/neurodata/r-mgc","last_synced_at":"2026-03-17T21:04:29.847Z","repository":{"id":56936234,"uuid":"102669340","full_name":"neurodata/r-mgc","owner":"neurodata","description":"R package for MGC code","archived":false,"fork":false,"pushed_at":"2021-02-23T04:35:47.000Z","size":151835,"stargazers_count":10,"open_issues_count":9,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-09T20:38:58.354Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neurodata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"citation.bib","codeowners":null,"security":null,"support":null}},"created_at":"2017-09-06T23:51:12.000Z","updated_at":"2025-09-23T09:08:25.000Z","dependencies_parsed_at":"2022-08-21T01:10:09.511Z","dependency_job_id":null,"html_url":"https://github.com/neurodata/r-mgc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/neurodata/r-mgc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neurodata%2Fr-mgc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neurodata%2Fr-mgc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neurodata%2Fr-mgc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neurodata%2Fr-mgc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neurodata","download_url":"https://codeload.github.com/neurodata/r-mgc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neurodata%2Fr-mgc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30631434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: 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":[],"created_at":"2024-11-10T16:27:10.510Z","updated_at":"2026-03-17T21:04:29.828Z","avatar_url":"https://github.com/neurodata.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"This R repo is a development branch, the actively developed repo is in Python at https://github.com/neurodata/hyppo.\n\n# Multiscale Graph Correlation (MGC)\n\n[![CRAN Status Badge](http://www.r-pkg.org/badges/version/mgc)](http://cran.r-project.org/web/packages/mgc)\n[![eLife Shield](https://img.shields.io/badge/eLife-41690-green.svg?style=flat)](https://elifesciences.org/articles/41690)\n[![Downloads badge](https://cranlogs.r-pkg.org/badges/mgc)](https://cranlogs.r-pkg.org/badges/mgc)\n[![Zenodo Shield](https://zenodo.org/badge/103285533.svg)](https://zenodo.org/badge/latestdoi/103285533)\n[![Travis](https://travis-ci.org/neurodata/r-mgc.svg?branch=master)](https://travis-ci.org/neurodata/r-mgc)\n\n## Contents\n\n- [Overview](#overview)\n- [Repo Contents](#repo-contents)\n- [System Requirements](#system-requirements)\n- [Installation Guide](#installation-guide)\n- [Instructions for Use](#instructions-for-use)\n- [License](./LICENSE)\n- [Issues](https://github.com/neurodata/mgc/issues)\n- [Citation](#citation)\n- [Reproducibility](#reproducibility)\n\n# Overview\n\nIn modern scientific discovery, it is becoming increasingly critical to uncover whether one property of a dataset is related to another. The `MGC` (pronounced *magic*), or Multiscale Graph Correlation, provides a framework for investigation into the relationships between properties of a dataset and the underlying geometries of the relationships, all while requiring sample sizes feasible in real data scenarios.\n\n# Repo Contents\n\n- [R](./R): `R` package code.\n- [docs](./docs): package documentation.\n- [man](./man): package manual for help in R session.\n- [tests](./tests): `R` unit tests written using the `testthat` package.\n- [vignettes](./vignettes): `R` vignettes for R session html help pages.\n\n\n# System Requirements\n\n## Hardware Requirements\n\nThe `MGC` package requires only a standard computer with enough RAM to support the operations defined by a user. For minimal performance, this will be a computer with about 2 GB of RAM. For optimal performance, we recommend a computer with the following specs:\n\nRAM: 16+ GB  \nCPU: 4+ cores, 3.3+ GHz/core\n\nThe runtimes below are generated using a computer with the recommended specs (16 GB RAM, 4 cores@3.3 GHz) and internet of speed 25 Mbps.\n\n## Software Requirements\n\n### OS Requirements\n\nThis package is supported for *Linux* operating systems. The package has been tested on the following systems:\n\nLinux: Ubuntu 20.04, 18.04 \nMac OSX:  \nWindows:  \n\nBefore setting up the `MGC` package, users should have `R` version 3.4.0 or higher, and several packages set up from CRAN.\n\n#### Installing R version 3.4.2 on Ubuntu 16.04\n\nthe latest version of R can be installed by adding the latest repository to `apt`:\n\n```\nsudo echo \"deb http://cran.rstudio.com/bin/linux/ubuntu xenial/\" | sudo tee -a /etc/apt/sources.list\ngpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9\ngpg -a --export E084DAB9 | sudo apt-key add -\nsudo apt-get update\nsudo apt-get install r-base r-base-dev\n```\n\nwhich should install in about 20 seconds.\n\n#### Package dependencies\n\nUsers should install the following packages prior to installing `mgc`, from an `R` terminal:\n\n```\ninstall.packages(c('ggplot2', 'reshape2', 'Rmisc', 'devtools', 'testthat', 'knitr', 'rmarkdown', 'latex2exp', 'MASS'))\n```\n\nwhich will install in about 80 seconds on a recommended machine.\n\n#### Package Versions\n\nThe `mgc` package functions with all packages in their latest versions as they appear on `CRAN` on October 15, 2017. Users can check [CRAN snapshot](https://mran.microsoft.com/timemachine/) for details. The versions of software are, specifically:\n```\nggplot2: 2.2.1\nreshape2: 1.4.2\nRmisc: 1.5\ndevtools: 1.13.3\ntestthat: 0.2.0\nknitr: 1.17\nrmarkdown: 1.6\nlatex2exp: 0.4.0\nMASS: 7.3\n```\n\nIf you are having an issue that you believe to be tied to software versioning issues, please drop us an [Issue](https://github.com/neurodata/mgc/issues). \n\n# Installation Guide\n\nFrom an `R` session, type:\n\n```\nrequire(devtools)\ninstall_github('neurodata/r-mgc', build_vignettes=TRUE)  # install mgc with the vignettes\nrequire(mgc)  # source the package now that it is set up\nvignette(\"MGC\", package=\"mgc\")  # view one of the basic vignettes\n```\n\nThe package should take approximately 20 seconds to install with vignettes on a recommended computer. \n\n\n### Instructions for Use\n\nPlease see the vignettes for help using the package:\n\n```\nvignette(\"MGC\", package=\"mgc\")\nvignette(\"Discriminability\", package=\"mgc\")\nvignette(\"simulations\", package=\"mgc\")\n```\n\n\n# Pseudocode\n\nPseudocode for the methods employed in the `mgc` package can be found on the [arXiv - MGC](https://arxiv.org/abs/1609.05148) in Appendix C (starting on page 30).\n\n# Citation\n\nFor citing code or the paper, please use the citations found in [citation.bib](./citation.bib).\n\n# Reproducibility\n\n### MGC\n\nAll the code to reproduce any figures from https://arxiv.org/abs/1609.05148 is available here https://github.com/neurodata/mgc-paper.\n\n### Discriminability\n\nHere, we describe how to reproduce the manuscript figures from the discriminability paper. To begin, clone this repository locally:\n\n```\ngit clone https://github.com/neurodata/r-mgc.git\n```\n\nWe assume that the directory `r-mgc` placed locally on the system is `\u003cpackage_root\u003e`. Note that all figures were stylized using [Adobe Photoshop](www.adobe.com/Photoshop) prior to submission.\n\n- [Figure 1: Mini Sims Figure](https://github.com/neurodata/r-mgc/tree/master/docs/discriminability/paper/simulations/dummy_sims.Rmd) This figure demonstrates the behavior of discriminability, Fingerprinting, ICC/I2C2, and Kernel methods under a range of basic simulation settings in 1 dimension.\n\n- [Figure 2: Multisim Figure](https://github.com/neurodata/r-mgc/tree/master/docs/discriminability/paper/simulations) This figure demonstrates the behavior of discriminability, ICC, and I2C2 under a variety of simulation benchmark settings. To execute the script with fresh data:\n\n```\nsetwd('\u003cpackage_root\u003e/docs/discriminability/paper/simulations')\nsource('shared_scripts.R`)\n```\n\nNote: the scripts will automatically multithread, however, the simulation benchmarks take quite a while to execute (1.5 days on a 96 core machine with 1 TB of RAM).\n\nUsing the included [bound](https://github.com/neurodata/r-mgc/blob/master/docs/discriminability/paper/data/sims/discr_sims_bound.rds), [one sample](https://github.com/neurodata/r-mgc/blob/master/docs/discriminability/paper/data/sims/discr_sims_os.rds), and [two sample](https://github.com/neurodata/r-mgc/blob/master/docs/discriminability/paper/data/sims/discr_sims_ts.rds) data, you can proceed to duplicate the figure by opening the R notebook [simulation plots](https://github.com/neurodata/r-mgc/blob/master/docs/discriminability/paper/simulations/multisim_figure.Rmd), and executing the script.\n\n- [Figure 3: 64 pipelines figure](https://github.com/neurodata/r-mgc/tree/master/docs/discriminability/paper/64pipes_fig). To regenerate the source data for this portion of the manuscript, users can use the following two scripts from an R terminal:\n\n```\nsetwd('\u003cpackage_root\u003e/docs/discriminability/paper/discr_computation')\n# edit lines 17 and 18, and lines 210 and 211, and set to your local path where\n# preprocessed brains are located\nsource('./real_data_driver.R')  # runs the discriminability calculations\n# edit lines 17 and 18, and lines 108 and 109, to the location of the \n# preprocessed brains\nsource('./realdat_perm_testing.R')  # runs the two sample testing\n```\nAgain, the scripts will multithread, but can be expected to take approximately 3 days on a 96 core, 1 TB RAM machine.\n\nTo regenerate Figure 2 from the manuscript, users can execute the [64 Pipelines Figure](https://github.com/neurodata/r-mgc/blob/master/docs/discriminability/paper/64pipes_fig/real_data.Rmd) notebook.\n\n- [Figure 4: Marginalized Options Comparison](https://github.com/neurodata/r-mgc/blob/master/docs/discriminability/paper/multi_modal_opts') Users can regenerate the figure by using the notebook [Multi Modal Opts](https://github.com/neurodata/r-mgc/blob/master/docs/discriminability/paper/multi_modal_opts/multi_modal_opts.Rmd).\n\n- [Figure 5: Effect Size Investigation](https://github.com/neurodata/r-mgc/edit/master/docs/discriminability/paper/dcor_fig) Users can reproduce the data collected with:\n\n```\nsetwd('\u003cpackage_root\u003e/docs/discriminability/paper/dcor_fig')\nsource('./dep_wt_driver.R')\n```\n\nResults can be expected to take 2 days on a 96 core, 1 TB machine.\n\nTo reproduce the figure, users can use the [Effect Size Investigation](https://github.com/neurodata/r-mgc/blob/master/docs/discriminability/paper/dcor_fig/dcor_bypipe_exps.Rmd) notebook.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurodata%2Fr-mgc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneurodata%2Fr-mgc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurodata%2Fr-mgc/lists"}