Library for processing molecules and reactions in python way

Overview

Chython [ˈkʌɪθ(ə)n]

Library for processing molecules and reactions in python way.

Features:
  • Read/write/convert formats: MDL .RDF (.RXN) and .SDF (.MOL), .MRV, SMILES, INCHI (inchi-trust library), .XYZ, .PDB
  • Standardize molecules and reactions and valid structures checker
  • Supported python-magic
  • Tetrahedron, Allene and CIS-TRANS stereo supporting
  • Perform subgraph search
  • Build/edit molecules and reactions
  • Produce template based reactions and molecules
  • Atom-to-atom mapping checker and rule-based fixer
  • Perform MCS search
  • 2d coordinates generation (based on SmilesDrawer)
  • 2d/3d depiction
  • Produce CGRs (Condensed Graph of Reaction)

Full documentation can be found here.

Chython is fork of CGRtools.

INSTALL

Highly recommended to use python 3.8+. Python 3.6 and 3.7 deprecated.

Note: for using clean2d install NodeJS into system.

  • stable version available through PyPI:

    pip install chython
    
  • Install chython library DEV version for features that are not well tested:

    pip install -U git+https://github.com/chython/chython.git@master#egg=chython
    

TESTS

Run unit tests:

git clone https://github.com/chython/chython.git && cd chython  # skip if already got sources
pip install -e .
pytest --pyargs chython

COPYRIGHT

CONTRIBUTORS

Comments
  • Pip installation bug

    Pip installation bug

    I tried to install the package via pip (not the DEV version) and encountered an error related to setuptools. The error looks like this: setuptools bug

    I found that downgrading setuptools to version 41 solves problem. And it really worked out.

    opened by tagirshin 1
  • Bump loader-utils from 1.4.1 to 1.4.2 in /clean2d

    Bump loader-utils from 1.4.1 to 1.4.2 in /clean2d

    Bumps loader-utils from 1.4.1 to 1.4.2.

    Release notes

    Sourced from loader-utils's releases.

    v1.4.2

    1.4.2 (2022-11-11)

    Bug Fixes

    Changelog

    Sourced from loader-utils's changelog.

    1.4.2 (2022-11-11)

    Bug Fixes

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump loader-utils from 1.4.0 to 1.4.1 in /clean2d

    Bump loader-utils from 1.4.0 to 1.4.1 in /clean2d

    Bumps loader-utils from 1.4.0 to 1.4.1.

    Release notes

    Sourced from loader-utils's releases.

    v1.4.1

    1.4.1 (2022-11-07)

    Bug Fixes

    Changelog

    Sourced from loader-utils's changelog.

    1.4.1 (2022-11-07)

    Bug Fixes

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump minimist from 1.2.5 to 1.2.6 in /clean2d

    Bump minimist from 1.2.5 to 1.2.6 in /clean2d

    Bumps minimist from 1.2.5 to 1.2.6.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • allene stereo

    allene stereo

    fix bug image

    
      Mrv2115 01212215432D          
    
     10 10  0  0  0  0            999 V2000
       -7.6610    0.9215    0.0000 C   0  0  0  0  0  0  0  0  0  6  0  0
       -7.2485    1.6360    0.0000 C   0  0  0  0  0  0  0  0  0  8  0  0
       -6.4732    1.9181    0.0000 C   0  0  0  0  0  0  0  0  0 10  0  0
       -5.8542    1.4128    0.0000 C   0  0  1  0  0  0  0  0  0 12  0  0
       -5.2855    0.9215    0.0000 C   0  0  0  0  0  0  0  0  0 11  0  0
       -5.4287    0.1090    0.0000 C   0  0  0  0  0  0  0  0  0  9  0  0
       -6.0607   -0.4213    0.0000 C   0  0  0  0  0  0  0  0  0  7  0  0
       -6.8857   -0.4213    0.0000 C   0  0  0  0  0  0  0  0  0  5  0  0
       -7.5177    0.1090    0.0000 C   0  0  0  0  0  0  0  0  0  4  0  0
       -6.4732    2.7431    0.0000 H   0  0  0  0  0  0  0  0  0 13  0  0
      1  2  1  0  0  0  0
      2  3  1  0  0  0  0
      3  4  2  0  0  0  0
      4  5  2  0  0  0  0
      5  6  1  0  0  0  0
      6  7  1  0  0  0  0
      7  8  1  0  0  0  0
      8  9  1  0  0  0  0
      1  9  1  0  0  0  0
      3 10  1  1  0  0  0
    M  END
    
    
    opened by stsouko 0
