Git Product home page Git Product logo

mars's Introduction

MARS

Project website

PyTorch implementation of MARS, a meta-learning approach for cell type discovery in heterogenous single-cell data. MARS annotates known and new cell types by transferring latent cell representations across multiple datasets. It is able to discover cell types that have never been seen before and characterize experiments that are yet unannotated. For a detailed description of the algorithm, please see our manuscript Discovering Novel Cell Types across Heterogeneous Single-cell Experiments (2020).

Setup

MARS requires anndata and scanpy libraries. Please check the requirements.txt file for more details on required Python packages. You can create new environment and install all required packages with:

pip install -r requirements.txt

Using MARS

We implemented MARS model in a self-contained class. To make an instance and train MARS:

mars = MARS(n_clusters, params, labeled_exp, unlabeled_exp, pretrain_data)
adata, landmarks, scores = mars.train(evaluation_mode=True)

MARS provides annotations for the unlabeled experimentm as well as embeddings for annotated and unannotated experiments, and stores them in anndata object. In the evaluation_mode annotations for unlabeled experiment need to be provided, and they are used to compute metrics and evaluate the performance of the model.

MARS embeddings can be visualized in the 2D space using UMAP or tSNE. Example embeddings for diaphragm and liver tissues:

MARS can generate interpretable names for discovered clusters by calling:

mars.name_cell_types(adata, landmarks, cell_type_name_map)

Example of the MARS naming approach:

Example of running MARS on Tabula Muris dataset in leave-one-tissue-out manner is provided in the main_TM.py. We also provide two example notebooks that illustrate MARS on small-scale datasets:

Cross-validation benchmark

We provide cross-validation benchmark cross_tissue_generator.py for classifying cell types of Tabula Muris data. The iterator goes over cross-organ train/test splits with an auto-download of Tabula Muris data.

Datasets

Tabula Muris Senis datasets is from https://figshare.com/projects/Tabula_Muris_Senis/64982.

Tabula Muris Senis dataset in h5ad format can be downladed at http://snap.stanford.edu/mars/data/tms-facs-mars.tar.gz. Small-scale example datasets CellBench and Kolodziejczyk/Pollen can be downloaded at http://snap.stanford.edu/mars/data/cellbench_kolod_pollen.tgz.

Pretrained models for each tissue in Tabula Muris can be downladed from http://snap.stanford.edu/mars/data/TM_trained_models.tar.gz.

Citing

If you find our research useful, please consider citing:

@article{brbic2020mars,
  title={MARS: Discovering Novel Cell Types across Heterogeneous Single-cell Experiments},
  author={Brbic, Maria and Zitnik, Marinka and Wang, Sheng and Pisco, Angela O and Altman, 
          Russ B and Darmanis, Spyros and Leskovec, Jure},
  journal={Nature Methods},
  year={2020},
}

Contact

Please contact Maria Brbic at [email protected] for questions.

mars's People

Contributors

mbrbic avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.