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{SimpleMolGraph}) -> Type
eproptype(mol::SimpleMolGraph) -> Type

Return the type of edge properties

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::AbstractMolGraph{T}, src, dst) where T -> Edge{T}

A workaround for UndirectedEdge that are not yet implemented in SimpleGraph

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

Return the type of vertex properties

source
MolecularGraph.propsMethod
props(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).

source
MolecularGraph.set_prop!Method
set_prop!(mol::ReactiveMolGraph, v::Integer, value::AbstractAtom) -> Nothing
set_prop!(mol::ReactiveMolGraph, e::Edge, value::AbstractBond) -> Nothing

Set properties (vertex or edge attributes).

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.atom_massMethod
atom_mass(atom::AbstractAtom) -> Int

Return specific atomic mass of given atom, or return nothing if the mass is unspecified.

source
MolecularGraph.atom_numberMethod
atom_number(atomsymbol::Symbol) -> Int
atom_number(atomp::AbstractAtom) -> Int

Return an atomic number of the given atom or the atomic symbol.

source
MolecularGraph.atom_symbolMethod
atom_symbol(n::Int) -> Symbol
atom_symbol(atom::AbstractAtom) -> Symbol

Return an atomic symbol of the given atom or the atomic number.

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