Preprocessing

MolecularGraph.extractlargestcomponentMethod
extractlargestcomponent(mol::GraphMol) -> GraphMol

Return the largest connected component of the molecular graph.

This should be useful when you want to remove salt and water molecules from the molecular graph simply. On the other hand, this can remove important components from the mixture so carefully apply this preprocess method.

source
MolecularGraph.kekulize!Method
kekulize!(mol::SMILES) -> Nothing

Kekulize the molecule that has SMILES aromatic bonds.

SMILES allows aromatic atoms in small letters - b, c, n, o, p, s, [as] and [se]. Once these are stored in SmilesAtom.isaromatic field, then kekulize will place double bonds to satisfy valences.

Kekulization is necessary for molecules parsed from SMILES. If not kekulized, some bond valence and implicit hydrogen properties would be wrong.

source
MolecularGraph.polarize!Function
polarize!(mol::GraphMol; negative=:O, positive=[:N, :S]) -> Nothing

Polarize dipole double bonds of the molecule.

source
MolecularGraph.removehydrogensMethod
removehydrogens(mol::GraphMol) -> GraphMol

Return the molecule with hydrogen nodes removed.

If option all is set to true (default), all hydrogens will be removed, otherwise only trivial hydrogens will be removed (see trivialhydrogens).

source
MolecularGraph.toallenelike!Method
toallenelike!(mol::GraphMol) -> Nothing

Standardize the molecule so that all 1,3-dipole groups are represented as allene-like structure (e.g. Diazo group [C-][N+]#N -> C=[N+]=[N-]).

source
MolecularGraph.totriplebond!Method
totriplebond!(mol::GraphMol) -> Nothing

Standardize the molecule so that all 1,3-dipole groups are represented as triple bond and single bond (e.g. Diazo group C=[N+]=[N-] -> [C-][N+]#N).

source
MolecularGraph.trivialhydrogensMethod
trivialhydrogens(mol::GraphMol) -> Set{Int}

Return a set of trivial hydrogen nodes.

"Trivial" means not charged, no unpaired electron, no specific mass, non-stereospecific and attached to organic heavy atoms. Note that stereochemstry of SDFile molecules will not be considered until setstereocenter! is applied.

source

Stereochemistry

MolecularGraph.addstereohydrogensMethod
addstereohydrogens(mol::GraphMol) -> GraphMol

Add stereospecific hydrogen nodes to the molecule.

If the molecule was genereted from SDFile, run setstereocenter!(mol) in advance to set stereocenter information.

source
MolecularGraph.optimizewedges!Method
optimizewedges!(mol::SDFile) -> Nothing

Optimize dashes and wedges representations. Typical stereocenters can be drawn as four bonds including only a wedge and/or a dash, so if there are too many dashes and wedges, some of them will be converted to normal single bond without changing any stereochemistry.

source
MolecularGraph.removestereohydrogensMethod
removestereohydrogens(mol::GraphMol) -> GraphMol

Return new molecule with stereospecific hydrogen nodes removed.

If the molecule was genereted from SDFile, run setstereocenter!(mol) in advance to set stereocenter information. This will keep stereochemistry of the molecule object. addstereohydrogens! can be used to revert the change.

source
MolecularGraph.setdiastereo!Method
setdiastereo!(mol::Union{SMILES,SDFile}) -> Nothing

Set diastereomerism flags to Bond.stereo fields of double bonds.

Bond.stereo::Symbol indicates whether the lower index nodes attached to each sides of the double bond is in :cis, :trans or :unspecified configuration.

source
MolecularGraph.setstereocenter!Method
setstereocenter!(mol::SDFile) -> Nothing

Set stereocenter information to Atom.stereo (:unspecified, :clockwise, :anticlockwise or :atypical). Clockwise/anticlockwise means the configuration of 2-4th nodes in index label order when we see the chiral center from the node labeled by the lowest index. If there is an implicit hydrogen, its index label will be regarded as the same as the stereocenter atom.

source