Molecular graph models

Basic molecular graph type and interfaces

MolecularGraph.edge_neighborsMethod
edge_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.

source
MolecularGraph.eproptypeMethod
eproptype(::Type{AbstractMolGraph}) -> Type
eproptype(mol::AbstractMolGraph) -> Type

Return the type of edge properties

source
MolecularGraph.multiplicityMethod
multiplicity(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.

source
MolecularGraph.u_edgeMethod
u_edge(::Type{T}, src, dst) where T <: Integer -> Edge{T}
u_edge(g::SimpleGraph{T}, src, dst) where T -> Edge{T}
u_edge(mol::SimpleMolGraph{T}, src, dst) where T -> Edge{T}

A workaround for UndirectedEdge that are not yet implemented in SimpleGraph

source
MolecularGraph.vproptypeMethod
vproptype(::Type{AbstractMolGraph}) -> Type
vproptype(mol::AbstractMolGraph) -> Type

Return the type of vertex properties

source
MolecularGraph.MolGraphType
MolGraph{T,V,E} <: ReactiveMolGraph{T,V,E}

Basic molecular graph type.

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

source

Default atom and bond types

MolecularGraph.SDFBondType
SDFBond

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