{"id":13592472,"url":"https://github.com/KrishnaswamyLab/MAGIC","last_synced_at":"2025-04-08T23:32:57.591Z","repository":{"id":50749226,"uuid":"64703305","full_name":"KrishnaswamyLab/MAGIC","owner":"KrishnaswamyLab","description":"MAGIC (Markov Affinity-based Graph Imputation of Cells), is a method for imputing missing values restoring structure of large biological datasets.","archived":false,"fork":false,"pushed_at":"2024-08-21T03:23:41.000Z","size":226404,"stargazers_count":337,"open_issues_count":31,"forks_count":97,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-10-02T07:15:42.478Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KrishnaswamyLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-01T21:35:39.000Z","updated_at":"2024-10-01T19:05:27.000Z","dependencies_parsed_at":"2022-09-02T23:52:29.764Z","dependency_job_id":null,"html_url":"https://github.com/KrishnaswamyLab/MAGIC","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrishnaswamyLab%2FMAGIC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrishnaswamyLab%2FMAGIC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrishnaswamyLab%2FMAGIC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrishnaswamyLab%2FMAGIC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KrishnaswamyLab","download_url":"https://codeload.github.com/KrishnaswamyLab/MAGIC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223346780,"owners_count":17130499,"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","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-08-01T16:01:09.602Z","updated_at":"2025-04-08T23:32:57.583Z","avatar_url":"https://github.com/KrishnaswamyLab.png","language":"Jupyter Notebook","funding_links":[],"categories":["Software packages"],"sub_categories":["RNA-seq","Feature (Gene) imputation"],"readme":"Markov Affinity-based Graph Imputation of Cells (MAGIC)\n-------------------------------------------------------\n\n[![Latest PyPI version](https://img.shields.io/pypi/v/magic-impute.svg)](https://pypi.org/project/magic-impute/)\n[![Latest CRAN version](https://img.shields.io/cran/v/Rmagic.svg)](https://cran.r-project.org/package=Rmagic)\n[![GitHub Actions Build](https://img.shields.io/github/workflow/status/KrishnaswamyLab/MAGIC/Unit%20Tests/master?label=Github%20Actions)](https://github.com/KrishnaswamyLab/MAGIC/actions)\n[![Read the Docs](https://img.shields.io/readthedocs/magic.svg)](https://magic.readthedocs.io/)\n[![Cell Publication DOI](https://zenodo.org/badge/DOI/10.1016/j.cell.2018.05.061.svg)](https://www.cell.com/cell/abstract/S0092-8674(18)30724-4)\n[![Twitter](https://img.shields.io/twitter/follow/KrishnaswamyLab.svg?style=social\u0026label=Follow)](https://twitter.com/KrishnaswamyLab)\n[![Github Stars](https://img.shields.io/github/stars/KrishnaswamyLab/MAGIC.svg?style=social\u0026label=Stars)](https://github.com/KrishnaswamyLab/MAGIC/)\n\nMarkov Affinity-based Graph Imputation of Cells (MAGIC) is an algorithm for denoising high-dimensional data most commonly applied to single-cell RNA sequencing data. MAGIC learns the manifold data, using the resultant graph to smooth the features and restore the structure of the data.\n\nTo see how MAGIC can be applied to single-cell RNA-seq, elucidating the epithelial-to-mesenchymal transition, read our [publication in Cell](https://www.cell.com/cell/abstract/S0092-8674(18)30724-4).\n\n[David van Dijk, et al. **Recovering Gene Interactions from Single-Cell Data Using Data Diffusion**. 2018. *Cell*.](https://www.cell.com/cell/abstract/S0092-8674(18)30724-4)\n\nMAGIC has been implemented in Python, Matlab, and R.\n\n#### To get started immediately, check out our tutorials:\n##### Python\n* [Epithelial-to-Mesenchymal Transition Tutorial](http://nbviewer.jupyter.org/github/KrishnaswamyLab/MAGIC/blob/master/python/tutorial_notebooks/emt_tutorial.ipynb)\n* [Bone Marrow Tutorial](http://nbviewer.jupyter.org/github/KrishnaswamyLab/MAGIC/blob/master/python/tutorial_notebooks/bonemarrow_tutorial.ipynb)\n##### R\n* [Epithelial-to-Mesenchymal Transition Tutorial](http://htmlpreview.github.io/?https://github.com/KrishnaswamyLab/MAGIC/blob/master/Rmagic/inst/examples/emt_tutorial.html)\n* [Bone Marrow Tutorial](http://htmlpreview.github.io/?https://github.com/KrishnaswamyLab/MAGIC/blob/master/Rmagic/inst/examples/bonemarrow_tutorial.html)\n\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/KrishnaswamyLab/MAGIC/master/magic.gif\"/\u003e\n\u003cbr\u003e\n\u003ci\u003eMagic reveals the interaction between Vimentin (VIM), Cadherin-1 (CDH1), and Zinc finger E-box-binding homeobox 1 (ZEB1, encoded by colors).\n\u003c/i\u003e\n\u003c/p\u003e\n\n### Table of Contents\n\n  * [Python](#python)\n     * [Installation](#installation)\n        * [Installation with pip](#installation-with-pip)\n        * [Installation from GitHub](#installation-from-github)\n     * [Usage](#usage)\n        * [Quick Start](#quick-start)\n        * [Tutorials](#tutorials)\n  * [Matlab](#matlab)\n     * [Instructions for the Matlab version](#instructions-for-the-matlab-version)\n  * [R](#r)\n     * [Installation](#installation-1)\n        * [Installation from CRAN](#installation-from-cran)\n        * [Installation from GitHub](#installation-from-github-1)\n     * [Usage](#usage-1)\n        * [Quick Start](#quick-start-1)\n        * [Tutorials](#tutorials-1)\n  * [Help](#help)\n\n## Python\n\n### Installation\n\n#### Installation with pip\n\nTo install with `pip`, run the following from a terminal:\n\n    pip install --user magic-impute\n\n#### Installation from GitHub\n\nTo clone the repository and install manually, run the following from a terminal:\n\n    git clone git://github.com/KrishnaswamyLab/MAGIC.git\n    cd MAGIC/python\n    python setup.py install --user\n\n### Usage\n\n#### Quick Start\n\nThe following code runs MAGIC on test data located in the MAGIC repository.\n\n    import magic\n    import pandas as pd\n    import matplotlib.pyplot as plt\n    X = pd.read_csv(\"MAGIC/data/test_data.csv\")\n    magic_operator = magic.MAGIC()\n    X_magic = magic_operator.fit_transform(X, genes=['VIM', 'CDH1', 'ZEB1'])\n    plt.scatter(X_magic['VIM'], X_magic['CDH1'], c=X_magic['ZEB1'], s=1, cmap='inferno')\n    plt.show()\n    magic.plot.animate_magic(X, gene_x='VIM', gene_y='CDH1', gene_color='ZEB1', operator=magic_operator)\n\n#### Tutorials\n\nYou can read the MAGIC documentation at https://magic.readthedocs.io/. We have included two tutorial notebooks on MAGIC usage and results visualization for single cell RNA-seq data.\n\nEMT data notebook: http://nbviewer.jupyter.org/github/KrishnaswamyLab/MAGIC/blob/master/python/tutorial_notebooks/emt_tutorial.ipynb\n\nBone Marrow data notebook: http://nbviewer.jupyter.org/github/KrishnaswamyLab/MAGIC/blob/master/python/tutorial_notebooks/bonemarrow_tutorial.ipynb\n\n## Matlab\n\n### Instructions for the Matlab version\n1. run_magic.m -- MAGIC imputation function\n2. test_magic.m -- Shows how to run MAGIC. Also included is a function for loading 10x format data (load_10x.m)\n\n## R\n\n### Installation\n\nTo use MAGIC, you will need to install both the R and Python packages.\n\nIf `python` or `pip` are not installed, you will need to install them. We recommend\n[Miniconda3](https://conda.io/miniconda.html) to install Python and `pip` together,\nor otherwise you can install `pip` from https://pip.pypa.io/en/stable/installing/.\n\n#### Installation from CRAN\n\nIn R, run this command to install MAGIC and all dependencies:\n\n    install.packages(\"Rmagic\")\n\nIn a terminal, run the following command to install the Python\nrepository.\n\n    pip install --user magic-impute\n\n#### Installation from GitHub\n\nTo clone the repository and install manually, run the following from a terminal:\n\n    git clone git://github.com/KrishnaswamyLab/MAGIC.git\n    cd MAGIC/python\n    python setup.py install --user\n    cd ../Rmagic\n    R CMD INSTALL .\n\n### Usage\n\n#### Quick Start\n\nAfter installing the package, MAGIC can be run by loading the library and calling `magic()`:\n\n    library(Rmagic)\n    library(ggplot2)\n    data(magic_testdata)\n    MAGIC_data \u003c- magic(magic_testdata, genes=c(\"VIM\", \"CDH1\", \"ZEB1\"))\n    ggplot(MAGIC_data) +\n      geom_point(aes(x=VIM, y=CDH1, color=ZEB1))\n\n#### Tutorials\n\nYou can read the MAGIC tutorial by running `help(Rmagic::magic)`. For a working example, see the Rmarkdown tutorials at \u003chttp://htmlpreview.github.io/?https://github.com/KrishnaswamyLab/MAGIC/blob/master/Rmagic/inst/examples/bonemarrow_tutorial.html\u003e and \u003chttp://htmlpreview.github.io/?https://github.com/KrishnaswamyLab/MAGIC/blob/master/Rmagic/inst/examples/emt_tutorial.html\u003e or in `Rmagic/inst/examples`.\n\n## Help\n\nIf you have any questions or require assistance using MAGIC, please contact us at \u003chttps://krishnaswamylab.org/get-help\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKrishnaswamyLab%2FMAGIC","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKrishnaswamyLab%2FMAGIC","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKrishnaswamyLab%2FMAGIC/lists"}