molfoundry.Graph#

class molfoundry.Graph#
static fromGMLString(gml, name=None, graphType=GraphType.Default, add=True)#
Parameters:
Return type:

Graph

static fromSMILES(smiles, name=None, graphType=GraphType.Default, add=True)#
Parameters:
Return type:

Graph

static fromDFS(dfs, name=None, graphType=GraphType.Default, add=True)#

Build a Graph from a GraphDFS line-notation string.

Bare organic-subset atoms (C, N, O, …) are given implicit hydrogens as in SMILES; a bracketed [...] vertex is an arbitrary label and gets none. Ring bonds use defRingId / back-edge numbers.

Parameters:
Return type:

Graph

static fromInChI(inchi, name=None, graphType=GraphType.Default, add=True)#
Parameters:
Return type:

Graph

static fromMolfile(molfile, name=None, graphType=GraphType.Default, add=True)#
Parameters:
Return type:

Graph

static fromRMG(adjacencyList, name=None, add=True)#
Parameters:
  • adjacencyList (str)

  • name (str | None)

Return type:

Graph

getGMLString(withCoords=False)#
Parameters:

withCoords (bool)

Return type:

str

vLabelCount(label)#
Parameters:

label (str)

Return type:

int

eLabelCount(label)#
Parameters:

label (str)

Return type:

int

aut()#
Return type:

AutGroup

autInChI()#
Return type:

AutGroup | None

property id: int#
property type: GraphType#
property name: str#
property canonKey: str#
property smiles: str#
property smilesWithIds: str#
property smilesWithExternalIds: str#
property molfile: str#
property inchi: str | None#
property inchiKey: str | None#
property numVertices: int#
property numEdges: int#
property isMolecule: bool#
property exactMass: float#
property vertices: VertexRange#
property edges: EdgeRange#
getVertexFromExternalId(id)#
Parameters:

id (int)

Return type:

Vertex

property minExternalId: int#
property maxExternalId: int#
removeHydrogens()#
Return type:

Graph

print() → None#
print(printer: GraphPrinter | None = None) → None
Parameters:

printer (GraphPrinter | None)

svg() → str#
svg(printer: GraphPrinter | None = None) → str

Render the graph to an SVG string and return it — the same depiction print shows, without the summary card wrapper.

Per-vertex overlay markers (e.g. for atom tracing) come from the printer’s GraphPrinter.pushVertexOverlay() resolver.

Parameters:

printer (GraphPrinter | None)

Return type:

str

isomorphism(codomain, labelSettings=LabelSettings(LabelType.String, LabelRelation.Isomorphism))#
Parameters:
Return type:

bool

monomorphism(codomain, labelSettings=LabelSettings(LabelType.String, LabelRelation.Isomorphism))#
Parameters:
Return type:

bool

clone()#
Return type:

Graph