Skip to main content

Scalable, Interpretable Deep Learning for Single-Cell RNA-seq Classification

Project description

SIMS: Scalable, Interpretable Modeling for Single-Cell RNA-Seq Data Classification

SIMS is a pipeline for building interpretable and accurate classifiers for intentifying any target on single-cell rna-seq data. The SIMS model is based on TabNet, a self-attention based model specifically built for large-scale tabular datasets.

SIMS takes in a list of arbitrarily many expression matrices along with their corresponding target variables. The expression matrices may be AnnData objects with format h5ad, or .csv. They must be in the matrix form cell x gene, and NOT gene x cell, since our training samples are the transcriptomes of individual cells.

The data is formated like so:

  • All matrices are cell x expression
  • All label files contain a common column, known as the class_label, on which to train the model
  • datafiles and labelfiles are the absolute paths to the expression matrices and labels, respectively

A call to generate and train the SIMS model looks like the following:

import torch 
from scsims import generate_trainer

trainer, model, data = generate_trainer(
    datafiles=['cortical_cells.csv', 'cortical_cells_2.csv', 'external/cortical_cells_3.h5ad'], # Notice we can mix and match file types
    labelfiles=['l1.csv', 'l2.csv', 'l3.csv'],
    class_label='cell_state', # Train to predict cell state!
    batch_size=4,
    optim_params = {
        'optimizer': torch.optim.Adam,
        'lr': lr, 
        'weight_decay': weight_decay,
    },
)

trainer.fit(model, datamodule=data)

This will train a derivation of the TabNet model on the given expression matrices with target variable given by the class_label column in each label file.

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

scsims-0.0.5.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scsims-0.0.5-py2.py3-none-any.whl (25.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file scsims-0.0.5.tar.gz.

File metadata

  • Download URL: scsims-0.0.5.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.5

File hashes

Hashes for scsims-0.0.5.tar.gz
Algorithm Hash digest
SHA256 680e62084c06c03b4042504c885ca24120a3317e83d1e902cbf7d513ff38ad44
MD5 535fce62014a8e57697547c21c88f855
BLAKE2b-256 bf43660c15e85e65231a1d024f439e933416958342528c8407ba7da0eae31682

See more details on using hashes here.

File details

Details for the file scsims-0.0.5-py2.py3-none-any.whl.

File metadata

  • Download URL: scsims-0.0.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.5

File hashes

Hashes for scsims-0.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ca89a22da636095d28e0f627f0aae1ad2edb880ea5cb3eefca7d6f1518956024
MD5 0473a35dd67023d511e9bf3a0c2a9696
BLAKE2b-256 d342e07f452b3287f14d03d207470693deece764880cc1501881002df420c45d

See more details on using hashes here.

Supported by

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