Giter VIP home page Giter VIP logo

caos's Introduction

CAOS - Computer Assisted Organic Synthesis (in Python!)

Build status Coverage Status Documentation Status

CAOS is a useful tool for many organic chemists, but is often a hard one to use in practice. This library will seek to provide an easy method of predicting reactions.

Documentation

Is available at readthedocs.org.

Examples

Simple reactions can be performed in this way

from CAOS.dispatch import react
from CAOS.structures.molecule import Molecule

acid = Molecule(
    {'a1': 'H', 'a2': 'H', 'a3': 'H', 'a4': 'O'},
    {'b1': {'nodes': ('a1', 'a4'), 'order': 1},
     'b2': {'nodes': ('a2', 'a4'), 'order': 1},
     'b3': {'nodes': ('a3', 'a4'), 'order': 1}
    },
    **{'id': 'Hydronium'}
)

base = Molecule(
    {'a1': 'H', 'a2': 'O'},
    {'b1': {'nodes': ('a1', 'a2'), 'order': 1}},
    **{'id': 'Hydroxide'}
)

conditions = {
    'pkas': {'Hydronium': -1.74, 'Hydroxide': 15.7},
    'pka_points': {'Hydronium': 'a1', 'Hydroxide': 'a2'}
}

products = react([acid, base], conditions)

In this case, based on the information in the molecules and the conditions, the system will predict an acid base reaction that results in the creation of two water molecules and no salt.

Additionally, user-defined reaction mechanisms can be added to the system.

# aqueous_mechanism.py
from CAOS.dispatch import register_reaction_mechanism

def aqueous(reactants, conditions):
    return conditions.get('aqeuous', False)

@register_reaction_mechanism([aqueous])
def some_mechanism(reactants, conditions):
    # do something
    return products

# reaction.py
import aqueous_mechanism
from CAOS.dispatch import react
from CAOS.structures.molecule import Molecule

m1 = Molecule(...)
m2 = Molecule(...)
conditions = {'aqueous': True}

products = react([m1, m2], conditions)

Here the system would use the aqueous mechanism that you have defined, because the conditions match the aqueous requirement the mechanism was decorated with.

The system is under active development, and the goal is to eventually take as much of the work out of the hands of the user.

Todos:

  • [X] Add CI
  • [X] Add reaction registration and dispatch
  • [ ] Add loading molecules
  • [X] Add molecule inspection
  • [ ] Add common requirements functions
  • [ ] ???

CAOS is still in early stages of development. Information will be added as it becomes available.

Motivation

This is a project for my Fall 2015 DSLs class. It is loosely based off of a previous project however with the intent of being more modular, extensible, and language-like.

Licensing

CAOS is licensed using the MIT License.

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.