Skip to main content

retroapi for retrosynthesis routes and exploring reaction conditions

Project description

RetroSynthesis API

test

  • retroapi get predict routes given target molecule.

  • supply plausible value for all predicts.

  • predict conditions base on one reaction.

  • add aync support

Install

  • using pip
pip install retroapi

Usage

from retroapi import RetroApi, Name2Smiles

retro_api = RetroApi()

# if you have simles of molecule.
smiles = "COc1cccc(OC(=O)/C=C/c2cc(OC)c(OC)c(OC)c2)c1"

# else:
chemical_name = "4-Hydroxycoumarin"
name2smiles = Name2Smiles()
smiles = name2smiles.get_smiles(chemical_name)

# check if smiles is valid or not
is_valid_smiles = retro_api.validate_smiles(smiles)

if is_valid_smiles:
    routes = retro_api.predict_routes(smiles)
    if routes is not None:
        # work with routes
        pass

# check if chemical is buyable or not
is_buyable = retro_api.check_stock(smiles)

# check reaction conditions

# first you should get product smile
# second you should get reactants smile

products = "COc1cc(C(=O)O)cc(OC)c1OC"
reactants = "C=CC(=O)O.COc1cc(Br)cc(OC)c1OC"

conds = retro_api.process_reaction(product, reactants)
if conds is not None:
    # check reaction condition with plausible
    pass

Async Usage

from retroapi import RetroApi, Name2Smiles


async def foo():
    retro_api = RetroApi()

    # if you have simles of molecule.
    smiles = "COc1cccc(OC(=O)/C=C/c2cc(OC)c(OC)c(OC)c2)c1"

    # else:
    chemical_name = "4-Hydroxycoumarin"
    name2smiles = Name2Smiles()
    smiles = await name2smiles.aget_smiles(chemical_name)

    # check if smiles is valid or not
    is_valid_smiles = await retro_api.avalidate_smiles(smiles)

    if is_valid_smiles:
        routes = await retro_api.apredict_routes(smiles)
        if routes is not None:
            # work with routes
            pass

    # check if chemical is buyable or not
    is_buyable = await retro_api.acheck_stock(smiles)

    # check reaction conditions

    # first you should get product smile
    # second you should get reactants smile

    products = "COc1cc(C(=O)O)cc(OC)c1OC"
    reactants = "C=CC(=O)O.COc1cc(Br)cc(OC)c1OC"

    conds = await retro_api.aprocess_reaction(product, reactants)
    if conds is not None:
        # check reaction condition with plausible
        pass

Change log:

add aync for package

with function name prefix with 'a', for example get_smile -> aget_smile

API Documentation

Class Name2Smiles

  • get_smiles
    • parameter
      • chemical_name: str
    • output
      • smiles: str

Class RetroApi

  • validate_smiles

    • parameter
      • smiles: str
    • output
      • true/false
  • predict_routes

    • parameter
      • smiles: str
    • output
      • routes: list
  • process_reaction

    • parameter
      • product: str

        product smiles

      • reactants: str

        reactants smiles jointed by "." like "C=CC(=O)O.COc1cc(Br)cc(OC)c1OC"

    • output conditions: list

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

retroapi-0.5.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

retroapi-0.5.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file retroapi-0.5.0.tar.gz.

File metadata

  • Download URL: retroapi-0.5.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for retroapi-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a542b94c3b032df86a33c38393f32bd6dca1bb6d06124f4d4fc2abe131a09ab0
MD5 3dd8a9b817b3444b3e878ab7ced042e8
BLAKE2b-256 4d139a3c5d13456aad28e5c1bf65a3a80c50e612ad812ca9374ecc6e904cff72

See more details on using hashes here.

File details

Details for the file retroapi-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: retroapi-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for retroapi-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3840a80de735f7950dcb518734e4a7e7047ea2a8d26950f3c69d63fc7c5d8610
MD5 64abfc031b38e9b83a3ed604f6b1876d
BLAKE2b-256 d2dcde18764df6bd8911243b1203af6cc93b98aff1234d9202b74511b33e7e80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page