magic-impute

MAGIC (Markov Affinity-based Graph Imputation of Cells), is a method for imputing missing values restoring structure of large biological datasets.

https://github.com/krishnaswamylab/magic

Science Score: 46.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    3 of 19 committers (15.8%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.3%) to scientific vocabulary

Keywords from Contributors

bioinformatics human-cell-atlas single-cell-genomics single-cell-rna-seq scrna-seq-analysis report autograder hack animal standardization
Last synced: 7 months ago · JSON representation

Repository

MAGIC (Markov Affinity-based Graph Imputation of Cells), is a method for imputing missing values restoring structure of large biological datasets.

Basic Info
  • Host: GitHub
  • Owner: KrishnaswamyLab
  • License: gpl-2.0
  • Language: Jupyter Notebook
  • Default Branch: master
  • Homepage:
  • Size: 216 MB
Statistics
  • Stars: 363
  • Watchers: 21
  • Forks: 98
  • Open Issues: 33
  • Releases: 9
Created over 9 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing License

README.md

Markov Affinity-based Graph Imputation of Cells (MAGIC)

Latest PyPI version Latest CRAN version GitHub Actions Build Read the Docs Cell Publication DOI Twitter Github Stars

Markov 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.

To see how MAGIC can be applied to single-cell RNA-seq, elucidating the epithelial-to-mesenchymal transition, read our publication in Cell.

David van Dijk, et al. Recovering Gene Interactions from Single-Cell Data Using Data Diffusion. 2018. Cell.

MAGIC has been implemented in Python, Matlab, and R.

To get started immediately, check out our tutorials:

Python


Magic reveals the interaction between Vimentin (VIM), Cadherin-1 (CDH1), and Zinc finger E-box-binding homeobox 1 (ZEB1, encoded by colors).

Table of Contents

Python

Installation

Installation with pip

To install with pip, run the following from a terminal:

pip install --user magic-impute

Installation from GitHub

To clone the repository and install manually, run the following from a terminal:

git clone git://github.com/KrishnaswamyLab/MAGIC.git
cd MAGIC/python
python setup.py install --user

Usage

Quick Start

The following code runs MAGIC on test data located in the MAGIC repository.

import magic
import pandas as pd
import matplotlib.pyplot as plt
X = pd.read_csv("MAGIC/data/test_data.csv")
magic_operator = magic.MAGIC()
X_magic = magic_operator.fit_transform(X, genes=['VIM', 'CDH1', 'ZEB1'])
plt.scatter(X_magic['VIM'], X_magic['CDH1'], c=X_magic['ZEB1'], s=1, cmap='inferno')
plt.show()
magic.plot.animate_magic(X, gene_x='VIM', gene_y='CDH1', gene_color='ZEB1', operator=magic_operator)

Tutorials

You 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.

EMT data notebook: http://nbviewer.jupyter.org/github/KrishnaswamyLab/MAGIC/blob/master/python/tutorialnotebooks/emttutorial.ipynb

Bone Marrow data notebook: http://nbviewer.jupyter.org/github/KrishnaswamyLab/MAGIC/blob/master/python/tutorialnotebooks/bonemarrowtutorial.ipynb

Matlab

Instructions for the Matlab version

  1. run_magic.m -- MAGIC imputation function
  2. testmagic.m -- Shows how to run MAGIC. Also included is a function for loading 10x format data (load10x.m)

R

Installation

To use MAGIC, you will need to install both the R and Python packages.

If python or pip are not installed, you will need to install them. We recommend Miniconda3 to install Python and pip together, or otherwise you can install pip from https://pip.pypa.io/en/stable/installing/.

Installation from CRAN

In R, run this command to install MAGIC and all dependencies:

install.packages("Rmagic")

In a terminal, run the following command to install the Python repository.

pip install --user magic-impute

Installation from GitHub

To clone the repository and install manually, run the following from a terminal:

git clone git://github.com/KrishnaswamyLab/MAGIC.git
cd MAGIC/python
python setup.py install --user
cd ../Rmagic
R CMD INSTALL .

Usage

Quick Start

After installing the package, MAGIC can be run by loading the library and calling magic():

library(Rmagic)
library(ggplot2)
data(magic_testdata)
MAGIC_data <- magic(magic_testdata, genes=c("VIM", "CDH1", "ZEB1"))
ggplot(MAGIC_data) +
  geom_point(aes(x=VIM, y=CDH1, color=ZEB1))

Tutorials

You can read the MAGIC tutorial by running help(Rmagic::magic). For a working example, see the Rmarkdown tutorials at http://htmlpreview.github.io/?https://github.com/KrishnaswamyLab/MAGIC/blob/master/Rmagic/inst/examples/bonemarrow_tutorial.html and http://htmlpreview.github.io/?https://github.com/KrishnaswamyLab/MAGIC/blob/master/Rmagic/inst/examples/emt_tutorial.html or in Rmagic/inst/examples.

Help

If you have any questions or require assistance using MAGIC, please contact us at https://krishnaswamylab.org/get-help.

Owner

  • Name: Krishnaswamy Lab
  • Login: KrishnaswamyLab
  • Kind: organization
  • Email: smita.krishnaswamy@yale.edu
  • Location: New Haven, CT

