# TMEImmune
`TMEImmune` is a Python package that implements the ESTIMATE algorithm, ISTMEscore method, NetBio method, and SIA method. The ESTIMATE and ISTMEscore methods were originally available only in R, and we've ported them to Python for broader accessibility. Additionally, the NetBio and SIA methods, which did not have existing packages, has been manually implemented in Python following the original publications and codes.
## Features
- Implementation of the ESTIMATE algorithm for estimating stromal, immune and estimate scores in tumor samples. Estimate tumor purity for Affymetrix platform data.
- Implementation of the ISTMEscore method for improved tumor microenvironment (TME) immune and stromal scoring. The ISTME TME subtypes are also provided.
- Novel implementation of the NetBio and SIA method for comprehensive TME analysis.
- Data pre-processing including normalization and batch correction for both unnormalized read counts and normalized data.
- Performance evaluation for immune checkpoint inhibitor response prediction and survival prognosis.
## Requirement
The installation of TMEImmune requires python version 3.10 and above.
## Installation
You can install the package via the following two commands:
```bash
pip install TMEImmune
pip install git+https://github.com/qiluzhou/TMEImmune.git
```
## Usage
Here are some basic usage examples:
Example 1:
```
import pandas as pd
from TMEImmune import data_processing
from TMEImmune import TME_score
from TMEImmune import optimal
# Step 1: Data Normalization
clin = pd.read_csv("example_clin.csv", index_col = 0)
df = data_processing.normalization(path = "example_gene.csv", method = 'TMM', batch = clin, batch_col = "CANCER")
# Step 2: Compute TME score
score = TME_score.get_score(df, method = ['ESTIMATE','ISTME', 'NetBio', 'SIA'], clin = clin, test_clinid = "response")
# Step 3: Performance comparison
outcome = optimal.get_performance(score, metric = ['ICI', 'survival'],
score_name = ['EST_stromal','EST_immune','IS_immune', 'IS_stromal','NetBio','SIA'],
ICI_col = 'response', surv_col = ['time', 'delta'], df_clin = clin)
```
Example 2:
```
gene = pd.read_excel("riaz.xlsx", sheet_name=0, index_col=0)
clin = pd.read_excel("riaz.xlsx", sheet_name=1, index_col = 1)
clin = clin.loc[clin.index.str.contains("Pre", na=False)]
clin['delta'] = clin['Dead/Alive\n(Dead = True)'].apply(lambda x: 1 if x == True else 0)
clin['OS'] = clin['Time to Death\n(weeks)']
df_norm = data_processing.normalization(gene, batch = clin, batch_col = "Cohort")
score = TME_score.get_score(df_norm, method = ['ESTIMATE','ISTME', 'NetBio', 'SIA'], clin = clin, test_clinid = "response")
outcome = optimal.get_performance(score, metric = ['ICI', 'survival'],
score_name = ['EST_stromal','EST_immune','IS_immune', 'IS_stromal','NetBio','SIA'],
ICI_col = 'response', surv_col = ['delta', 'OS'], df_clin = clin, name = "Riaz et al.")
```
## License
This project is licensed under the MIT License. See the LICENSE file for more details.
## Contact
If you have any questions or feedback, feel free to open an issue on GitHub Issues. We also welcome contributions for integrating new TME scores into our package. If you'd like to propose a method, please attach a link to its introduction in the Github issue, and we will evaluate it accordingly.
## Acknowledgements
The ESTIMATE algorithm from Yoshihara et al.
The ISTMEscore method from Zeng et al.
The NetBio method from Kong et al.
The SIA method from Mezheyeuski et al.
## Citations
If you use `TMEImmune` in your research, please cite the following papers:
Yoshihara, K., Shahmoradgoli, M., Martínez, E. et al. Inferring tumour purity and stromal and immune cell admixture from expression data. Nat Commun 4, 2612 (2013). https://doi.org/10.1038/ncomms3612
Zeng, Z., Li, J., Zhang, J. et al. Immune and stromal scoring system associated with tumor microenvironment and prognosis: a gene-based multi-cancer analysis. J Transl Med 19, 330 (2021). https://doi.org/10.1186/s12967-021-03002-1
Kong, J., Ha, D., Lee, J., Kim, I., Park, M., Im, S. H., ... & Kim, S. (2022). Network-based machine learning approach to predict immunotherapy response in cancer patients. Nature communications, 13(1), 3703. https://doi.org/10.1038/s41467-022-31535-6
Mezheyeuski, A., Backman, M., Mattsson, J., Martín-Bernabé, A., Larsson, C., Hrynchyk, I., Hammarström, K., Ström, S., Ekström, J., Mauchanski, S., Khelashvili, S., Lindberg, A., Agnarsdóttir, M., Edqvist, P. H., Huvila, J., Segersten, U., Malmström, P. U., Botling, J., Nodin, B., Hedner, C., … Sjöblom, T. (2023). An immune score reflecting pro- and anti-tumoural balance of tumour microenvironment has major prognostic impact and predicts immunotherapy response in solid cancers. EBioMedicine, 88, 104452. https://doi.org/10.1016/j.ebiom.2023.104452
Raw data
{
"_id": null,
"home_page": "https://github.com/qiluzhou/TMEImmune",
"name": "TMEImmune",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "python, TME score",
"author": "Qilu Zhou",
"author_email": "<qiluzhou@umass.edu>",
"download_url": "https://files.pythonhosted.org/packages/45/14/691189905b4059524b63bd3dab4128034f6d20e3f067d36ad3107a4daab3/tmeimmune-1.3.0.tar.gz",
"platform": null,
"description": "# TMEImmune\n\n`TMEImmune` is a Python package that implements the ESTIMATE algorithm, ISTMEscore method, NetBio method, and SIA method. The ESTIMATE and ISTMEscore methods were originally available only in R, and we've ported them to Python for broader accessibility. Additionally, the NetBio and SIA methods, which did not have existing packages, has been manually implemented in Python following the original publications and codes.\n\n## Features\n\n- Implementation of the ESTIMATE algorithm for estimating stromal, immune and estimate scores in tumor samples. Estimate tumor purity for Affymetrix platform data. \n- Implementation of the ISTMEscore method for improved tumor microenvironment (TME) immune and stromal scoring. The ISTME TME subtypes are also provided.\n- Novel implementation of the NetBio and SIA method for comprehensive TME analysis.\n- Data pre-processing including normalization and batch correction for both unnormalized read counts and normalized data.\n- Performance evaluation for immune checkpoint inhibitor response prediction and survival prognosis.\n\n## Requirement\n\nThe installation of TMEImmune requires python version 3.10 and above.\n\n\n## Installation\n\nYou can install the package via the following two commands:\n\n```bash\npip install TMEImmune\npip install git+https://github.com/qiluzhou/TMEImmune.git\n```\n\n\n## Usage\n\nHere are some basic usage examples:\n\nExample 1:\n```\nimport pandas as pd\nfrom TMEImmune import data_processing\nfrom TMEImmune import TME_score\nfrom TMEImmune import optimal\n\n# Step 1: Data Normalization\nclin = pd.read_csv(\"example_clin.csv\", index_col = 0)\ndf = data_processing.normalization(path = \"example_gene.csv\", method = 'TMM', batch = clin, batch_col = \"CANCER\")\n\n# Step 2: Compute TME score\nscore = TME_score.get_score(df, method = ['ESTIMATE','ISTME', 'NetBio', 'SIA'], clin = clin, test_clinid = \"response\")\n\n# Step 3: Performance comparison\noutcome = optimal.get_performance(score, metric = ['ICI', 'survival'], \n score_name = ['EST_stromal','EST_immune','IS_immune', 'IS_stromal','NetBio','SIA'], \n ICI_col = 'response', surv_col = ['time', 'delta'], df_clin = clin)\n```\n\nExample 2:\n```\ngene = pd.read_excel(\"riaz.xlsx\", sheet_name=0, index_col=0)\nclin = pd.read_excel(\"riaz.xlsx\", sheet_name=1, index_col = 1)\nclin = clin.loc[clin.index.str.contains(\"Pre\", na=False)]\nclin['delta'] = clin['Dead/Alive\\n(Dead = True)'].apply(lambda x: 1 if x == True else 0)\nclin['OS'] = clin['Time to Death\\n(weeks)']\ndf_norm = data_processing.normalization(gene, batch = clin, batch_col = \"Cohort\")\n\nscore = TME_score.get_score(df_norm, method = ['ESTIMATE','ISTME', 'NetBio', 'SIA'], clin = clin, test_clinid = \"response\")\n\noutcome = optimal.get_performance(score, metric = ['ICI', 'survival'], \n score_name = ['EST_stromal','EST_immune','IS_immune', 'IS_stromal','NetBio','SIA'], \n ICI_col = 'response', surv_col = ['delta', 'OS'], df_clin = clin, name = \"Riaz et al.\")\n```\n\n## License\nThis project is licensed under the MIT License. See the LICENSE file for more details.\n\n## Contact\nIf you have any questions or feedback, feel free to open an issue on GitHub Issues. We also welcome contributions for integrating new TME scores into our package. If you'd like to propose a method, please attach a link to its introduction in the Github issue, and we will evaluate it accordingly. \n\n## Acknowledgements\nThe ESTIMATE algorithm from Yoshihara et al.\nThe ISTMEscore method from Zeng et al.\nThe NetBio method from Kong et al.\nThe SIA method from Mezheyeuski et al.\n\n## Citations\n\nIf you use `TMEImmune` in your research, please cite the following papers:\n\nYoshihara, K., Shahmoradgoli, M., Mart\u00ednez, E. et al. Inferring tumour purity and stromal and immune cell admixture from expression data. Nat Commun 4, 2612 (2013). https://doi.org/10.1038/ncomms3612\n\nZeng, Z., Li, J., Zhang, J. et al. Immune and stromal scoring system associated with tumor microenvironment and prognosis: a gene-based multi-cancer analysis. J Transl Med 19, 330 (2021). https://doi.org/10.1186/s12967-021-03002-1\n\nKong, J., Ha, D., Lee, J., Kim, I., Park, M., Im, S. H., ... & Kim, S. (2022). Network-based machine learning approach to predict immunotherapy response in cancer patients. Nature communications, 13(1), 3703. https://doi.org/10.1038/s41467-022-31535-6\n\nMezheyeuski, A., Backman, M., Mattsson, J., Mart\u00edn-Bernab\u00e9, A., Larsson, C., Hrynchyk, I., Hammarstr\u00f6m, K., Str\u00f6m, S., Ekstr\u00f6m, J., Mauchanski, S., Khelashvili, S., Lindberg, A., Agnarsd\u00f3ttir, M., Edqvist, P. H., Huvila, J., Segersten, U., Malmstr\u00f6m, P. U., Botling, J., Nodin, B., Hedner, C., \u2026 Sj\u00f6blom, T. (2023). An immune score reflecting pro- and anti-tumoural balance of tumour microenvironment has major prognostic impact and predicts immunotherapy response in solid cancers. EBioMedicine, 88, 104452. https://doi.org/10.1016/j.ebiom.2023.104452\n\n\n\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Python package for calculating TME scores",
"version": "1.3.0",
"project_urls": {
"Homepage": "https://github.com/qiluzhou/TMEImmune"
},
"split_keywords": [
"python",
" tme score"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "b643d9e741bb063bc6b1acaf1913a2e810b3b2f4a9af1c156ba03693c4c39262",
"md5": "b0c8d8177a8291c2c6a52d74a9edbc9c",
"sha256": "23589af2dfd28cf2e9ad5e47e1da2aeb2d9f1beb22487b1c925fbca1320720ec"
},
"downloads": -1,
"filename": "tmeimmune-1.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b0c8d8177a8291c2c6a52d74a9edbc9c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 11396581,
"upload_time": "2025-03-09T18:36:32",
"upload_time_iso_8601": "2025-03-09T18:36:32.834153Z",
"url": "https://files.pythonhosted.org/packages/b6/43/d9e741bb063bc6b1acaf1913a2e810b3b2f4a9af1c156ba03693c4c39262/tmeimmune-1.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4514691189905b4059524b63bd3dab4128034f6d20e3f067d36ad3107a4daab3",
"md5": "8bad36b43b97a8781f2a54dbae51add8",
"sha256": "06042c72b37e74f32ef63cb989f41e175e7c2f056bcdf93a1d47fbd846b9b19f"
},
"downloads": -1,
"filename": "tmeimmune-1.3.0.tar.gz",
"has_sig": false,
"md5_digest": "8bad36b43b97a8781f2a54dbae51add8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 11301855,
"upload_time": "2025-03-09T18:36:37",
"upload_time_iso_8601": "2025-03-09T18:36:37.253504Z",
"url": "https://files.pythonhosted.org/packages/45/14/691189905b4059524b63bd3dab4128034f6d20e3f067d36ad3107a4daab3/tmeimmune-1.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-09 18:36:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "qiluzhou",
"github_project": "TMEImmune",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tmeimmune"
}