Preprocessing
MolecularGraph.addhydrogens
— Methodaddhydrogens(mol::GraphMol) -> GraphMol
Return the molecule with all hydrogen nodes explicitly attached.
MolecularGraph.allhydrogens
— Methodallhydrogens(mol::GraphMol) -> Set{Int}
Return a set of all hydrogen nodes.
MolecularGraph.depolarize
— Methoddepolarize(mol::GraphMol; negative=:O, positive=[:C, :P]) -> GraphMol
Return the molecule with its dipole double bonds are depolarized.
MolecularGraph.deprotonateoniums
— Methoddeprotonateoniums(mol::GraphMol) -> GraphMol
Return the molecule with its onium groups are deprotonated.
MolecularGraph.extractlargestcomponent
— Methodextractlargestcomponent(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.
MolecularGraph.kekulize
— Methodkekulize(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.
MolecularGraph.largestcomponentnodes
— Methodlargestcomponentnodes(mol::GraphMol) -> Set{Int}
Return a set of nodes in the largest connected component.
MolecularGraph.polarize
— Functionpolarize(mol::GraphMol; negative=:O, positive=[:N, :S]) -> GraphMol
Return the molecule with its dipole double bonds are polarized.
MolecularGraph.protonateacids
— Methodprotonateacids(mol::GraphMol) -> GraphMol
Return the molecule with its oxo(thio) anion groups protonated.
MolecularGraph.removehydrogens
— Methodremovehydrogens(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
).
MolecularGraph.toallenelike
— Methodtoallenelike(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-]).
MolecularGraph.totriplebond
— Methodtotriplebond(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).
MolecularGraph.trivialhydrogens
— Methodtrivialhydrogens(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.
Stereochemistry
MolecularGraph.addstereohydrogens
— Methodaddstereohydrogens(mol::GraphMol) -> GraphMol
Return new molecule with explicit hydrogen nodes attached to stereocenters.
MolecularGraph.optimizewedges!
— Methodoptimizewedges!(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.
MolecularGraph.removestereohydrogens
— Methodremovestereohydrogens(mol::GraphMol) -> GraphMol
Return new molecule without explicit hydrogen nodes attached to stereocenters.
MolecularGraph.setdiastereo!
— Methodsetdiastereo!(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.
MolecularGraph.setstereocenter!
— Methodsetstereocenter!(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.