Skip to main content

SnapCCESS

A python package to generate ensemble deep learning of embeddings for clustering multimodal single-cell omics data

Installation

Stable version

pip install snapccess  --index-url https://pypi.org/simple

https://pypi.org/project/snapccess/

Development version

pip install snapccess  --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple

https://test.pypi.org/project/snapccess/

The functions in this package are described below.

snapshotVAE

Description

To create the VAE model

Usage

model = snapshotVAE(num_features=[nfeatures_rna,nfeatures_pro], num_hidden_features=[hidden_rna2,hidden_pro2], z_dim=z_dim)

Arguments

  • num_features: a list of number of features of each modality
  • num_hidden_features: the number of hidden features we will used in training the model, in our paper, we use hidden_rna=185, and hidden_pro=30
  • z_dim: dimension of the latent space, in our paper, we use z_dim=100

Output

A VAE model


train_model

Description

Training a VAE model with Snapshot learning rate or constant learning rate

Usage

model,histroy,embedding = train_model(model, train_dl, valid_dl, lr=lr, epochs=epochs,epochs_per_cycle=epochs_per_cycle, save_path=\"\",snapshot=True,embedding_number=1)

Arguments

  • model: a vae model
  • train_dl: training dataset
  • valid_dl: validation dataset
  • lr: initial learning rate
  • epochs: total number of train cycles for snapshot ensemble vae
  • epochs_per_cycle: the number of epochs per cycle
  • save_path: the output file path of embeddings, by default leave it blank will not save any embeddings into the save_path, but the train_model will return the embeddings
  • snapshot: a boolean value to indicate the model whether to use the snapshot ensemble method or the traditional VAE method (with constant learning rate)
  • embeddings_number: a value to indicate the index of embeddings in the output filename when apply the traditional VAE

Output

This function will return the model, the loss of training and validation dataset (history) and a list of the latent space embeddings (for Snapshot ensemble method) or a single embedding for traditional VAE method.


get_encodings

Description

To get the embeddings from model after training.

Usage

embedding = get_encodings(model,valid_dl)

Arguments

  • model: a VAE model
  • valid_dl: the dataset that used as input to training the VAE model

Output

Embedding of the valid_dl dataset in the VAE model, to convert it to a matrix, try pd.DataFrame(embedding.cpu().numpy())


nvidia_info

Description

To monitor the memory usage of GPU

Usage

memory = nvidia_info(pid)['memory']

Arguments

  • pid: the pid of running script

Output

This function will return the memory usage of the pid process.

Metadata

Release files for SnapCCESS 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SnapCCESS 0.2.2
File Size Uploaded
snapccess-0.2.2.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SnapCCESS 0.2.2
File Interpreter ABI Platform
snapccess-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / snapccess-0.2.2.tar.gz

Download URL snapccess-0.2.2.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
617664324f55a2f3f14a3e7e01d4acea5fc2ee311be60dff144e2746f25b9a30
BLAKE2b-256 checksum
How to use checksums
0bc3dfc9f7f2304a8cd1005088c296314e59505b7248bbb2b4a1c8ee0c3c924e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.8.17 Linux/6.7+pk12.52

Release files / snapccess-0.2.2-py3-none-any.whl

Download URL snapccess-0.2.2-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
772dc7ad167e773ecd47cafc0a319e6561f384f8852a394e248b5cb891dec93d
BLAKE2b-256 checksum
How to use checksums
5039aa24cfb2001c8dcd0041b55884698eb91e537b2c8bac5e5f3d4aaf3634e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.8.17 Linux/6.7+pk12.52

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.1.9

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page