CGRTools
Tools for processing of reactions based on Condensed Graph of Reaction (CGR) approach.
- Basic operations:
Read/write/convert formats: MDL .RDF (RXN) and .SDF (MOL), .MRV, SMILES, INCHI (Linux and Windows), .XYZ, .PDB
Standardize molecules and reactions and valid structures checker.
Duplicate searching.
Tetrahedron, Allene and CIS-TRANS stereo checking.
Produce CGRs.
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.
Full documentation can be found here
INSTALL
Highly recommended to use python 3.8+. Python 3.6 and 3.7 deprecated.
Linux Debian based
Install python3.8, virtualenv and git:
sudo apt install python3.8 python3.8-dev git python3-virtualenv
Create new environment and activate it:
virtualenv -p python3.8 venv source venv/bin/activate
Mac
Install python3.8 and git using brew:
brew install git brew install python3
Install virtualenv:
pip install virtualenv
Create new environment and activate it:
virtualenv -p python3.8 venv source venv/bin/activate
Windows
Install python3.8 and git using Chocolatey:
choco install git choco install python3
Install virtualenv:
pip install virtualenv
Create new environment and activate it:
virtualenv venv venv\Scripts\activate
General part
stable version available through PyPI:
pip install CGRTools
Install CGRtools with MRV files parsing support:
pip install CGRTools[mrv]
Install CGRtools with structures clean2d support (Note: install NodeJS into system, see details):
pip install CGRtools[clean2d]
Install CGRtools with optimized XYZ parser:
pip install CGRtools[jit]
If you still have questions, please open issue within github.
PACKAGING
For wheel generation just type next command in source root:
python setup.py bdist_wheel
COPYRIGHT
2014-2022 Timur Madzhidov tmadzhidov@gmail.com product owner, idea and development supervision
2014-2021 Ramil Nugmanov nougmanoff@protonmail.com main developer
2021-2022 Valentina Afonina valiaafo@yandex.ru development and support
CONTRIBUTORS
Dinar Batyrshin batyrshin-dinar@mail.ru
Timur Gimadiev timur.gimadiev@gmail.com
Adelia Fatykhova adelik21979@gmail.com
Tagir Akhmetshin tagirshin@gmail.com
Ravil Mukhametgaleev sonic-mc@mail.ru
Valentina Afonina valiaafo@yandex.ru
CITE THIS
CGRtools: Python Library for Molecule, Reaction, and Condensed Graph of Reaction Processing. Journal of Chemical Information and Modeling 2019 59 (6), 2516-2521. DOI: 10.1021/acs.jcim.9b00102
CGRtools package
- CGRtools.inchi(inchi: str) Union[MoleculeContainer, Dict[str, str]]
convert INCHI string into MoleculeContainer object. string should be start with INCHI and optionally continues with space/tab separated list of key:value [or key=value] data.
- CGRtools.smiles(smiles: str) Union[MoleculeContainer, CGRContainer, ReactionContainer, Dict[str, str]]
SMILES string parser.
Subpackages
- CGRtools.containers package
CGRContainerCGRContainer.add_atom()CGRContainer.add_bond()CGRContainer.adjacency_matrix()CGRContainer.aromatic_ringsCGRContainer.atom()CGRContainer.atoms()CGRContainer.atoms_countCGRContainer.atoms_numbersCGRContainer.atoms_orderCGRContainer.atoms_ringsCGRContainer.atoms_rings_sizesCGRContainer.augmented_substructure()CGRContainer.augmented_substructures()CGRContainer.bond()CGRContainer.bonds()CGRContainer.bonds_countCGRContainer.center_atomsCGRContainer.center_bondsCGRContainer.centers_listCGRContainer.clean2d()CGRContainer.compose()CGRContainer.connected_componentsCGRContainer.connected_components_countCGRContainer.connected_ringsCGRContainer.copy()CGRContainer.decompose()CGRContainer.delete_atom()CGRContainer.delete_bond()CGRContainer.depict()CGRContainer.depict3d()CGRContainer.depict_settings()CGRContainer.environment()CGRContainer.flush_cache()CGRContainer.get_automorphism_mapping()CGRContainer.get_mapping()CGRContainer.get_mcs_mapping()CGRContainer.has_atom()CGRContainer.has_bond()CGRContainer.is_automorphic()CGRContainer.is_equal()CGRContainer.is_substructure()CGRContainer.metaCGRContainer.nameCGRContainer.neighbors()CGRContainer.pickle_save_cache()CGRContainer.remap()CGRContainer.ring_atomsCGRContainer.rings_countCGRContainer.skin_atomsCGRContainer.skin_graphCGRContainer.smiles_atoms_orderCGRContainer.split()CGRContainer.sssrCGRContainer.substructure()CGRContainer.union()CGRContainer.view3d()
MoleculeContainerMoleculeContainer.add_atom()MoleculeContainer.add_atom_stereo()MoleculeContainer.add_bond()MoleculeContainer.add_cis_trans_stereo()MoleculeContainer.add_wedge()MoleculeContainer.adjacency_matrix()MoleculeContainer.aromatic_ringsMoleculeContainer.atom()MoleculeContainer.atoms()MoleculeContainer.atoms_countMoleculeContainer.atoms_numbersMoleculeContainer.atoms_orderMoleculeContainer.atoms_ringsMoleculeContainer.atoms_rings_sizesMoleculeContainer.augmented_substructure()MoleculeContainer.augmented_substructures()MoleculeContainer.bond()MoleculeContainer.bonds()MoleculeContainer.bonds_countMoleculeContainer.bruttoMoleculeContainer.calculate_cis_trans_from_2d()MoleculeContainer.canonicalize()MoleculeContainer.check_thiele()MoleculeContainer.check_valence()MoleculeContainer.clean2d()MoleculeContainer.clean_isotopes()MoleculeContainer.clean_stereo()MoleculeContainer.compose()MoleculeContainer.connected_componentsMoleculeContainer.connected_components_countMoleculeContainer.connected_ringsMoleculeContainer.connected_rings_cumulenesMoleculeContainer.copy()MoleculeContainer.cumulenesMoleculeContainer.delete_atom()MoleculeContainer.delete_bond()MoleculeContainer.depict()MoleculeContainer.depict3d()MoleculeContainer.depict_settings()MoleculeContainer.enumerate_kekule()MoleculeContainer.enumerate_tautomers()MoleculeContainer.environment()MoleculeContainer.explicify_hydrogens()MoleculeContainer.flush_cache()MoleculeContainer.get_automorphism_mapping()MoleculeContainer.get_fast_mapping()MoleculeContainer.get_mapping()MoleculeContainer.get_mcs_mapping()MoleculeContainer.has_atom()MoleculeContainer.has_bond()MoleculeContainer.heteroatoms()MoleculeContainer.huckel_pi_electrons_energyMoleculeContainer.implicify_hydrogens()MoleculeContainer.is_automorphic()MoleculeContainer.is_equal()MoleculeContainer.is_radicalMoleculeContainer.is_substructure()MoleculeContainer.kekule()MoleculeContainer.metaMoleculeContainer.molecular_chargeMoleculeContainer.molecular_massMoleculeContainer.nameMoleculeContainer.neighbors()MoleculeContainer.neutralize()MoleculeContainer.pack()MoleculeContainer.pickle_save_cache()MoleculeContainer.pure_unpack()MoleculeContainer.remap()MoleculeContainer.remove_hydrogen_bonds()MoleculeContainer.ring_atomsMoleculeContainer.rings_countMoleculeContainer.skin_atomsMoleculeContainer.skin_graphMoleculeContainer.smiles_atoms_orderMoleculeContainer.split()MoleculeContainer.sssrMoleculeContainer.standardize()MoleculeContainer.substructure()MoleculeContainer.tautomerize()MoleculeContainer.tetrahedronsMoleculeContainer.thiele()MoleculeContainer.union()MoleculeContainer.unpack()MoleculeContainer.view3d()
QueryCGRContainerQueryCGRContainer.add_atom()QueryCGRContainer.add_bond()QueryCGRContainer.adjacency_matrix()QueryCGRContainer.atom()QueryCGRContainer.atoms()QueryCGRContainer.atoms_countQueryCGRContainer.atoms_numbersQueryCGRContainer.atoms_orderQueryCGRContainer.atoms_ringsQueryCGRContainer.atoms_rings_sizesQueryCGRContainer.augmented_substructure()QueryCGRContainer.augmented_substructures()QueryCGRContainer.bond()QueryCGRContainer.bonds()QueryCGRContainer.bonds_countQueryCGRContainer.clean2d()QueryCGRContainer.connected_componentsQueryCGRContainer.connected_components_countQueryCGRContainer.connected_ringsQueryCGRContainer.copy()QueryCGRContainer.delete_atom()QueryCGRContainer.delete_bond()QueryCGRContainer.depict()QueryCGRContainer.depict_settings()QueryCGRContainer.environment()QueryCGRContainer.flush_cache()QueryCGRContainer.get_automorphism_mapping()QueryCGRContainer.get_mapping()QueryCGRContainer.get_mcs_mapping()QueryCGRContainer.has_atom()QueryCGRContainer.has_bond()QueryCGRContainer.is_automorphic()QueryCGRContainer.is_equal()QueryCGRContainer.is_substructure()QueryCGRContainer.metaQueryCGRContainer.nameQueryCGRContainer.pickle_save_cache()QueryCGRContainer.remap()QueryCGRContainer.ring_atomsQueryCGRContainer.rings_countQueryCGRContainer.skin_atomsQueryCGRContainer.skin_graphQueryCGRContainer.smiles_atoms_orderQueryCGRContainer.split()QueryCGRContainer.sssrQueryCGRContainer.substructure()QueryCGRContainer.union()
QueryContainerQueryContainer.add_atom()QueryContainer.add_bond()QueryContainer.adjacency_matrix()QueryContainer.aromatic_ringsQueryContainer.atom()QueryContainer.atoms()QueryContainer.atoms_countQueryContainer.atoms_numbersQueryContainer.atoms_orderQueryContainer.atoms_ringsQueryContainer.atoms_rings_sizesQueryContainer.augmented_substructure()QueryContainer.augmented_substructures()QueryContainer.bond()QueryContainer.bonds()QueryContainer.bonds_countQueryContainer.clean2d()QueryContainer.clean_stereo()QueryContainer.connected_componentsQueryContainer.connected_components_countQueryContainer.connected_ringsQueryContainer.connected_rings_cumulenesQueryContainer.copy()QueryContainer.cumulenesQueryContainer.delete_atom()QueryContainer.delete_bond()QueryContainer.depict()QueryContainer.depict_settings()QueryContainer.environment()QueryContainer.flush_cache()QueryContainer.get_automorphism_mapping()QueryContainer.get_mapping()QueryContainer.get_mcs_mapping()QueryContainer.has_atom()QueryContainer.has_bond()QueryContainer.is_automorphic()QueryContainer.is_equal()QueryContainer.is_substructure()QueryContainer.metaQueryContainer.nameQueryContainer.pickle_save_cache()QueryContainer.remap()QueryContainer.ring_atomsQueryContainer.rings_countQueryContainer.skin_atomsQueryContainer.skin_graphQueryContainer.smiles_atoms_orderQueryContainer.split()QueryContainer.sssrQueryContainer.substructure()QueryContainer.tetrahedronsQueryContainer.union()
ReactionContainerReactionContainer.canonicalize()ReactionContainer.centers_listReactionContainer.check_valence()ReactionContainer.clean2d()ReactionContainer.clean_isotopes()ReactionContainer.clean_stereo()ReactionContainer.compose()ReactionContainer.contract_ions()ReactionContainer.copy()ReactionContainer.depict()ReactionContainer.depict_settings()ReactionContainer.enumerate_centers()ReactionContainer.explicify_hydrogens()ReactionContainer.extended_centers_listReactionContainer.fix_mapping()ReactionContainer.fix_positions()ReactionContainer.flush_cache()ReactionContainer.from_cgr()ReactionContainer.implicify_hydrogens()ReactionContainer.kekule()ReactionContainer.load_remapping_rules()ReactionContainer.metaReactionContainer.molecules()ReactionContainer.nameReactionContainer.neutralize()ReactionContainer.pickle_save_cache()ReactionContainer.productsReactionContainer.reactantsReactionContainer.reagentsReactionContainer.remove_reagents()ReactionContainer.standardize()ReactionContainer.thiele()
- CGRtools.files package
- CGRtools.reactor package
- CGRtools.utils package
- CGRtools.periodictable package
CC.__eq__()C.__hash__()C.__int__()C.atomic_massC.atomic_numberC.atomic_radiusC.atomic_symbolC.chargeC.copy()C.explicit_hydrogensC.from_atom()C.from_atomic_number()C.from_symbol()C.heteroatomsC.hybridizationC.implicit_hydrogensC.in_ringC.is_radicalC.isotopeC.isotopes_distributionC.isotopes_massesC.neighborsC.ring_sizesC.total_hydrogensC.valence_rules()C.xC.xyC.y
DynamicCDynamicC.__eq__()DynamicC.__hash__()DynamicC.__int__()DynamicC.atomic_massDynamicC.atomic_numberDynamicC.atomic_radiusDynamicC.atomic_symbolDynamicC.chargeDynamicC.copy()DynamicC.from_atom()DynamicC.from_atomic_number()DynamicC.from_symbol()DynamicC.hybridizationDynamicC.in_ringDynamicC.is_radicalDynamicC.isotopeDynamicC.isotopes_distributionDynamicC.isotopes_massesDynamicC.neighborsDynamicC.p_chargeDynamicC.p_hybridizationDynamicC.p_is_radicalDynamicC.p_neighborsDynamicC.ring_sizesDynamicC.xDynamicC.xyDynamicC.y
QueryCQueryC.__eq__()QueryC.__hash__()QueryC.__int__()QueryC.atomic_massQueryC.atomic_numberQueryC.atomic_radiusQueryC.atomic_symbolQueryC.chargeQueryC.copy()QueryC.from_atom()QueryC.from_atomic_number()QueryC.from_symbol()QueryC.heteroatomsQueryC.hybridizationQueryC.implicit_hydrogensQueryC.in_ringQueryC.is_radicalQueryC.isotopeQueryC.isotopes_distributionQueryC.isotopes_massesQueryC.neighborsQueryC.ring_sizesQueryC.xQueryC.xyQueryC.y
DynamicQueryCDynamicQueryC.__eq__()DynamicQueryC.__hash__()DynamicQueryC.__int__()DynamicQueryC.atomic_massDynamicQueryC.atomic_numberDynamicQueryC.atomic_radiusDynamicQueryC.atomic_symbolDynamicQueryC.chargeDynamicQueryC.copy()DynamicQueryC.from_atom()DynamicQueryC.from_atomic_number()DynamicQueryC.from_symbol()DynamicQueryC.hybridizationDynamicQueryC.in_ringDynamicQueryC.is_radicalDynamicQueryC.isotopeDynamicQueryC.isotopes_distributionDynamicQueryC.isotopes_massesDynamicQueryC.neighborsDynamicQueryC.p_chargeDynamicQueryC.p_hybridizationDynamicQueryC.p_is_radicalDynamicQueryC.p_neighborsDynamicQueryC.ring_sizesDynamicQueryC.xDynamicQueryC.xyDynamicQueryC.y
AnyElementAnyElement.__eq__()AnyElement.__hash__()AnyElement.__int__()AnyElement.atomic_massAnyElement.atomic_numberAnyElement.atomic_radiusAnyElement.atomic_symbolAnyElement.chargeAnyElement.copy()AnyElement.heteroatomsAnyElement.hybridizationAnyElement.implicit_hydrogensAnyElement.in_ringAnyElement.is_radicalAnyElement.isotopeAnyElement.isotopes_distributionAnyElement.isotopes_massesAnyElement.neighborsAnyElement.ring_sizesAnyElement.xAnyElement.xyAnyElement.y
DynamicAnyElementDynamicAnyElement.__eq__()DynamicAnyElement.__hash__()DynamicAnyElement.__int__()DynamicAnyElement.atomic_massDynamicAnyElement.atomic_numberDynamicAnyElement.atomic_radiusDynamicAnyElement.atomic_symbolDynamicAnyElement.chargeDynamicAnyElement.copy()DynamicAnyElement.hybridizationDynamicAnyElement.in_ringDynamicAnyElement.is_radicalDynamicAnyElement.isotopeDynamicAnyElement.isotopes_distributionDynamicAnyElement.isotopes_massesDynamicAnyElement.neighborsDynamicAnyElement.p_chargeDynamicAnyElement.p_hybridizationDynamicAnyElement.p_is_radicalDynamicAnyElement.p_neighborsDynamicAnyElement.ring_sizesDynamicAnyElement.xDynamicAnyElement.xyDynamicAnyElement.y
ListElementListElement.__eq__()ListElement.__hash__()ListElement.__int__()ListElement.atomic_massListElement.atomic_numberListElement.atomic_radiusListElement.atomic_symbolListElement.chargeListElement.copy()ListElement.heteroatomsListElement.hybridizationListElement.implicit_hydrogensListElement.in_ringListElement.is_radicalListElement.isotopeListElement.isotopes_distributionListElement.isotopes_massesListElement.neighborsListElement.ring_sizesListElement.xListElement.xyListElement.y