cosmopharm


Namecosmopharm JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/ivanantolo/cosmopharm,
SummaryPredictive modeling for drug-polymer compatibility in pharmaceutical formulations using COSMO-SAC.
upload_time2024-07-26 19:20:24
maintainerMartin Klajmon
docs_urlNone
authorIvan Antolovic
requires_python>=3.8
licenseMIT
keywords drug-polymer compatibility amorphous solid dispersions pharmaceutical formulation cosmo-sac model solubility prediction miscibility analysis phase behavior prediction pharmaceutical sciences drug formulation research polymer science predictive modeling in pharma drug development tools biopharmaceuticals
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # COSMOPharm

Welcome to the COSMOPharm package, accompanying [our paper in *Molecular Pharmaceutics*](https://doi.org/10.1021/acs.molpharmaceut.4c00342). This project and its associated publication offer insights and a practical toolkit for researching drug-polymer and drug-solvent systems, aiming to provide the scientific community with the means to reproduce our findings and further the development of COSMO-SAC-based models.

<p align="center">
  <!-- <img src="https://github.com/usnistgov/COSMOSAC/raw/master/JCTC2020.PNG" alt="TOC Figure" width="500"> -->
  <img src="https://github.com/ivanantolo/cosmopharm/raw/main/TOC.png" alt="TOC Figure">
</p>

## About 

COSMOPharm is a Python package designed to streamline the predictive modeling of drug-polymer compatibility, crucial for the development of pharmaceutical amorphous solid dispersions. Apart from that, it can also be used for the miscibility/solubility of drugs with/in common solvents. Leveraging the COSMO-SAC (Conductor-like Screening Model Segment Activity Coefficient) model, COSMOPharm offers a robust platform for scientists and researchers to predict solubility, miscibility, and phase behavior in drug formulation processes.

## Features

- **Compatibility Prediction**: Utilize open-source COSMO-SAC model for prediction of drug-polymer compatibility.
- **Solubility Calculation**: Calculate drug-polymer solubilities to guide the selection of suitable polymers for drug formulations.
- **Miscibility and Phase Behavior Analysis**: Analyze the miscibility of drug-polymer pairs and understand their phase behavior under various conditions.
- **User-friendly Interface**: Easy-to-use functions and comprehensive documentation to facilitate research and development in pharmaceutical sciences.

## Installation

Install COSMOPharm with pip:

`pip install cosmopharm`

Ensure you have installed the `cCOSMO` library as per instructions on the [COSMOSAC GitHub page](https://github.com/usnistgov/COSMOSAC).

## Quick Start

Get started with COSMOPharm using the minimal example below, which demonstrates how to calculate the solubility of a drug in a polymer. This example succinctly showcases the use of COSMOPharm for solubility calculations:


```python
import matplotlib.pyplot as plt
import cCOSMO
from cosmopharm import SLE, COSMOSAC
from cosmopharm.utils import create_components, read_params

# Define components
names = ['SIM','PLGA50']
params_file = "data/sle/table_params.xlsx"

# Load parameters and create components
parameters = read_params(params_file)
mixture = create_components(names, parameters)

# Initialize COSMO-SAC model - replace paths with your local paths to COSMO profiles
db = cCOSMO.DelawareProfileDatabase(
    "./profiles/_import_methods/UD/complist.txt",
    "./profiles/_import_methods/UD/sigma3/")

for name in names:
    iden = db.normalize_identifier(name)
    db.add_profile(iden)
COSMO = cCOSMO.COSMO3(names, db)

# Setup the COSMO-SAC model with components
actmodel = COSMOSAC(COSMO, mixture=mixture)

# Calculate solubility (SLE)
sle = SLE(actmodel=actmodel)
solubility = sle.solubility(mix='real')

# Output the solubility
print(solubility[['T', 'w', 'x']].to_string(index=False))

# Plot results
plt.plot(*solubility[['w','T']].values.T,'.-', label='Solubility (w)')

# Settings
plt.xlim(0,1)
plt.ylim(300,500)
# Adding title and labels
plt.title('Solubility vs. Temperature')
plt.ylabel("T / K")
xlabel = {'w':'Weight', 'x':'Mole'}
plt.xlabel(f"Weight fraction {mixture[0].name}")
plt.legend()
# Save the figure to a PNG or PDF file
plt.savefig('solubility_plot.png')  # Saves the plot as a PNG file
# plt.savefig('solubility_plot.pdf')  # Saves the plot as a PDF file
plt.show()
```

For a more comprehensive demonstration, including advanced functionalities and plotting results, please see the [example_usage.py](https://github.com/ivanantolo/cosmopharm/blob/main/example_usage.py) script in this repository. This detailed example walks through the process of setting up COSMOPharm, initializing models, and visualizing the results of solubility and miscibility calculations.

## Contributing

Contributions are welcome! Please refer to our [GitHub repository](https://github.com/ivanantolo/cosmopharm) for more information.

## Citation

We appreciate citations to our work as they help acknowledge and spread our research contributions. If you use COSMOPharm in your research, please cite the associated paper as follows:

```bibtex
@article{Antolovic2024COSMOPharm,
  title={COSMOPharm: Drug--Polymer Compatibility of Pharmaceutical Amorphous Solid Dispersions from COSMO-SAC},
  author={Antolovic, Ivan and Vrabec, Jadran and Klajmon, Martin},
  journal={Molecular Pharmaceutics},
  year={2024},
  volume={1}, # Will be adjusted accordingly
  issue={1}, # Will be adjusted accordingly
  month={3}, # Will be adjusted accordingly
  pages={1--10},  # Will be adjusted accordingly
  doi={10.1021/acs.molpharmaceut.3c12345} # Will be adjusted accordingly
}
```

## License

COSMOPharm is released under the MIT License. For more details, see the [LICENSE](https://github.com/ivanantolo/cosmopharm/LICENSE) file.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ivanantolo/cosmopharm,",
    "name": "cosmopharm",
    "maintainer": "Martin Klajmon",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Martin.Klajmon@vscht.cz",
    "keywords": "Drug-Polymer Compatibility, Amorphous Solid Dispersions, Pharmaceutical Formulation, COSMO-SAC Model, Solubility Prediction, Miscibility Analysis, Phase Behavior Prediction, Pharmaceutical Sciences, Drug Formulation Research, Polymer Science, Predictive Modeling in Pharma, Drug Development Tools, Biopharmaceuticals",
    "author": "Ivan Antolovic",
    "author_email": "Ivan.Antolovic@tu-berlin.de",
    "download_url": "https://files.pythonhosted.org/packages/af/fc/7b487b68a7a7594daf5e423ba303a011dcdaf6c03db81f4f246a803d8750/cosmopharm-0.1.1.tar.gz",
    "platform": null,
    "description": "# COSMOPharm\r\n\r\nWelcome to the COSMOPharm package, accompanying [our paper in *Molecular Pharmaceutics*](https://doi.org/10.1021/acs.molpharmaceut.4c00342). This project and its associated publication offer insights and a practical toolkit for researching drug-polymer and drug-solvent systems, aiming to provide the scientific community with the means to reproduce our findings and further the development of COSMO-SAC-based models.\r\n\r\n<p align=\"center\">\r\n  <!-- <img src=\"https://github.com/usnistgov/COSMOSAC/raw/master/JCTC2020.PNG\" alt=\"TOC Figure\" width=\"500\"> -->\r\n  <img src=\"https://github.com/ivanantolo/cosmopharm/raw/main/TOC.png\" alt=\"TOC Figure\">\r\n</p>\r\n\r\n## About \r\n\r\nCOSMOPharm is a Python package designed to streamline the predictive modeling of drug-polymer compatibility, crucial for the development of pharmaceutical amorphous solid dispersions. Apart from that, it can also be used for the miscibility/solubility of drugs with/in common solvents. Leveraging the COSMO-SAC (Conductor-like Screening Model Segment Activity Coefficient) model, COSMOPharm offers a robust platform for scientists and researchers to predict solubility, miscibility, and phase behavior in drug formulation processes.\r\n\r\n## Features\r\n\r\n- **Compatibility Prediction**: Utilize open-source COSMO-SAC model for prediction of drug-polymer compatibility.\r\n- **Solubility Calculation**: Calculate drug-polymer solubilities to guide the selection of suitable polymers for drug formulations.\r\n- **Miscibility and Phase Behavior Analysis**: Analyze the miscibility of drug-polymer pairs and understand their phase behavior under various conditions.\r\n- **User-friendly Interface**: Easy-to-use functions and comprehensive documentation to facilitate research and development in pharmaceutical sciences.\r\n\r\n## Installation\r\n\r\nInstall COSMOPharm with pip:\r\n\r\n`pip install cosmopharm`\r\n\r\nEnsure you have installed the `cCOSMO` library as per instructions on the [COSMOSAC GitHub page](https://github.com/usnistgov/COSMOSAC).\r\n\r\n## Quick Start\r\n\r\nGet started with COSMOPharm using the minimal example below, which demonstrates how to calculate the solubility of a drug in a polymer. This example succinctly showcases the use of COSMOPharm for solubility calculations:\r\n\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport cCOSMO\r\nfrom cosmopharm import SLE, COSMOSAC\r\nfrom cosmopharm.utils import create_components, read_params\r\n\r\n# Define components\r\nnames = ['SIM','PLGA50']\r\nparams_file = \"data/sle/table_params.xlsx\"\r\n\r\n# Load parameters and create components\r\nparameters = read_params(params_file)\r\nmixture = create_components(names, parameters)\r\n\r\n# Initialize COSMO-SAC model - replace paths with your local paths to COSMO profiles\r\ndb = cCOSMO.DelawareProfileDatabase(\r\n    \"./profiles/_import_methods/UD/complist.txt\",\r\n    \"./profiles/_import_methods/UD/sigma3/\")\r\n\r\nfor name in names:\r\n    iden = db.normalize_identifier(name)\r\n    db.add_profile(iden)\r\nCOSMO = cCOSMO.COSMO3(names, db)\r\n\r\n# Setup the COSMO-SAC model with components\r\nactmodel = COSMOSAC(COSMO, mixture=mixture)\r\n\r\n# Calculate solubility (SLE)\r\nsle = SLE(actmodel=actmodel)\r\nsolubility = sle.solubility(mix='real')\r\n\r\n# Output the solubility\r\nprint(solubility[['T', 'w', 'x']].to_string(index=False))\r\n\r\n# Plot results\r\nplt.plot(*solubility[['w','T']].values.T,'.-', label='Solubility (w)')\r\n\r\n# Settings\r\nplt.xlim(0,1)\r\nplt.ylim(300,500)\r\n# Adding title and labels\r\nplt.title('Solubility vs. Temperature')\r\nplt.ylabel(\"T / K\")\r\nxlabel = {'w':'Weight', 'x':'Mole'}\r\nplt.xlabel(f\"Weight fraction {mixture[0].name}\")\r\nplt.legend()\r\n# Save the figure to a PNG or PDF file\r\nplt.savefig('solubility_plot.png')  # Saves the plot as a PNG file\r\n# plt.savefig('solubility_plot.pdf')  # Saves the plot as a PDF file\r\nplt.show()\r\n```\r\n\r\nFor a more comprehensive demonstration, including advanced functionalities and plotting results, please see the [example_usage.py](https://github.com/ivanantolo/cosmopharm/blob/main/example_usage.py) script in this repository. This detailed example walks through the process of setting up COSMOPharm, initializing models, and visualizing the results of solubility and miscibility calculations.\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please refer to our [GitHub repository](https://github.com/ivanantolo/cosmopharm) for more information.\r\n\r\n## Citation\r\n\r\nWe appreciate citations to our work as they help acknowledge and spread our research contributions. If you use COSMOPharm in your research, please cite the associated paper as follows:\r\n\r\n```bibtex\r\n@article{Antolovic2024COSMOPharm,\r\n  title={COSMOPharm: Drug--Polymer Compatibility of Pharmaceutical Amorphous Solid Dispersions from COSMO-SAC},\r\n  author={Antolovic, Ivan and Vrabec, Jadran and Klajmon, Martin},\r\n  journal={Molecular Pharmaceutics},\r\n  year={2024},\r\n  volume={1}, # Will be adjusted accordingly\r\n  issue={1}, # Will be adjusted accordingly\r\n  month={3}, # Will be adjusted accordingly\r\n  pages={1--10},  # Will be adjusted accordingly\r\n  doi={10.1021/acs.molpharmaceut.3c12345} # Will be adjusted accordingly\r\n}\r\n```\r\n\r\n## License\r\n\r\nCOSMOPharm is released under the MIT License. For more details, see the [LICENSE](https://github.com/ivanantolo/cosmopharm/LICENSE) file.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Predictive modeling for drug-polymer compatibility in pharmaceutical formulations using COSMO-SAC.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/ivanantolo/cosmopharm,"
    },
    "split_keywords": [
        "drug-polymer compatibility",
        " amorphous solid dispersions",
        " pharmaceutical formulation",
        " cosmo-sac model",
        " solubility prediction",
        " miscibility analysis",
        " phase behavior prediction",
        " pharmaceutical sciences",
        " drug formulation research",
        " polymer science",
        " predictive modeling in pharma",
        " drug development tools",
        " biopharmaceuticals"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6715b6de7dce12864fd1d65c3e98846e9a083f31d9aa4bb8061d11a8c787dd85",
                "md5": "53efcd623aa8814e1fead878379dc30d",
                "sha256": "0937f88eb6131ba8d2170b887cd63d1b87c7fecbe58ff2742af34a6358053936"
            },
            "downloads": -1,
            "filename": "cosmopharm-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "53efcd623aa8814e1fead878379dc30d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 23419,
            "upload_time": "2024-07-26T19:20:22",
            "upload_time_iso_8601": "2024-07-26T19:20:22.103899Z",
            "url": "https://files.pythonhosted.org/packages/67/15/b6de7dce12864fd1d65c3e98846e9a083f31d9aa4bb8061d11a8c787dd85/cosmopharm-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "affc7b487b68a7a7594daf5e423ba303a011dcdaf6c03db81f4f246a803d8750",
                "md5": "82a51c1843a08461e1063d0c869618aa",
                "sha256": "e2a54e37612a52f954fe496cf021cb78dc146c345c5951f1f9a64823c5fc48a3"
            },
            "downloads": -1,
            "filename": "cosmopharm-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "82a51c1843a08461e1063d0c869618aa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 24323,
            "upload_time": "2024-07-26T19:20:24",
            "upload_time_iso_8601": "2024-07-26T19:20:24.335041Z",
            "url": "https://files.pythonhosted.org/packages/af/fc/7b487b68a7a7594daf5e423ba303a011dcdaf6c03db81f4f246a803d8750/cosmopharm-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-26 19:20:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ivanantolo",
    "github_project": "cosmopharm,",
    "github_not_found": true,
    "lcname": "cosmopharm"
}
        
Elapsed time: 0.32181s