Preprocessing

MolecularGraph.depolarizeMethod
depolarize(mol::GraphMol; negative=:O, positive=[:C, :P]) -> GraphMol

Return the molecule with its dipole double bonds are depolarized.

source
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.kekulizeMethod
kekulize(mol::SMILES) -> SMILES

Return the molecule with SMILES aromatic bonds kekulized.

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 should be applied for molecules parsed from SMILES. Otherwise, some bond valence and implicit hydrogen properties would be wrong.

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

Return the molecule with its dipole double bonds are polarized.

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.toallenelikeMethod
toallenelike(mol::GraphMol) -> GraphMol

Return the molecule with its 1,3-dipole groups described in allene-like resonance structure (ex. Diazo group [C-][N+]#N -> C=[N+]=[N-]).

source
MolecularGraph.totriplebondMethod
totriplebond(mol::GraphMol) -> GraphMol

Return the molecule with its 1,3-dipole groups described in triple bond resonance structure (ex. 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.optimizewedges!Method
optimizewedges!(mol::SDFile)

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.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)

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