Skip to main content

An unsupervised model for the integrative analysis of single-cell multiomics data, coded in the deep universal probabilistic program Pyro

Project description

iPoLNG

This is an unsupervised model for the integrative analysis of single-cell multiomics data, coded in the deep universal probabilistic program Pyro.

Dependency

This package relies on PyTorch to run. Please install the correct CUDA version that matches your Operating System on the official website. The exact version of the dependent packages can be found in requirements.txt.

Installation

Please install the iPoLNG package using the following command in the command line:

pip install iPoLNG

Usage

The main function in this package is iPoLNG.iPoLNG. The input consists of the following:

W: a dictionary with each value being torch.tensor. Each value represents the count matrix for one data modality, with rows being cells and columns being features.

num_topics: the number of topics or latent factors.

alpha_k: The shape parameter for the inverse gamma distribution in the prior. The default value is 1.

integrated_epochs: The number of epochs to run in the stochastic variational inference algorithm for iPoLNG. The default value is 3000.

warmup_epochs: The number of epochs to run in the stochastic variational inference algorithm for PoLNG (as a warm-up step). The default value is 3000.

lr: The learning rate in the stochastic variational inference algorithm. The default value is 0.1. You may adjust it according to the characteristics of the data.

seed: The random seed used in the iPoLNG model. The default value is 42.

verbose: A boolean value. Set to True if you would like to show the learning progress in the model. The default value is True.

Here's the example code for a quick start:

from iPoLNG import iPoLNG
import torch
torch.set_default_tensor_type("torch.cuda.FloatTensor" if torch.cuda.is_available() else "torch.FloatTensor") # enable GPU acceleration if possible
W = iPoLNG.load_example_data()
model = iPoLNG.iPoLNG(W, num_topics=20, integrated_epochs=300, warmup_epochs=500, seed=42, verbose=True)
result = model.Run()

result is a dictionary consisting of the following keys:

L_est: a cell by latent factor matrix, interpreted as the low-dimensional representation of the cells.

Ls_est: a dictionary consisting of several cell by latent factor matries, each interpreted as the low-dimensional representation of the cells in the corresponding individual data modality.

Thetas_est: a dictionary consisting of several latent factor by feature matries, each interpreted as the feature scores in the corresponding individual data modality.

time: the running time for the algorithm (including the warm-up step) in seconds.

loss: a dictionary consisting of the loss (i.e. negative ELBO in the stochastic variational inference algorithm) for individual data modality in the warm-up step and integrated data in the iPoLNG model.

alpha0s: a dictionary consisting of the hyperparameters that control the levels of noise across different data modalities in the iPoLNG model.

Please refer to the vignette for the outputs of the example code.

Reference

To be completed.

Bug reports

If you encounter any problem when using this package, please feel free to open an issue.

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

iPoLNG-0.0.2.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

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

iPoLNG-0.0.2-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file iPoLNG-0.0.2.tar.gz.

File metadata

  • Download URL: iPoLNG-0.0.2.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.0

File hashes

Hashes for iPoLNG-0.0.2.tar.gz
Algorithm Hash digest
SHA256 18c44d0a32cf16c0e2ba4229445fce2e0cc62b04691a09e47d86637a9f654a89
MD5 4a84653cd5ad200102961788ba3b487b
BLAKE2b-256 dc5d55f1fcba3caca0c67d100336b3666faaf7ecb4bc8e24c99e10cfa3276d36

See more details on using hashes here.

File details

Details for the file iPoLNG-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: iPoLNG-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.0

File hashes

Hashes for iPoLNG-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e98f2a230c3c53c0e44a7c55db59b454a8dd6255f81c4f1ebe6c436b217aa1e
MD5 7b70eecea2c2ce9f45a50a5d45cb95f0
BLAKE2b-256 42ba4f8f64442a0f3a51b0258833f3c33389a470fd4987d09b60731bc77b6830

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