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
CGRContainer
CGRContainer.add_atom()
CGRContainer.add_bond()
CGRContainer.adjacency_matrix()
CGRContainer.aromatic_rings
CGRContainer.atom()
CGRContainer.atoms()
CGRContainer.atoms_count
CGRContainer.atoms_numbers
CGRContainer.atoms_order
CGRContainer.atoms_rings
CGRContainer.atoms_rings_sizes
CGRContainer.augmented_substructure()
CGRContainer.augmented_substructures()
CGRContainer.bond()
CGRContainer.bonds()
CGRContainer.bonds_count
CGRContainer.center_atoms
CGRContainer.center_bonds
CGRContainer.centers_list
CGRContainer.clean2d()
CGRContainer.compose()
CGRContainer.connected_components
CGRContainer.connected_components_count
CGRContainer.connected_rings
CGRContainer.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.meta
CGRContainer.name
CGRContainer.neighbors()
CGRContainer.pickle_save_cache()
CGRContainer.remap()
CGRContainer.ring_atoms
CGRContainer.rings_count
CGRContainer.skin_atoms
CGRContainer.skin_graph
CGRContainer.smiles_atoms_order
CGRContainer.split()
CGRContainer.sssr
CGRContainer.substructure()
CGRContainer.union()
CGRContainer.view3d()
MoleculeContainer
MoleculeContainer.add_atom()
MoleculeContainer.add_atom_stereo()
MoleculeContainer.add_bond()
MoleculeContainer.add_cis_trans_stereo()
MoleculeContainer.add_wedge()
MoleculeContainer.adjacency_matrix()
MoleculeContainer.aromatic_rings
MoleculeContainer.atom()
MoleculeContainer.atoms()
MoleculeContainer.atoms_count
MoleculeContainer.atoms_numbers
MoleculeContainer.atoms_order
MoleculeContainer.atoms_rings
MoleculeContainer.atoms_rings_sizes
MoleculeContainer.augmented_substructure()
MoleculeContainer.augmented_substructures()
MoleculeContainer.bond()
MoleculeContainer.bonds()
MoleculeContainer.bonds_count
MoleculeContainer.brutto
MoleculeContainer.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_components
MoleculeContainer.connected_components_count
MoleculeContainer.connected_rings
MoleculeContainer.connected_rings_cumulenes
MoleculeContainer.copy()
MoleculeContainer.cumulenes
MoleculeContainer.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_energy
MoleculeContainer.implicify_hydrogens()
MoleculeContainer.is_automorphic()
MoleculeContainer.is_equal()
MoleculeContainer.is_radical
MoleculeContainer.is_substructure()
MoleculeContainer.kekule()
MoleculeContainer.meta
MoleculeContainer.molecular_charge
MoleculeContainer.molecular_mass
MoleculeContainer.name
MoleculeContainer.neighbors()
MoleculeContainer.neutralize()
MoleculeContainer.pack()
MoleculeContainer.pickle_save_cache()
MoleculeContainer.pure_unpack()
MoleculeContainer.remap()
MoleculeContainer.remove_hydrogen_bonds()
MoleculeContainer.ring_atoms
MoleculeContainer.rings_count
MoleculeContainer.skin_atoms
MoleculeContainer.skin_graph
MoleculeContainer.smiles_atoms_order
MoleculeContainer.split()
MoleculeContainer.sssr
MoleculeContainer.standardize()
MoleculeContainer.substructure()
MoleculeContainer.tautomerize()
MoleculeContainer.tetrahedrons
MoleculeContainer.thiele()
MoleculeContainer.union()
MoleculeContainer.unpack()
MoleculeContainer.view3d()
QueryCGRContainer
QueryCGRContainer.add_atom()
QueryCGRContainer.add_bond()
QueryCGRContainer.adjacency_matrix()
QueryCGRContainer.atom()
QueryCGRContainer.atoms()
QueryCGRContainer.atoms_count
QueryCGRContainer.atoms_numbers
QueryCGRContainer.atoms_order
QueryCGRContainer.atoms_rings
QueryCGRContainer.atoms_rings_sizes
QueryCGRContainer.augmented_substructure()
QueryCGRContainer.augmented_substructures()
QueryCGRContainer.bond()
QueryCGRContainer.bonds()
QueryCGRContainer.bonds_count
QueryCGRContainer.clean2d()
QueryCGRContainer.connected_components
QueryCGRContainer.connected_components_count
QueryCGRContainer.connected_rings
QueryCGRContainer.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.meta
QueryCGRContainer.name
QueryCGRContainer.pickle_save_cache()
QueryCGRContainer.remap()
QueryCGRContainer.ring_atoms
QueryCGRContainer.rings_count
QueryCGRContainer.skin_atoms
QueryCGRContainer.skin_graph
QueryCGRContainer.smiles_atoms_order
QueryCGRContainer.split()
QueryCGRContainer.sssr
QueryCGRContainer.substructure()
QueryCGRContainer.union()
QueryContainer
QueryContainer.add_atom()
QueryContainer.add_bond()
QueryContainer.adjacency_matrix()
QueryContainer.aromatic_rings
QueryContainer.atom()
QueryContainer.atoms()
QueryContainer.atoms_count
QueryContainer.atoms_numbers
QueryContainer.atoms_order
QueryContainer.atoms_rings
QueryContainer.atoms_rings_sizes
QueryContainer.augmented_substructure()
QueryContainer.augmented_substructures()
QueryContainer.bond()
QueryContainer.bonds()
QueryContainer.bonds_count
QueryContainer.clean2d()
QueryContainer.clean_stereo()
QueryContainer.connected_components
QueryContainer.connected_components_count
QueryContainer.connected_rings
QueryContainer.connected_rings_cumulenes
QueryContainer.copy()
QueryContainer.cumulenes
QueryContainer.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.meta
QueryContainer.name
QueryContainer.pickle_save_cache()
QueryContainer.remap()
QueryContainer.ring_atoms
QueryContainer.rings_count
QueryContainer.skin_atoms
QueryContainer.skin_graph
QueryContainer.smiles_atoms_order
QueryContainer.split()
QueryContainer.sssr
QueryContainer.substructure()
QueryContainer.tetrahedrons
QueryContainer.union()
ReactionContainer
ReactionContainer.canonicalize()
ReactionContainer.centers_list
ReactionContainer.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_list
ReactionContainer.fix_mapping()
ReactionContainer.fix_positions()
ReactionContainer.flush_cache()
ReactionContainer.from_cgr()
ReactionContainer.implicify_hydrogens()
ReactionContainer.kekule()
ReactionContainer.load_remapping_rules()
ReactionContainer.meta
ReactionContainer.molecules()
ReactionContainer.name
ReactionContainer.neutralize()
ReactionContainer.pickle_save_cache()
ReactionContainer.products
ReactionContainer.reactants
ReactionContainer.reagents
ReactionContainer.remove_reagents()
ReactionContainer.standardize()
ReactionContainer.thiele()
- CGRtools.files package
- CGRtools.reactor package
- CGRtools.utils package
- CGRtools.periodictable package
C
C.__eq__()
C.__hash__()
C.__int__()
C.atomic_mass
C.atomic_number
C.atomic_radius
C.atomic_symbol
C.charge
C.copy()
C.explicit_hydrogens
C.from_atom()
C.from_atomic_number()
C.from_symbol()
C.heteroatoms
C.hybridization
C.implicit_hydrogens
C.in_ring
C.is_radical
C.isotope
C.isotopes_distribution
C.isotopes_masses
C.neighbors
C.ring_sizes
C.total_hydrogens
C.valence_rules()
C.x
C.xy
C.y
DynamicC
DynamicC.__eq__()
DynamicC.__hash__()
DynamicC.__int__()
DynamicC.atomic_mass
DynamicC.atomic_number
DynamicC.atomic_radius
DynamicC.atomic_symbol
DynamicC.charge
DynamicC.copy()
DynamicC.from_atom()
DynamicC.from_atomic_number()
DynamicC.from_symbol()
DynamicC.hybridization
DynamicC.in_ring
DynamicC.is_radical
DynamicC.isotope
DynamicC.isotopes_distribution
DynamicC.isotopes_masses
DynamicC.neighbors
DynamicC.p_charge
DynamicC.p_hybridization
DynamicC.p_is_radical
DynamicC.p_neighbors
DynamicC.ring_sizes
DynamicC.x
DynamicC.xy
DynamicC.y
QueryC
QueryC.__eq__()
QueryC.__hash__()
QueryC.__int__()
QueryC.atomic_mass
QueryC.atomic_number
QueryC.atomic_radius
QueryC.atomic_symbol
QueryC.charge
QueryC.copy()
QueryC.from_atom()
QueryC.from_atomic_number()
QueryC.from_symbol()
QueryC.heteroatoms
QueryC.hybridization
QueryC.implicit_hydrogens
QueryC.in_ring
QueryC.is_radical
QueryC.isotope
QueryC.isotopes_distribution
QueryC.isotopes_masses
QueryC.neighbors
QueryC.ring_sizes
QueryC.x
QueryC.xy
QueryC.y
DynamicQueryC
DynamicQueryC.__eq__()
DynamicQueryC.__hash__()
DynamicQueryC.__int__()
DynamicQueryC.atomic_mass
DynamicQueryC.atomic_number
DynamicQueryC.atomic_radius
DynamicQueryC.atomic_symbol
DynamicQueryC.charge
DynamicQueryC.copy()
DynamicQueryC.from_atom()
DynamicQueryC.from_atomic_number()
DynamicQueryC.from_symbol()
DynamicQueryC.hybridization
DynamicQueryC.in_ring
DynamicQueryC.is_radical
DynamicQueryC.isotope
DynamicQueryC.isotopes_distribution
DynamicQueryC.isotopes_masses
DynamicQueryC.neighbors
DynamicQueryC.p_charge
DynamicQueryC.p_hybridization
DynamicQueryC.p_is_radical
DynamicQueryC.p_neighbors
DynamicQueryC.ring_sizes
DynamicQueryC.x
DynamicQueryC.xy
DynamicQueryC.y
AnyElement
AnyElement.__eq__()
AnyElement.__hash__()
AnyElement.__int__()
AnyElement.atomic_mass
AnyElement.atomic_number
AnyElement.atomic_radius
AnyElement.atomic_symbol
AnyElement.charge
AnyElement.copy()
AnyElement.heteroatoms
AnyElement.hybridization
AnyElement.implicit_hydrogens
AnyElement.in_ring
AnyElement.is_radical
AnyElement.isotope
AnyElement.isotopes_distribution
AnyElement.isotopes_masses
AnyElement.neighbors
AnyElement.ring_sizes
AnyElement.x
AnyElement.xy
AnyElement.y
DynamicAnyElement
DynamicAnyElement.__eq__()
DynamicAnyElement.__hash__()
DynamicAnyElement.__int__()
DynamicAnyElement.atomic_mass
DynamicAnyElement.atomic_number
DynamicAnyElement.atomic_radius
DynamicAnyElement.atomic_symbol
DynamicAnyElement.charge
DynamicAnyElement.copy()
DynamicAnyElement.hybridization
DynamicAnyElement.in_ring
DynamicAnyElement.is_radical
DynamicAnyElement.isotope
DynamicAnyElement.isotopes_distribution
DynamicAnyElement.isotopes_masses
DynamicAnyElement.neighbors
DynamicAnyElement.p_charge
DynamicAnyElement.p_hybridization
DynamicAnyElement.p_is_radical
DynamicAnyElement.p_neighbors
DynamicAnyElement.ring_sizes
DynamicAnyElement.x
DynamicAnyElement.xy
DynamicAnyElement.y
ListElement
ListElement.__eq__()
ListElement.__hash__()
ListElement.__int__()
ListElement.atomic_mass
ListElement.atomic_number
ListElement.atomic_radius
ListElement.atomic_symbol
ListElement.charge
ListElement.copy()
ListElement.heteroatoms
ListElement.hybridization
ListElement.implicit_hydrogens
ListElement.in_ring
ListElement.is_radical
ListElement.isotope
ListElement.isotopes_distribution
ListElement.isotopes_masses
ListElement.neighbors
ListElement.ring_sizes
ListElement.x
ListElement.xy
ListElement.y