Skip to main content

MAGIC

Project description

Latest PyPi version Latest CRAN version Travis CI 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.

For R and MATLAB implementations of MAGIC, see https://github.com/KrishnaswamyLab/MAGIC.

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

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

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

Example data

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)

Interactive command line

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/tutorial_notebooks/emt_tutorial.ipynb

Bone Marrow data notebook: http://nbviewer.jupyter.org/github/KrishnaswamyLab/magic/blob/master/python/tutorial_notebooks/bonemarrow_tutorial.ipynb

Help

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

magic-impute-2.0.4.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

magic_impute-2.0.4-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file magic-impute-2.0.4.tar.gz.

File metadata

  • Download URL: magic-impute-2.0.4.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.12

File hashes

Hashes for magic-impute-2.0.4.tar.gz
Algorithm Hash digest
SHA256 c97f16ff3f52b171da482ba4dd44617dae35a88ecfd17ddc4239ab24471e7839
MD5 708e21fcabf097637925c4680c370638
BLAKE2b-256 4ddc9b624c54e93200d9edf477ee530105eb06937fbb9b02a1aba7386e06d7c9

See more details on using hashes here.

File details

Details for the file magic_impute-2.0.4-py3-none-any.whl.

File metadata

  • Download URL: magic_impute-2.0.4-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.12

File hashes

Hashes for magic_impute-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 68dacfdb5d5030e9624831d9f838bf70fe516e120ed05d1da3c4060fa0d292e3
MD5 ff5e381e05e56e6fa3794e96052a95fa
BLAKE2b-256 b5c982b61bb3a816448fe682aeab8c907f18aaf0a180f8a7a26e27af94f4b519

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page