Package: cytomulate
cytomulateA simulation package for Cytometry by Time-of-Flight (CyTOF)BranchReleaseCI/CDDocumentationCode CoveragemaindevInstallationYou can easily installcytomulatefrom eitherPyPIorconda. For the former, use the following command:pipinstallcytomulateOr if you are using a conda environment, you can use the following command:condainstall-cnormalizingflowcytomulateIf you wish to usePyCytoData, you can install separately with more instructionshere.DependenciesGood news: we didn't have to writecytomulatefrom scratch in assembly language! This means that we will need dependencies to install it. Below is a list of packages that you will need:numpyscipyscikit-learnnetworkxmatplotlibtqdmMost of these are pretty standard! And even better news: the installation instructions should automatically handle all the dependency issues. If you have a problem with installation, let us know and we're happy to help!While the above are all core dependencies, we highly highly highly highly highly recommendPyCytoDataas well! You can get all the benefits of an integrated pipeline! But of course, for those of you who don't fancy more dependencies, we understand as well!ExamplesWe have two modes:Creation ModeandEmulation 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 ModeTo create your datasets, you can run the following:>>>fromcytomulateimportCreationCytofData>>>cytof_data=CreationCytofData()>>>cytof_data.initialize_cell_types()>>>expression_matrices,labels,_,_=cytof_data.sample(n_samples=1000)Theexpression_matricesis a dictionary that contains the expression matrix from each sample. Correspondingly,labelsis a dictionary that contains their cell types.Emulation ModeThis 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 usePyCytoDatato load some example datasets instead (Of course, you will need to installPyCytoDatafirst if you wish to use it):>>>fromcytomulateimportEmulationCytoData>>>fromPyCytoDataimportDataLoader>>>exprs=DataLoader.load_dataset(dataset="levine13")>>>exprs.preprocess(arcsinh=True)>>>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 PyCytoDataWe're fully compatible withPyCytoData! As you've seen above, you can usePyCytoDatato download datasets! If you're familiar with that interface and in love with its easy workflow, you can havecytomulateoutput aPyCytoDataobject as well:>>>fromcytomulateimportCreationCytofData>>>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 ofPyCytoData.Command-Line Interface (CLI)If you prefer to use cytomulate from the command-line, you've got that option as well! Onecaveatis that this mode requiresPyCytoDatato be installed. To run the Creation Mode, you can do:python-mcytomulate\--creation\--n_cells1000\-o<your_dir_here>To run the emulation mode, you can run the following:python-mcytomulate\--emulation\--n_cells1000\-o<your_dir_here>\--exprs<you_path_to_exprssion_matrix>\--cell_types<you_path_to_cell_types>Of course, we have much more customization options! For more details, read ourtutorial here.DocumentationFor more detailed documentation oncytomulate, please visit ourwebsite! 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 guidehere!Latest Release: v0.2.0Welcome to Cytomulate v0.2.0! Hooray! We are not only bringing documentation enhancements, but we
are also introducing a new feature for more accurate simulations!Changes and New FeaturesTheutilities.univariate_noise_model()method:Addedhalf_normaloption to thenoise_distributionparameterChanged the defaultnoise_distributiontouniform(This is abreaking changebecause of the benefits to simulated results).A warning is given when no user-specifiednoise_distributionis supplied to warn the breaking changeAdded theutilities.estimate_noise_model()method to estimate the noise present in the dataAdded a built-in estimation procedure to match the amount of zeroes observed in the datasetImprovementsAdded 4 more detailed tutorials onour documentation website <https://cytomulate.readthedocs.io>_Improved docstrings with more details on key parametersUpdated the lastest references and linksReferencesIf you are cytomulating in your workflow, citingour paperis 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}
}