Releases(1.48)
  • 1.48(Dec 14, 2022)

    What's Changed

    • Kekule fixed for invalid pyridine complexes
    • Automatic clean2d on depiction. useful for smiles-parsed structures.
    • Depiction customization

    Full Changelog: https://github.com/chython/chython/compare/1.45...1.48

    Source code(tar.gz)
    Source code(zip)
  • 1.45(Oct 26, 2022)

    What's Changed

    • molecules bytes pack V2
    • reactor enumerator now supports lists of atoms in product
    • smiles parser fix
    • smarts parser improved (globally unique masked atoms)
    • heuristic mapper fixed
    • thiele fixed
    • small bugfixes

    Full Changelog: https://github.com/chython/chython/compare/1.38...1.45

    Source code(tar.gz)
    Source code(zip)
  • 1.38(Aug 30, 2022)

    • parsers better logging added.
    • thiele and kekule fixed.
    • pandas adhoc fix for better representation of molecules in df. chython.utils.patch_pandas
    • remove_reagents method now support AAM-less detection.
    • Reactor call api changed.
    • new smiles formatting key: !z - disable charges information.
    • small bugs.

    Full Changelog: https://github.com/chython/chython/compare/1.27...1.38

    Source code(tar.gz)
    Source code(zip)
  • 1.27(May 30, 2022)

    • Fixed rule-based AAM fixer.
    • Improved clean2d
    • standardize now can keep tautomers.
    • remove_acids molecule standardization method added.
    • split_metal_salts molecule standardization implemented.
    • SDF metadata writer now follow specification
    • Reactor improved.
    • Groups deprotection transformers for common groups implemented.
    • utils.svg2png renderer added.

    Full Changelog: https://github.com/chython/chython/compare/1.23...1.27

    Source code(tar.gz)
    Source code(zip)
  • 1.23(Apr 21, 2022)

    SMARTS parser added!

    There are a few limitations:

    stereo ignored only D, a, h, r, and !R atom primitives supported. bond order list and not bond supported. [not]ring bond supported. Only with explicit bonds. not bond and order list supported. mapping, charge, and isotopes supported. list of elements supported. A - treats as any element. A primitive (aliphatic) ignored. M - treats as any metal. <&> logic operator unsupported. <;> logic operator is mandatory except for charge, isotope, and stereo marks. used CXSMARTS extension for radical, hybridization (SP3, SP2, SP1, and Aromatic coded as 3, 2, 1, and 4), and heteroatoms (not C or H) count coding

    For example:

        [C;r5,r6;a]-;!@[C;h0,h1] |atomProp:1.hyb.24:1.het.0|
    

    Aromatic C member of 5 or 6 atoms ring connected with non-ring single bond to aromatic or SP2 C with 0 or 1 hydrogen without heteroatomic neighbors. Left molecules matches.

    image

    • Tutorial updated.
    • Fixed Reactor stereo. Now patch without stereo doesn't override matched molecule stereo.
    • SMARTS generator fixed.

    Full Changelog: https://github.com/chython/chython/compare/1.22...1.23

    Source code(tar.gz)
    Source code(zip)
  • 1.22(Apr 15, 2022)

    What's Changed

    • Atom-to-Atom mapping for reactions.
    • SMILES parser refactored and fixed. CXSMILES support was added for fragments and radicals.
    • SMILES generator refactored. CXSMILES support was added for fragments and radicals.
    • Isomorphism speedup with cython.
    • Stereo processing speedup.
    • QueryContainer now supports bond in ring attribute. SMARTS now daylight compatible. CXSMARTS notation used for radicals, hybridizations, and heteroatoms attrs.
    • chython.utils.GridDepict and chython.utils.RetroDepict for lists of molecules and rooted tree of molecules (e.g. retro-synthetic tree)
    • Tautomerism refactored. Use mol.enumerate_tautomers() for generating.
    • Protonated and deprotonated structures enumeration added mol.enumerate_charged_forms()
    • Bug fixes.

    New Contributors

    • @TimurGimadiev

    Full Changelog: https://github.com/chython/chython/commits/1.22

    Source code(tar.gz)
    Source code(zip)
Owner
null
🍰 ConnectMP - An easy and efficient way to share data between Processes in Python.

