Accurate and Efficient Simulation of CyTOF data
Project description
cytomulate
A simulation package for Cytometry by Time-of-Flight (CyTOF)
Branch | Release | CI/CD | Documentation | Code Coverage |
---|---|---|---|---|
main | ||||
dev |
Installation
You can easily install cytomulate
from either PyPI
or conda
. For the former, use the following command:
Or if you are using a conda environment, you can use the following command:
If you wish to use PyCytoData
, you can install separately with more instructions here.
Examples
We have two modes: Creation Mode and Emulation Mode. The former is probabilistic-model based simulation without the need of datasets; the latter is based on existing datasets to match as much of the existing features as possible. Here, we give two quick examples of how they work.
Creation Mode
To create your datasets, you can run the following:
>>> from cytomulate import CreationCytofData
>>> cytof_data = CreationCytofData()
>>> cytof_data.initialize_cell_types()
>>> expression_matrices, labels, _, _ = cytof_data.sample(n_samples = 1000)
The expression_matricess
is a dictionary that contains the expression matrix from each sample. Correspondingly, labels
is a dictionary that contains their cell types.
Emulation Mode
This is a little bit more involved because we need existing data! If you already have your data, congratulations, you are good to go! For this demonstration, we use PyCytoData
to load some example datasets instead (Of course, you will need to install PyCytoData first if you wish to use it):
>>> from cytomulate import EmulationCytoData
>>> from PyCytoData import DataLoader
>>> exprs = DataLoader.load_dataset(dataset="levine13")
>>> cytof_data = EmulationCytofData()
>>> cytof_data.initialize_cell_types(expression_matrix=exprs.expression_matrix,
... labels=exprs.cell_types)
>>> expression_matrices, labels, _, _ = cytof_data.sample(n_samples = 1000)
This is it!
Working with PyCytoData
As you've seen above, you can use PyCytoData
to download datasets! If you're familiar with that interface and in love with its easy workflow, you can have cytomulate
output a PyCytoData
object as well:
>>> from cytomulate import CreationCytofData
>>> cytof_data = CreationCytofData()
>>> cytof_data.initialize_cell_types()
>>> simulation_data = cytof_data.sample_to_pycytodata(n_samples = 1000)
This will allow you to use all the downstream capabilities of PyCytoData
.
Documentation
For more detailed documentation on cytomulate
, please visit our website! You will find detailed tutorials,
guidelines, development guides, etc.
Our documentation is built automatically on the cloud! If you wish to build locally, check our detailed guide here!
Latest Release
This is our latest release:
References
If you are cytomulating in your workflow, citing our paper is appreciated:
@article {Yang2022.06.14.496200,
author = {Yang, Yuqiu and Wang, Kaiwen and Lu, Zeyu and Wang, Tao and Wang, Xinlei},
title = {Cytomulate: Accurate and Efficient Simulation of CyTOF data},
elocation-id = {2022.06.14.496200},
year = {2022},
doi = {10.1101/2022.06.14.496200},
publisher = {Cold Spring Harbor Laboratory},
URL = {https://www.biorxiv.org/content/early/2022/06/16/2022.06.14.496200},
eprint = {https://www.biorxiv.org/content/early/2022/06/16/2022.06.14.496200.full.pdf},
journal = {bioRxiv}
}
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
Built Distribution
Hashes for cytomulate-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25825ed57d4f05e2327fbba395448f09ea52a73a6c65b82b04565404d4354f27 |
|
MD5 | 00611fe0e40bfd4a9880fae9fd2706fd |
|
BLAKE2b-256 | c62bb9afa7af961c3709512c4ff00931a927faa0756132586286d005b8bfef6b |