RDMC Documentation#
Introduction#
RDMC (Reaction Data and Molecular Conformer) is an open-source lightweight software package specialized in handling Reaction Data and Molecular (including transition states) Conformers.
It contains various modules and classes helpful for relevant tasks to make conversion, visualization, manipulation, and analysis of molecules easier. rdmc
and rdtools
are the two major modules.
Installation#
The source code of the RDMC software package is hosted on GitHub, and its binary distribution is available on Anaconda Cloud and PyPI. The easiest way to install RDMC is to use conda
or mamba
:
conda install -c xiaoruidong rdmc # replace conda to mamba to use mamba
Or
pip install rdmc
conda
can be installed by via Anaconda, and mamba
can be installed via Mambaforge.
You can also install RDMC from the source code:
git clone https://github.com/xiaoruidong/rdmc
cd RDMC
conda env create -f environment.yml
conda activate rdmc
python -m pip install --no-deps -vv ./
rdtools
#
It has a collections of functions that can be directly operated on to RDKit native objects. Most of them can be regarded as a modified version of a RDKit native operation but with simplified
imports, more intuitive usage, and more robustness implementation. They are distributed in submodules, each named by its relevance field and objects. It is best used in cases where efficiency is a
major conern and the task you required is relatively simple. Here are some highlights in rdtools
:
viewers in
rdtools.view
. These viewers greatly extend RDKit’s default Ipython 3D viewer, with the capability of viewing animations and interaction with conformers.generate_resonance_structures
inrdtools.resonance
is able to generate resonance structures for radical molecules that is not capable by the original RDKit.mol_from_smiles
inrdtools.conversion
make sure the created molecule has an atom ordering consistent with the atom mappingmol_from_xyz
supports two backendsopenbabel
as well asxyz2mol
for molecule connectivity perception. If both native backends fail (e.g., cannot be sanitized, or wrong charge or multiplicity),rdtools
also provided a heuristic fix toolfix_mol
inrdtools.fix
to help fix the molecules if possible.
rdmc
#
It can be regarded as a midware between RDKit/rdtools
basic operations and complicated workflows. Mol
(Previously, RDKitMol
) and Reaction
are the most important classes.
Mol
(known asRDKitMol
previously) is a child class ofRWMol
, which means that you can directly use it with RDKit’s native functions, but also integrated a lot of tools inrdtools
, so you can directly use them as class methods. The appended methods not only provides convenience in usage, but also make sure the output molecule objects, if applicable, is still ardmc.Mol
object. While many RDKit functions will just outputChem.Mol
which is no longer editable, breaking the flow of your molecule operations.Reaction
provides intuitive APIs for getting bond analysis, reaction comparison, visualization, etc.
We provide examples of how to combine rdtools
and rdmc
with other dependencies to build useful tools. Python native interactive Log file parsers in rdmc.external.logparse
are a good show case
where rdmc
and cclib
are combined. We also provide solutions to pipelining tasks to achieve high-throughput generating and processing of large amount of molecule/reaction data in rdmc.conformer_generation
.
Requirements#
RDMC
is written in Python (>= 3.7) and has dependencies only on popular packages.
To use
rdtools
, you only needsnumpy
andrdkit
at minimum. You can install optional dependencies:scipy
for better resonance structure generation for polycyclic molecules,py3dmol
to use the amazing 3D viewers,openbabel
to extend rdmc’s xyz perception cability.To use
rdmc
, the dependencies are basically the same asrdtools
, but we do recommend installing all optional dependencies for a better experience. Besides, to plot curves and figures for data, you can installmatplotlib
; to play around with the log parsers you should consider installcclib
andipywidgets
. And to start computations inconformer_generation
, you need to havextb
andorca
(which are free to academia) installed to get some serious results.
But in a word, RDMC’s dependencies are very general-purpose and popular packages.
First Run#
To start with, simply try the following:
from rdmc import Mol, Reaction
mol = Mol.FromSmiles('CCO')
rxn = Reaction.from_reaction_smiles('CCO>>CC(=O)O')
And see what the mol
and rxn
are capable of! The full lists of APIs of Mol
and Reaction
are provided in this documentation.
Examples#
We also provided a few notebooks (available in \ipython
and Colab) to demonstrate the usage of RDMC. Please feel invited to try them out!
Developers#
at Green Research Group at Massachusetts Institute of Technology (MIT). For any questions while using RDMC, please contact us via the GitHub issue page or email us at rdmc_dev@mit.edu.