Coder Social home page Coder Social logo

bdxka / psmiles Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ramprasad-group/psmiles

0.0 0.0 0.0 2.41 MB

Fun with P๐Ÿ™‚s strings - canonicalize, randomize, dimerize, fingerprint

License: MIT License

Python 6.52% Jupyter Notebook 93.17% Dockerfile 0.31%

psmiles's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.