Getting Started...
Here, we introduce CellPhenoX, an eXplainable machine learning method to identify cell-specific phenotypes that influence clinical outcomes for single-cell data. CellPhenoX integrates robust classification models, explainable AI techniques, and a statistical covariate framework to generate interpretable, cell-specific scores that uncover cell populations associated with a clinical phenotype of interest.
Figure 1. CellPhenoX leverages cell neighborhood co-abundance embeddings, Xi , across samples and clinical variable Y as inputs. By applying an adapted SHAP framework for classification models, CellPhenoX generates Interpretable Scores that quantify the contribution of each feature Xi, along with covariates and interaction term Xi, to the prediction of a clinically relevant phenotype Y. The results are visualized at single-cell level, showcasing Interpretable Scores at low-dimensional space, correlated cell type annotations, and associated marker genes.
You can install pyCellPhenoX from PyPI:
pip install pyCellPhenoX
github (link):
# install pyCellPhenoX directly from github
git clone git@github.com:fanzhanglab/pyCellPhenoX.git
Dependencies/ Requirements
When using pyCellPhenoX please ensure you are using the following dependency versions or requirements
python = "^3.9"
pandas = "^2.2.3"
numpy = "^1.26"
xgboost = "^2.1.1"
numba = ">=0.54"
scikit-learn = "^1.5.2"
matplotlib = "^3.9.2"
statsmodels = "^0.14.3"
fasttreeshap = "0.1.6"
shap = "^0.45"
met-brewer = "^1.0.2"
Tutorials
Please see the Command-line Reference for details. Additonally, please see Vignettes on the documentation page.
API
pyCellPhenoX has four major functions which are apart of the object:
- split_data() - Split the data into training, testing, and validation sets
- model_train_shap_values() - Train the model using nested cross validation strategy and generate shap values for each fold/CV repeat
- get_shap_values() - Aggregate SHAP values for each sample
- get_intepretable_score() - Calculate the interpretable score based on SHAP values.
Additional major functions associated with pyCellPhenoX are:
- marker_discovery() - Identify markers correlated with the discriminatory power of the Interpretable Score.
- nonNegativeMatrixFactorization() - Perform non Negative Matrix Factorization (NMF)
- preprocessing() - Prepare the data to be in the correct format for CellPhenoX
- principleComponentAnalysis() - Perform Principle Component Analysis (PCA)
Each function has uniqure arguments, see our documentation for more information
License
Distributed under the terms of the MIT license, pyCellPhenoX is free and open source software.
Code of Conduct
For more information please see Code of Conduct or Code of Conduct Documentation
Contributing
For more information please see Contributing or Contributing Documentation
Issues
If you encounter any problems, please file an issue along with a detailed description.
Citation
If you have used pyCellPhenoX in your project, please use the citation below:
Young, J., Inamo, J., Caterer, Z., Krishna, R., Zhang, F. CellPhenoX: An Explainable Machine Learning Method for Identifying Cell Phenotypes To Predict Clinical Outcomes from Single-Cell Multi-Omics. Advanced Science, http://doi.org/10.1002/advs.202503289, 2025
Contact
Please contact fanzhanglab@gmail.com for further questions or protential collaborative opportunities!
Metadata
Release files for pyCellPhenoX 1.5.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 | |
|---|---|---|---|
| pycellphenox-1.5.1.tar.gz | 95.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pycellphenox-1.5.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 116.6 kB
Release files / pycellphenox-1.5.1.tar.gz
| Download URL | pycellphenox-1.5.1.tar.gz |
|---|---|
| Size | 95.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc8f0256afb49fdaec675aafb1ef6cc4624b4d9f8775aee3efc2af7e19430b9d
|
|
BLAKE2b-256 checksum How to use checksums |
7cad24bdab42b4732f531f68b132329b6d819a7662becbe97c7d4f82e77ffe3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.12.6 Darwin/24.5.0
|
Release files / pycellphenox-1.5.1-py3-none-any.whl
| Download URL | pycellphenox-1.5.1-py3-none-any.whl |
|---|---|
| Size | 20.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53ef2c82bcdceb772e1382a676d88aa65181c28b632909fb3a9ac58ebac1aaee
|
|
BLAKE2b-256 checksum How to use checksums |
c2d1e50463412d55d8a71838b31ad6368b3f3d6c3313657839e653928afc6348
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.12.6 Darwin/24.5.0
|