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)
osqueryIR is an artifact collection tool for Linux systems.

osqueryIR osqueryIR is an artifact collection tool for Linux systems. It provides the following capabilities: Execute osquery SQL queries Collect file

AbdulRhman Alfaifi 7 Nov 02, 2022
Multipurpose Growtopia Server tools, can be used for newbie to learn things.

Information Multipurpose Growtopia Server tools, can be used for newbie to learn things. Requirements - Python 3.x - Operating System (Recommended : W

Morphias 2 Oct 29, 2021
Python implementation of Gorilla time series compression

Gorilla Time Series Compression This is an implementation (with some adaptations) of the compression algorithm described in section 4.1 (Time series c

Ghiles Meddour 19 Jan 01, 2023
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
Attempts to crack the compression puzzle.

The Compression Puzzle One lovely Friday we were faced with this nice yet intriguing programming puzzle. One shall write a program that compresses str

Oto Brglez 14 Dec 29, 2022
A python app which aggregates and splits costs from multiple public cloud providers into a csv

Cloud Billing This project aggregates the costs public cloud resources by accounts, services and tags by importing the invoices from public cloud prov

1 Oct 04, 2022
Astvuln is a simple AST scanner which recursively scans a directory, parses each file as AST and runs specified method.

Astvuln Astvuln is a simple AST scanner which recursively scans a directory, parses each file as AST and runs specified method. Some search methods ar

Bitstamp Security 7 May 29, 2022
Kanye West Lyrics Generator

aikanye Kanye West Lyrics Generator Python script for generating Kanye West lyrics Put kanye.txt in the same folder as the python script and run "pyth

4 Jan 21, 2022
A script to parse and display buy_tag and sell_reason for freqtrade backtesting trades

freqtrade-buyreasons A script to parse and display buy_tag and sell_reason for freqtrade backtesting trades Usage Copy the buy_reasons.py script into

Robert Davey 31 Jan 01, 2023
UUID version 7, which are time-sortable (following the Peabody RFC4122 draft)

uuid7 - time-sortable UUIDs This module implements the version 7 UUIDs, proposed by Peabody and Davis in https://www.ietf.org/id/draft-peabody-dispatc

Steve Simmons 22 Dec 20, 2022
Python type-checker written in Rust

pravda Python type-checker written in Rust Features Fully typed with annotations and checked with mypy, PEP561 compatible Add yours! Installation pip

wemake.services 31 Oct 21, 2022
Simple tool for creating changelogs

Description Simple utility for quickly generating changelogs, assuming your commits are ordered as they should be. This tool will simply log all lates

2 Jan 05, 2022
BOLT12 Lightning Address Format

BOLT12 Address Support (DRAFT!) Inspired by the awesome lightningaddress.com, except for BOLT12: Supports BOLT12 Allows BOLT12 vendor string authentic

Rusty Russell 28 Sep 14, 2022
Tools for binary data on cassette

Micro Manchester Tape Storage Tools for storing binary data on cassette Includes: Python script for encoding Arduino sketch for decoding Eagle CAD fil

Zack Nelson 28 Dec 25, 2022
Local backup made easy, with Python and shutil

KTBackup BETA Local backup made easy, with Python and shutil Features One-command backup and restore Minimalistic (only using stdlib) Convenient direc

kelptaken 1 Dec 27, 2021
Dice Rolling Simulator using Python-random

Dice Rolling Simulator As the name of the program suggests, we will be imitating a rolling dice. This is one of the interesting python projects and wi

PyLaboratory 1 Feb 02, 2022
More routines for operating on iterables, beyond itertools

More Itertools Python's itertools library is a gem - you can compose elegant solutions for a variety of problems with the functions it provides. In mo

2.9k Jan 06, 2023
A Random Password Generator made from Python

Things you need Python Step 1 Download the python file from Releases Step 2 Go to the directory where the python file is and run it Step 3 Type the le

Kavindu Nimsara 3 May 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
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