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)
🔩 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 04, 2023
Toolkit for collecting and applying templates of prompting instances

PromptSource Toolkit for collecting and applying templates of prompting instances. WIP Setup Download the repo Navigate to root directory of the repo

BigScience Workshop 1k Jan 05, 2023
A simple python script to generate an iCalendar file for the university classes.

iCal Generator This is a simple python script to generate an iCalendar file for the university classes. Installation Clone the repository git clone ht

Foad Rashidi 2 Sep 01, 2022
A python package containing all the basic functions and classes for python. From simple addition to advanced file encryption.

A python package containing all the basic functions and classes for python. From simple addition to advanced file encryption.

PyBash 11 May 22, 2022
jsoooooooon derulo - Make sure your 'jason derulo' is featured as the first part of your json data

jsonderulo Make sure your 'jason derulo' is featured as the first part of your json data Install: # python pip install jsonderulo poetry add jsonderul

jesse 3 Sep 13, 2021
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
A small python library that helps you to generate localization strings for your mobile projects.

LocalizationUtiltiy A small python library that helps you to generate localization strings for your mobile projects. This small script aims to help yo

1 Nov 12, 2021
Go through a random file in your favourite open source projects!

Random Source Codes Never be bored again! Staring at your screen and just scrolling the great world wide web? Would you rather read through some code

Mridul Seth 1 Nov 03, 2022
Delete all of your forked repositories on Github

Fork Purger Delete all of your forked repositories on Github Installation Install using pip: pip install fork-purger Exploration Under construc

Redowan Delowar 29 Dec 17, 2022
Fcpy: A Python package for high performance, fast convergence and high precision numerical fractional calculus computing.

Fcpy: A Python package for high performance, fast convergence and high precision numerical fractional calculus computing.

SciFracX 1 Mar 23, 2022
EthTx - Ethereum transactions decoder

EthTx - Ethereum transactions decoder Installation pip install ethtx Requirements The package needs a few external resources, defined in EthTxConfig o

398 Dec 25, 2022
JeNot - A tool to notify you when Jenkins builds are done.

JeNot - Jenkins Notifications NOTE: under construction, buggy, and not production-ready What A tool to notify you when Jenkins builds are done. Why Je

1 Jun 24, 2022
Tool for generating Memory.scan() compatible instruction search patterns

scanpat Tool for generating Frida Memory.scan() compatible instruction search patterns. Powered by r2. Examples $ ./scanpat.py arm.ks:64 'sub sp, sp,

Ole André Vadla Ravnås 13 Sep 19, 2022
Writing Alfred copy/paste scripts in Python

Writing Alfred copy/paste scripts in Python This repository shows how to create Alfred scripts in Python. It assumes that you using pyenv for Python v

Will Fitzgerald 2 Oct 26, 2021
A Container for the Dependency Injection in Python.

Python Dependency Injection library aiodi is a Container for the Dependency Injection in Python. Installation Use the package manager pip to install a

Denis NA 3 Nov 25, 2022
An online streamlit development platform

streamlit-playground An online streamlit development platform Run, Experiment and Play with streamlit Components Develop full-fledged apps online All

Akshansh Kumar 3 Nov 06, 2021
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 04, 2023
Utility to add/remove licenses to/from source files

Utility to add/remove licenses to/from source files. Supports processing any combination of globs, files, and directories (recurse). Pruning options allow skipping non-licensing files.

Eduardo Ponce Mojica 2 Jan 29, 2022
This utility synchronises spelling dictionaries from various tools with each other.

This utility synchronises spelling dictionaries from various tools with each other. This way the words that have been trained on MS Office are also correctly checked in vim or Firefox. And vice versa

Patrice Neff 2 Feb 11, 2022
Raganarok X: Next Generation Data Dump

Raganarok X Data Dump Raganarok X: Next Generation Data Dump More interesting Files File Name Contains en_langs All the variables you need in English

14 Jul 15, 2022