Skip to main content

No project description provided

Project description

Steamboat

Documentation Status Unit and integration tests

Steamboat is an interpretable machine learning framework leveraging a self-supervised, multi-head attention model that uniquely decomposes the gene expression of a cell into multiple key factors:

  • intrinsic cell programs,
  • neighboring cell communication, and
  • long-range interactions.

These pieces of information are used to generate cell embedding, cell network, and reconstructed gene expression.

fig1-v3-abstract

System requirements

Hardware

Steamboat can run on a laptop, desktop, or server. The experiments were done on a desktop computer with a 6-core Ryzen 5 3600 CPU and an RTX 3080 GPU. A GPU can significantly reduce the time needed to train the models.

Operating system

Steamboat is python-based and run on all mainsteam operating systems. It has been tested on Windows 10 and Springdale Linux.

Software dependencies

Package Tested with
Python 3.11.5
Torch 2.1.2 (w/ cuda 12.1)
Scanpy 1.9.6
Squidpy 1.5.0
Scipy 1.11.4
Numpy 1.26.2
Networkx 3.1
Matplotlib 3.8.0
Seaborn 0.13.2
Scikit-learn 1.2.2

Installation

We recommend using Miniconda to create an virtual environment.

conda create -n steamboat
conda activate steamboat

Please follow the official guide to install the appropriate Pytorch version for you system and hardware. Then, please install the required packages with pip install -r requirements.txt.

Steamboat can be imported directly after adding its directory to the path.

git clone https://github.com/ma-compbio/Steamboat
import sys
sys.path.append("/path/of/the/cloned/repository")

Depending on your network, installation may take 10 to 30 minutes.

Basic workflow

import steamboat as sf # "sf" = "Steamboat Factorization"
import steamboat.tools

First, make a list (adatas) of one or more AnnData objects, and preprocess them.

adatas = sf.prep_adatas(adatas, log_norm=True)
dataset = sf.make_dataset(adatas)

Create a Steamboat model and fit it to the data.

model = sf.Steamboat(short_features, n_heads=10, n_scales=3)
model = model.to("cuda") # if you GPU acceleration is supported.
model.fit(dataset)

After training, you can check the trained metagenes.

sf.tools.plot_all_transforms(model, top=1)

For clustering and segmentation, run the following lines. Change the resolution to your liking.

sf.tools.neighbors(adata)
sf.tools.leiden(adata, resolution=0.1)
sf.tools.segment(adata, resolution=0.5)

Demos

A few examples in Jupyter notebook are included in the examples folder:

  1. Illustration (simulated)
  2. Ovarian cancer data
  3. Mouse brain
  4. Colorectal cancer data

The simulation demo takes about five minutes to run. The mouse brain data takes one hour to train. Other demos take about ten minutes each.

Data used in these examples are available in Google Drive. Trained models are also uploaded.

Documentation

For the full API and real data examples, please visit our documentation.

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

steamboat_bio-0.1.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

steamboat_bio-0.1.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file steamboat_bio-0.1.1.tar.gz.

File metadata

  • Download URL: steamboat_bio-0.1.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for steamboat_bio-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9d8e87fb7fa6e47156d772ba33228869c037018627b5abf6b103bd4f93fa111d
MD5 962643350b23cd659a03627f490d5f1a
BLAKE2b-256 47078037ba50e34b36fa396d3980457eb56efe1d4a4b6ef21ee5ef4aff004910

See more details on using hashes here.

Provenance

The following attestation bundles were made for steamboat_bio-0.1.1.tar.gz:

Publisher: pypi.yml on ma-compbio/Steamboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file steamboat_bio-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: steamboat_bio-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for steamboat_bio-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c98d8c52bf8cc734c3d74512e7ff45d0974900f3727e8976175ae47f3bf986b
MD5 316bdb4a8e1a95b0f6fbf93a811e79e6
BLAKE2b-256 a9574382d0b042e68eb0c577c1aeecfec7f923351ae079f6bb18009a2e7e902f

See more details on using hashes here.

Provenance

The following attestation bundles were made for steamboat_bio-0.1.1-py3-none-any.whl:

Publisher: pypi.yml on ma-compbio/Steamboat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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