GitHub Events

Total
  • Issues event: 3
  • Watch event: 28
  • Issue comment event: 3
  • Fork event: 3
Last Year
  • Issues event: 3
  • Watch event: 28
  • Issue comment event: 3
  • Fork event: 3

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 644
  • Total Committers: 19
  • Avg Commits per committer: 33.895
  • Development Distribution Score (DDS): 0.419
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Scott Gigante s****e@g****m 374
Pooja Kathail p****5@c****u 98
Ngan Vu n****u@y****u 40
dvdijk d****k@g****m 36
Manu Setty m****i@g****m 34
Daniel Dager d****r@y****u 24
Daniel Burkhardt b****b@g****m 10
Scott Gigante s****e 5
Paul Hoffman p****n@n****g 4
Ruchira-Ray 3****y 4
github-actions[bot] 4****] 4
Fabio Zanini f****i@f****m 3
pkathail p****l 2
lkmklsmn l****n@g****m 1
guilhermesena g****4@g****m 1
EC2 Default User e****r@i****l 1
Cao T c****8@g****m 1
Alex Tong a****g@g****m 1
Paul Hoffman m****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 81
  • Total pull requests: 32
  • Average time to close issues: 2 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 73
  • Total pull request authors: 6
  • Average comments per issue: 2.8
  • Average comments per pull request: 0.28
  • Merged pull requests: 27
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 1
  • Average time to close issues: about 10 hours
  • Average time to close pull requests: 7 minutes
  • Issue authors: 2
  • Pull request authors: 1
  • Average comments per issue: 0.67
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • HHHit (3)
  • buutrg (2)
  • yongjieliu (2)
  • xingzhongyu (2)
  • MichaelPeibo (2)
  • abhay0305 (2)
  • scottgigante (1)
  • zvittorio (1)
  • Roger-GOAT (1)
  • prummer (1)
  • dagarfield (1)
  • Natacoman (1)
  • k326xh (1)
  • saeedfc (1)
  • AVitriolo (1)
Pull Request Authors
  • scottgigante (22)
  • dburkhardt (5)
  • dbhaskar92 (4)
  • dvdijk (1)
  • softbear (1)
  • mojaveazure (1)
Top Labels
Issue Labels
question (23) bug (13) enhancement (3)
Pull Request Labels

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 1,598 last-month
  • Total docker downloads: 485
  • Total dependent packages: 13
    (may contain duplicates)
  • Total dependent repositories: 22
    (may contain duplicates)
  • Total versions: 53
  • Total maintainers: 1
pypi.org: magic-impute

MAGIC

  • Versions: 15
  • Dependent Packages: 13
  • Dependent Repositories: 22
  • Downloads: 1,598 Last month
  • Docker Downloads: 485
Rankings
Dependent packages count: 1.0%
Docker downloads count: 1.4%
Dependent repos count: 3.1%
Average: 3.5%
Stargazers count: 3.7%
Forks count: 4.7%
Downloads: 7.2%
Maintainers (1)
Last synced: 8 months ago
proxy.golang.org: github.com/KrishnaswamyLab/MAGIC
  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 7 months ago
proxy.golang.org: github.com/krishnaswamylab/magic
  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 7 months ago

Dependencies

Rmagic/DESCRIPTION cran
  • Matrix >= 1.2 depends
  • R >= 3.3 depends
  • ggplot2 * imports
  • methods * imports
  • reticulate >= 1.4 imports
  • stats * imports
  • Seurat >= 3.0.0 suggests
  • phateR * suggests
  • readr * suggests
  • viridis * suggests
Rmagic/.pre-commit.r_requirements.txt pypi
  • docopt *
  • git2r *
  • lintr *
  • precommit *
  • roxygen2 *
  • styler *
python/doc/source/requirements.txt pypi
  • future *
  • graphtools >=1.0.0
  • matplotlib >=2.0.1
  • numpy >=1.14.0
  • pandas >=0.25
  • scikit-learn >=0.19.1
  • scipy >=1.1.0
  • scprep >=1.0
  • sphinx *
  • sphinxcontrib-napoleon *
python/requirements.txt pypi
  • future *
  • graphtools >=1.4.0
  • matplotlib *
  • numpy >=1.14.0
  • pandas >=0.25
  • scikit-learn >=0.19.1
  • scipy >=1.1.0
  • scprep >=1.0
  • tasklogger >=1.0.0
python/setup.py pypi
  • future *
  • graphtools >=1.4.0
  • matplotlib *
  • numpy >=1.14.0
  • pandas >=0.25
  • scikit-learn >=0.19.1
  • scipy >=1.1.0
  • scprep >=1.0
  • tasklogger >=1.0.0
.github/workflows/deploy.yml actions
  • actions/checkout master composite
  • actions/setup-python v2 composite
  • pypa/gh-action-pypi-publish master composite
.github/workflows/pre-commit.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • ad-m/github-push-action master composite
  • pre-commit/action v2.0.0 composite
  • styfle/cancel-workflow-action 0.6.0 composite
.github/workflows/run_tests.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • actions/upload-artifact master composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-tinytex v1 composite
  • styfle/cancel-workflow-action 0.6.0 composite