Molecular graph models
Basic molecular graph type and interfaces
MolecularGraph.edge_neighbors
— Methodedge_neighbors(g::SimpleGraph{T}, u::Integer, v::Integer) where T -> Tuple{Vector{T},Vector{T}}
edge_neighbors(g::SimpleGraph{T}, e::Edge) where T -> Tuple{Vector{T},Vector{T}}
Return neighbors of the source and destination vertices of the edge, respectively.
MolecularGraph.eproptype
— Methodeproptype(::Type{SimpleMolGraph}) -> Type
eproptype(mol::SimpleMolGraph) -> Type
Return the type of edge properties
MolecularGraph.u_edge
— Methodu_edge(::Type{T}, src, dst) where T <: Integer -> Edge{T}
u_edge(g::SimpleGraph{T}, src, dst) where T -> Edge{T}
u_edge(mol::AbstractMolGraph{T}, src, dst) where T -> Edge{T}
A workaround for UndirectedEdge that are not yet implemented in SimpleGraph
MolecularGraph.vproptype
— Methodvproptype(::Type{SimpleMolGraph}) -> Type
vproptype(mol::SimpleMolGraph) -> Type
Return the type of vertex properties
MolecularGraph.QueryTree
— TypeQueryTree{T<:Integer,U<:AbstractQueryNode} <: AbstractElement
The base class of molecular query trees.
MolecularGraph.Reaction
— TypeReaction{T<:AbstractMolGraph}
Reaction type.
MolecularGraph.props
— Methodprops(mol::ReactiveMolGraph, v::Integer) -> AbstractElement
props(mol::ReactiveMolGraph, e::Edge) -> AbstractElement
props(mol::ReactiveMolGraph, u::Integer, v::Integer) -> AbstractElement
get_prop(mol::ReactiveMolGraph, v::Integer, prop::Symbol)
get_prop(mol::ReactiveMolGraph, e::Edge, prop::Symbol)
get_prop(mol::ReactiveMolGraph, u::Integer, v::Integer, prop::Symbol)
Return properties (vertex or edge attributes).
MolecularGraph.set_prop!
— Methodset_prop!(mol::ReactiveMolGraph, v::Integer, value::AbstractAtom) -> Nothing
set_prop!(mol::ReactiveMolGraph, e::Edge, value::AbstractBond) -> Nothing
Set properties (vertex or edge attributes).
MolecularGraph.MolGraph
— TypeMolGraph{T,V,E} <: ReactiveMolGraph{T,V,E}
Basic molecular graph type.
Usually MolGraph
s are not directly constructed, but constructed by molecule reader methods such as smilestomol
or sdfilereader
. Atom and Bond properties of MolGraph
are specific to the type of morecular reader (e.g. sdfilereader generates MolGraph{Int,SDFAtom,SDFBond}
instances).
Default atom and bond types
MolecularGraph.atom_charge
— Methodatom_charge(atom::AbstractAtom) -> Int
Return atomic charge of the given atom.
MolecularGraph.atom_mass
— Methodatom_mass(atom::AbstractAtom) -> Int
Return specific atomic mass of given atom, or return nothing if the mass is unspecified.
MolecularGraph.atom_number
— Methodatom_number(atomsymbol::Symbol) -> Int
atom_number(atomp::AbstractAtom) -> Int
Return an atomic number of the given atom or the atomic symbol.
MolecularGraph.atom_symbol
— Methodatom_symbol(n::Int) -> Symbol
atom_symbol(atom::AbstractAtom) -> Symbol
Return an atomic symbol of the given atom or the atomic number.
MolecularGraph.multiplicity
— Methodmultiplicity(atom::AbstractAtom) -> Int
Return multiplicity (num of radicals + 1) of the given atom.
This is experimental feature - free radical chemistry is still not introduced to this library. This does nothing for now, but for example, you can set multiplicity=2 to molecular oxygens manually.
MolecularGraph.CommonChemAtom
— TypeCommonChemAtom
CommonChem atom property type.
MolecularGraph.SDFAtom
— TypeSDFAtom
SDFile (CTAB) atom property type.
MolecularGraph.SMILESAtom
— TypeSMILESAtom
SMILES atom property type.
MolecularGraph.bond_order
— Methodbond_order(bond::AbstractBond) -> Int
Return bond order of the given bond.
MolecularGraph.CommonChemBond
— TypeCommonChemBond
CommonChem bond property type.
MolecularGraph.SDFBond
— TypeSDFBond
SDFile (CTAB) bond property type.
- SDFile bond notation
- Single bond
- 0: u - v
- 1: u ◀ v (Up-arrow)
- 4: u ~ v (Up or down)
- 6: u ◁ v (Down-arrow)
- Double bond
- 0: v = u
- 3: u x v (Cis-Trans Unknown)
- Single bond
MolecularGraph.SMILESBond
— TypeSMILESBond
SMILES bond property type.