Class ScaffoldNetwork

java.lang.Object
org.openscience.cdk.tools.scaffold.ScaffoldNodeCollectionBase
org.openscience.cdk.tools.scaffold.ScaffoldNetwork

public class ScaffoldNetwork extends ScaffoldNodeCollectionBase
Top-level class to organise the NetworkNodes A network can have several roots and leaves.
Version:
1.0.2.1
Author:
Julian Zander, Jonas Schaub (zanderjulian@gmx.de, jonas.schaub@uni-jena.de)
  • Constructor Details

    • ScaffoldNetwork

      public ScaffoldNetwork(org.openscience.cdk.smiles.SmilesGenerator aSmilesGenerator)
      Constructor
      Parameters:
      aSmilesGenerator - Used SMILES Generator
    • ScaffoldNetwork

      public ScaffoldNetwork()
      Default Constructor
  • Method Details

    • addNode

      public void addNode(ScaffoldNodeBase aNode) throws org.openscience.cdk.exception.CDKException, IllegalArgumentException, NullPointerException
      Add a node to the graph structure. The same node can also be added several times. It may therefore be necessary to check whether the node already exists. See containsMolecule(); Description copied from ScaffoldNodeCollectionBase.
      Specified by:
      addNode in class ScaffoldNodeCollectionBase
      Parameters:
      aNode - Node to be added. Must match the scaffold node collection type. For example, a ScaffoldTree requires a TreeNode.
      Throws:
      org.openscience.cdk.exception.CDKException - In case of a problem with the SmilesGenerator
      IllegalArgumentException - if the node does not match the scaffold node collection type
      NullPointerException - if parameter is null
    • updateLevelMap

      public void updateLevelMap()
      Updates the assignment of nodes to levels in the level map by iterating over all nodes and enquiring their levels. To be used after the merging of another network and internally after the addition of another node.
    • removeNode

      public void removeNode(ScaffoldNodeBase aNode) throws org.openscience.cdk.exception.CDKException, IllegalArgumentException, NullPointerException
      Removes a node. This does not change the order. The numbering does not change. Description copied from ScaffoldNodeCollectionBase.
      Specified by:
      removeNode in class ScaffoldNodeCollectionBase
      Parameters:
      aNode - Node to remove. Must match the scaffold node collection type. For example, a ScaffoldTree requires a TreeNode.
      Throws:
      org.openscience.cdk.exception.CDKException - In case of a problem with the SmilesGenerator
      IllegalArgumentException - if the node is not in the scaffold node collection
      NullPointerException - if parameter is null
    • mergeNetwork

      public void mergeNetwork(ScaffoldNetwork aScaffoldNetwork) throws org.openscience.cdk.exception.CDKException
      Adds another ScaffoldNetwork to the existing one. The new network is inserted at the node that both networks have in common. All children of the new network at this node and there linkages are taken over if they do not already exist. The new network is simply taken over if the existing network is empty. If there is no match between the two networks the new network is inserted without linkages. If a molecule generates an empty scaffold, it is stored as a node with empty SMILES and is treated normally. All other empty nodes are then added to this network accordingly. By querying the origins of this node, all molecules that do not produce a scaffold can be returned.
      Parameters:
      aScaffoldNetwork - network to be inserted into the existing ScaffoldNetwork.
      Throws:
      org.openscience.cdk.exception.CDKException - In case of a problem with the SmilesGenerator
    • getMatrix

      public Integer[][] getMatrix() throws IllegalStateException
      Outputs an adjacency matrix in which the parent node of each node is marked with 1. All others are marked with 0. Each row and column number in the matrix is assigned to a node. The assignment can be requested with getMatrixNodes/getMatrixNode. Description copied from ScaffoldNodeCollectionBase.
      Specified by:
      getMatrix in class ScaffoldNodeCollectionBase
      Returns:
      the adjacency matrix
      Throws:
      IllegalStateException - if the tree is not connected
    • getRoots

      public List<NetworkNode> getRoots()
      Outputs root nodes of the network.
      Returns:
      root nodes of the network