Methods
(static) areSetsEqual(setA, setB) → {Boolean}
Checks whether or not two sets are equal (contain the same elements).
Parameters:
Name | Type | Description |
---|---|---|
setA |
Set.<Number> | A set. |
setB |
Set.<Number> | A set. |
Returns:
A boolean indicating whether or not the two sets are equal.
- Type
- Boolean
(static) bondsToAtoms(bonds) → {Set.<Number>}
Return a set of vertex indices contained in an array of bonds.
Parameters:
Name | Type | Description |
---|---|---|
bonds |
Array | An array of bonds. A bond is defined as [ sourceVertexId, targetVertexId ]. |
Returns:
An array of vertices.
- Type
- Set.<Number>
(static) getBondCount(atoms, adjacencyMatrix) → {Number}
Returns the number of bonds within a set of atoms.
Parameters:
Name | Type | Description |
---|---|---|
atoms |
Set.<Number> | An array of atom ids. |
adjacencyMatrix |
Array.<Array> | An adjacency matrix. |
Returns:
The number of bonds in a set of atoms.
- Type
- Number
(static) getEdgeCount(adjacencyMatrix) → {Number}
Returns the number of edges in a graph defined by an adjacency matrix.
Parameters:
Name | Type | Description |
---|---|---|
adjacencyMatrix |
Array.<Array> | An adjacency matrix. |
Returns:
The number of edges in the graph defined by the adjacency matrix.
- Type
- Number
(static) getEdgeList(adjacencyMatrix) → {Array.<Array>}
Returns an edge list constructed form an adjacency matrix.
Parameters:
Name | Type | Description |
---|---|---|
adjacencyMatrix |
Array.<Array> | An adjacency matrix. |
Returns:
An edge list. E.g. [ [ 0, 1 ], ..., [ 16, 2 ] ]
- Type
- Array.<Array>
(static) getPathIncludedDistanceMatrices(adjacencyMatrix) → {Object}
Returnes the two path-included distance matrices used to find the sssr.
Parameters:
Name | Type | Description |
---|---|---|
adjacencyMatrix |
Array.<Array> | An adjacency matrix. |
Returns:
The path-included distance matrices. { p1, p2 }
- Type
- Object
(static) getRingCandidates(d, pe, pe_prime) → {Array.<Array>}
Get the ring candidates from the path-included distance matrices.
Parameters:
Name | Type | Description |
---|---|---|
d |
Array.<Array> | The distance matrix. |
pe |
Array.<Array> | A matrix containing the shortest paths. |
pe_prime |
Array.<Array> | A matrix containing the shortest paths + one vertex. |
Returns:
The ring candidates.
- Type
- Array.<Array>
(static) getRings(graph) → {Array.<Array>}
Returns an array containing arrays, each representing a ring from the smallest set of smallest rings in the graph.
Parameters:
Name | Type | Description |
---|---|---|
graph |
SmilesDrawer.Graph | A SmilesDrawer.Graph object. |
Returns:
An array containing arrays, each representing a ring from the smallest set of smallest rings in the group.
- Type
- Array.<Array>
(static) getSSSR(c, d, adjacencyMatrix, pe, pe_prime, arrBondCount, arrRingCount, nsssr) → {Array.<Set>}
Searches the candidates for the smallest set of smallest rings.
Parameters:
Name | Type | Description |
---|---|---|
c |
Array.<Array> | The candidates. |
d |
Array.<Array> | The distance matrix. |
adjacencyMatrix |
Array.<Array> | An adjacency matrix. |
pe |
Array.<Array> | A matrix containing the shortest paths. |
pe_prime |
Array.<Array> | A matrix containing the shortest paths + one vertex. |
arrBondCount |
Array.<Array> | A matrix containing the bond count of each vertex. |
arrRingCount |
Array.<Array> | A matrix containing the number of rings associated with each vertex. |
nsssr |
Number | The theoretical number of rings in the graph. |
Returns:
The smallest set of smallest rings.
- Type
- Array.<Set>
(static) isSupersetOf(setA, setB) → {Boolean}
Checks whether or not a set (setA) is a superset of another set (setB).
Parameters:
Name | Type | Description |
---|---|---|
setA |
Set.<Number> | A set. |
setB |
Set.<Number> | A set. |
Returns:
A boolean indicating whether or not setB is a superset of setA.
- Type
- Boolean
(static) matrixToString(matrix) → {String}
Creates a printable string from a matrix (2D array).
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Array.<Array> | A 2D array. |
Returns:
A string representing the matrix.
- Type
- String
(static) pathSetsContain(pathSets, pathSet, bonds, allBonds, arrBondCount, arrRingCount) → {Boolean}
Checks whether or not a given path already exists in an array of paths.
Parameters:
Name | Type | Description |
---|---|---|
pathSets |
Array.<Set> | An array of sets each representing a path. |
pathSet |
Set.<Number> | A set representing a path. |
bonds |
Array.<Array> | The bonds associated with the current path. |
allBonds |
Array.<Array> | All bonds currently associated with rings in the SSSR set. |
arrBondCount |
Array.<Array> | A matrix containing the bond count of each vertex. |
arrRingCount |
Array.<Array> | A matrix containing the number of rings associated with each vertex. |
Returns:
A boolean indicating whether or not a give path is contained within a set.
- Type
- Boolean