The psmiles
Python package provides tools and functions to work with polymer SMILES (PSMILES or P🙂s) strings. PSMILES strings are a chemical language to represent polymers.
⏩ See the Documentation
PSMILES strings are string representations of polymer structures. A PSMILES string has two star ([*]
or *
) symbols that indicate the two endpoints of the polymer repeat unit and otherwise follows the daylight SMILES syntax defined at OpenSmiles. See PSMILES guide for more details.
Examples:
Polyethylene | Polyethylene oxide | Polypropylene |
---|---|---|
[*]CC[*] |
[*]CCO[*] |
[*]CC([*])C |
Create an object of the class PolymerSmiles
for your PSMILES string. The object has functions to compute properties or manipulate the PSMILES string. For example, canonicalize a PSMILES string with
from psmiles import PolymerSmiles as PS
ps = PS("C(c1ccccc1)(C[*])[*]")
ps.canonicalize
See the Documentation for more. Also, check out test_book.ipynb
for examples.
- Canonicalize PSMILES strings (via the canonicalize_psmiles package)
- Polymer fingerprints (descriptors or features)
- Dimerize PSMILES strings
- Randomize PSMILES strings
- Compute polymer similarity based on the fingerprints
- Create alternating copolymers from two PSMILES strings
- Save the chemical drawing of the polymer to disk
pip install git+https://github.com/Ramprasad-Group/psmiles.git
# With polyBERT and mordred fingerprints
pip install 'psmiles[polyBERT,mordred]@git+https://github.com/Ramprasad-Group/psmiles.git'
poetry add git+https://github.com/Ramprasad-Group/psmiles.git
# With polyBERT and mordred fingerprints
poetry add git+https://github.com/Ramprasad-Group/psmiles.git -E polyBERT -E mordred
git clone https://github.com/Ramprasad-Group/psmiles.git
cd psmiles
poetry install -E polyBERT -E mordred