ConnectMP - Taking Multi-Process Data Sharing to the moon ?? Contribute · Community · Documentation ?? Introduction : ?? ConnectMP is the easiest and

Aiden Ellis 1 Dec 24, 2021
Search, generate & deliver Msfvenom payloads in an quick and easy way

Goal Search, generate & deliver payloads in an quick and easy way Be as simple as possible BUT with all msfvenom payloads. Ever lost time searching th

null 2 Mar 3, 2022
A way to write regex with objects instead of strings.

Py Idiomatic Regex (AKA iregex) Documentation Available Here An easier way to write regex in Python using OOP instead of strings. Makes the code much

Ryan Peach 18 Nov 15, 2021
A collection of utility functions to prototype geometry processing research in python

gpytoolbox This repo is a work in progress and contains general utility functions I have needed to code while trying to work on geometry process resea

Silvia Sellán 73 Jan 6, 2023
🔩 Like builtins, but boltons. 250+ constructs, recipes, and snippets which extend (and rely on nothing but) the Python standard library. Nothing like Michael Bolton.

Boltons boltons should be builtins. Boltons is a set of over 230 BSD-licensed, pure-Python utilities in the same spirit as — and yet conspicuously mis

Mahmoud Hashemi 6k Jan 4, 2023
isort is a Python utility / library to sort imports alphabetically, and automatically separated into sections and by type.

isort is a Python utility / library to sort imports alphabetically, and automatically separated into sections and by type. It provides a command line utility, Python library and plugins for various editors to quickly sort all your imports.

Python Code Quality Authority 5.5k Jan 8, 2023
ticktock is a minimalist library to view Python time performance of Python code.

ticktock is a minimalist library to view Python time performance of Python code.

Victor Benichoux 30 Sep 28, 2022
A Python library for reading, writing and visualizing the OMEGA Format

A Python library for reading, writing and visualizing the OMEGA Format, targeted towards storing reference and perception data in the automotive context on an object list basis with a focus on an urban use case.

Institut für Kraftfahrzeuge, RWTH Aachen, ika 12 Sep 1, 2022
RapidFuzz is a fast string matching library for Python and C++

RapidFuzz is a fast string matching library for Python and C++, which is using the string similarity calculations from FuzzyWuzzy

Max Bachmann 1.7k Jan 4, 2023
pydsinternals - A Python native library containing necessary classes, functions and structures to interact with Windows Active Directory.

pydsinternals - Directory Services Internals Library A Python native library containing necessary classes, functions and structures to interact with W

Podalirius 36 Dec 14, 2022
A simple gpsd client and python library.

gpsdclient A small and simple gpsd client and library Installation Needs Python 3 (no other dependencies). If you want to use the library, use pip: pi

Thomas Feldmann 33 Nov 24, 2022
Python library to decorate and beautify strings

outputformat Python library to decorate and beautify your standard output ?? Ins

Felipe Delestro Matos 259 Dec 13, 2022
A library for interacting with Path of Exile game and economy data, and a unique loot filter generation framework.

wraeblast A library for interfacing with Path of Exile game and economy data, and a set of item filters geared towards trade league players. Filter Ge

David Gidwani 29 Aug 28, 2022
A functional standard library for Python.

Toolz A set of utility functions for iterators, functions, and dictionaries. See the PyToolz documentation at https://toolz.readthedocs.io LICENSE New

null 4.1k Dec 30, 2022
Retrying library for Python

Tenacity Tenacity is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just

Julien Danjou 4.3k Jan 5, 2023
Retrying is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just about anything.

Retrying Retrying is an Apache 2.0 licensed general-purpose retrying library, written in Python, to simplify the task of adding retry behavior to just

Ray Holder 1.9k Dec 29, 2022
ecowater-softner is a Python library for collecting information from Ecowater water softeners.

Ecowater Softner ecowater-softner is a Python library for collecting information from Ecowater water softeners. Installation Use the package manager p

null 6 Dec 8, 2022
A tiny Python library for generating public IDs from integers

pids Create short public identifiers based on integer IDs. Installation pip install pids Usage from pids import pid public_id = pid.from_int(1234) #

Simon Willison 7 Nov 11, 2021
Helpful functions for use alongside the rich Python library.

?? Rich Tools A python package with helpful functions for use alongside with the rich python library. ???? The current features are: Convert a Pandas

Avi Perl 14 Oct 14, 2022