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/[email protected]#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)
JavaScript to Python Translator & JavaScript interpreter written in 100% pure Python🚀

Pure Python JavaScript Translator/Interpreter Everything is done in 100% pure Python so it's extremely easy to install and use. Supports Python 2 & 3.

Piotr Dabkowski 2.1k Dec 30, 2022
Package that allows for validate and sanitize of string values.

py.validator A library of string validators and sanitizers Insipired by validator.js Strings only This library validates and sanitizes strings only. P

Sanel Hadzini 22 Nov 08, 2022
Implicit hierarchical a posteriori error estimates in FEniCSx

FEniCSx Error Estimation (FEniCSx-EE) Description FEniCSx-EE is an open source library showing how various error estimation strategies can be implemen

Jack S. Hale 1 Dec 08, 2021
A program will generate a eth key pair that has the public key that starts with a defined amount of 0

ETHAdressGenerator This short program will generate a eth key pair that has the public key that starts with a defined amount of 0 Requirements Python

3 Nov 19, 2021
A simple python implementation of Decision Tree.

DecisionTree A simple python implementation of Decision Tree, using Gini index. Usage: import DecisionTree node = DecisionTree.trainDecisionTree(lab

1 Nov 12, 2021
A simple and easy to use collection of random python functions.

A simple and easy to use collection of random python functions.

Diwan Mohamed Faheer 1 Nov 17, 2021
Program to extract signatures from documents.

Extracting Signatures from Bank Checks Introduction Ahmed et al. [1] suggest a connected components-based method for segmenting signatures in document

Muhammad Saif Ullah Khan 9 Jan 26, 2022
Minimal Windows system information tool written in Python

wfetch wfetch is a Minimal Windows system information tool written in Python (Only works on Windows) Installation First of all have python installed.

zJairO 3 Jan 24, 2022
Macro recording and metaprogramming in Python

macro-kit is a package for efficient macro recording and metaprogramming in Python using abstract syntax tree (AST).

8 Aug 31, 2022
Easy compression and extraction for any compression or archival format.

Tzar: Tar, Zip, Anything Really Easy compression and extraction for any compression or archival format. Usage/Examples tzar compress large-dir compres

DanielVZ 37 Nov 02, 2022
Pampy: The Pattern Matching for Python you always dreamed of.

Pampy: Pattern Matching for Python Pampy is pretty small (150 lines), reasonably fast, and often makes your code more readable and hence easier to rea

Claudio Santini 3.5k Jan 06, 2023
A library to easily convert climbing route grades between different grading systems.

pyclimb A library to easily convert climbing route grades between different grading systems. In rock climbing, mountaineering, and other climbing disc

Ilias Antonopoulos 4 Jan 26, 2022
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

2 Mar 03, 2022
This is a package that allows you to create a key-value vault for storing variables in a global context

This is a package that allows you to create a key-value vault for storing variables in a global context. It allows you to set up a keyring with pre-defined constants which act as keys for the vault.

Data Ductus 2 Dec 14, 2022
A python program to find binary, octal and hexadecimal of a decimal.

decimal-converter This little python program can convert a decimal in to, Binary Octal Hexadecimal Needed Python 3 or later or a online python compile

Chandula Janith 0 Nov 27, 2021
Make some improvements in the Pizza class and pizzashop file by refactoring.

Make some improvements in the Pizza class and pizzashop file by refactoring.

James Brucker 1 Oct 18, 2021
A repo for working with and building daos

DAO Mix DAO Mix About How to DAO No Code Tools Getting Started Prerequisites Installation Usage On-Chain Governance Example Off-Chain governance Examp

Brownie Mixes 86 Dec 19, 2022
This tool lets you perform some quick tasks for CTFs and Pentesting.

This tool lets you convert strings and numbers between number bases (2, 8, 10 and 16) as well as ASCII text. You can use the IP address analyzer to find out details on IPv4 and perform abbreviation a

Ayomide Ayodele-Soyebo 1 Jul 16, 2022
A pythonic dependency injection library.

Pinject Pinject is a dependency injection library for python. The primary goal of Pinject is to help you assemble objects into graphs in an easy, main

Google 1.3k Dec 30, 2022
Animation retargeting tool for Autodesk Maya. Retargets mocap to a custom rig with a few clicks.

Animation Retargeting Tool for Maya A tool for transferring animation data and mocap from a skeleton to a custom rig in Autodesk Maya. Installation: A

Joaen 63 Jan 06, 2023