SCOT
SCOT is an implementation of a probabilistic tensor decomposition framework for single-cell multi-omics data integration. SCOT accepts the input of datasets from multiple omics, with missing values allowed.
Getting started
Prerequisite
- numpy
- pytorch 1.9.0
Install
pip install SCOT-bio
Examples
This is an example of multiple datasets when features have corresponding information.
from scot import sc_multi_omics
data = np.array([expression_data, methylation_data])
sc_model = sc_multi_omics()
predict_data = sc_model.fit(data) # the imputed data
np.savetxt("global_cell_embeddings.csv", sc_model.C, delimiter = ',') # global cell embeddings
np.savetxt("global_gene_embeddings.csv", sc_model.G, delimiter = ',') # global gene embeddings
np.savetxt("local_cell_embeddings.csv", sc_model.C, delimiter = ',') # omics-specific cell embeddings
np.savetxt("local_gene_embeddings.csv", sc_model.G, delimiter = ',') # omics-specific gene embeddings
When the features of different omics do not have corresponding information, please use the fit_list function, which accepts the input as a list of matrices.
from scot import sc_multi_omics
data = [expression_data, protein_data]
sc_model = sc_multi_omics()
predict_data = sc_model.fit_list(data)
If the input does not contain missing values ("NA"), we provide fit_complete and fit_list_complete functions to accelerate the optimization since they take advantage of matrix operations.
from scot import sc_multi_omics
data = np.array([expression_data, methylation_data])
sc_model = sc_multi_omics()
predict_data = sc_model.fit_complete(data) # the imputed data
from scot import sc_multi_omics
data = [expression_data, protein_data]
sc_model = sc_multi_omics()
predict_data = sc_model.fit_list_complete(data)
We put the complete scripts for the analysis described in the manuscript under examples/ directory for detailed usage examples and reproduction. The example data can be downloaded from Google Drive.
Parameters
sc_multi_omics
K1: The local element-wise product parameter, see the manuscript for details (default=20).K2: The local element-wise product parameter (default=20).K3: The local element-wise product parameter (default=20).random_seed: The random seed used in optimization (default=111).
fit
opt: The optimization algorithm for gradient descent, including SGD, Adam, Adadelta, Adagrad, AdamW, SparseAdam, Adamax, ASGD, LBFGS (default="Adam").dist:The distribution used for modeling, including gaussian, poisson, negative_bionomial (default="gaussian").lr: The learning rate for gradient descent (default=1e-2).n_epochs: The number of optimization epochs (default=1000).lambda_C_regularizer: The coefficient for the penalty term of global cell embeddings (default=0.01).lambda_G_regularizer: The coefficient for the penalty term of global gene embeddings (default=0.01).lambda_O_regularizer: The coefficient list for the penalty term of global omics embeddings; the length of the list should be the same with the number of omics (default=[0.01, 0.01]).lambda_OC_regularizer: The coefficient list for the penalty term of omics-specific cell embeddings; the length of the list should be the same with the number of omics, not avaiable for complete functions (default=[1, 1]).lambda_OG_regularizer: The coefficient list for the penalty term of omics-specific gene embeddings, the length of the list should be the same with the number of omics, not avaiable for list functions (default=[1, 1]).batch_size: The batch size used for gradient descent, not avaiable for complete functions (default=1000).device: CPU or GPU (default='cuda' if torch.cuda.is_available() else 'cpu').verbose: Whether to print loss for each epoch (default=True).
Maintainer
WANG Ruohan ruohawang2-c@my.cityu.edu.hk
Metadata
Release files for SCOT-bio 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| SCOT-bio-0.0.1.tar.gz | 5.9 kB | Without provenance | Details for SCOT-bio-0.0.1.tar.gz |
Release files / SCOT-bio-0.0.1.tar.gz
| Download URL | SCOT-bio-0.0.1.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
699b338ce7c8ff1eeb2cb4497c051dc9e8b0fb5c64a3e0033e2d310445b839ae
|
|
BLAKE2b-256 checksum How to use checksums |
f1b81e580c5db017c98b6e255cb9ad3d4d0ad5e24e2c0388d1b9efd007a31694
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.24.0 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.47.0 importlib-metadata/4.11.3 keyring/21.2.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.3
|
Security for SCOT-bio 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.