Skip to content

Fun with P🙂s strings - canonicalize, randomize, dimerize, fingerprint

License

Notifications You must be signed in to change notification settings

Ramprasad-Group/psmiles

Repository files navigation

PSMILES - Fun with P🙂s strings

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

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

How to use psmiles

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.

Features, functions, and roadmap

  • Canonicalize PSMILES strings (via the canonicalize_psmiles package)
  • Polymer fingerprints (descriptors or features)
    • polyBERT fingerprints (see polyBERT and arXiv)
    • Mordred fingerprints
    • Circular (Morgen) fingerprints as implemented in RDKit
    • RDKit fingerprints as implemented in RDKit
  • 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

Install with pip

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'

Install with poetry

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

Install for development

git clone https://github.com/Ramprasad-Group/psmiles.git
cd psmiles
poetry install -E polyBERT -E mordred

About

Fun with P🙂s strings - canonicalize, randomize, dimerize, fingerprint

Resources

License

Stars

Watchers

Forks

Packages

No packages published