Class ScaffoldNodeBase<MoleculeType>

java.lang.Object
org.openscience.cdk.tools.scaffold.ScaffoldNodeBase<MoleculeType>
Type Parameters:
MoleculeType - As MoleculeType, any data type can be defined. In our scenario, the node contains a CDK IAtomContainer.
Direct Known Subclasses:
NetworkNode, TreeNode

public abstract class ScaffoldNodeBase<MoleculeType> extends Object
Inspired by: Another Tree Structure
Base class of node objects. Contains the basic functionality of nodes needed for a ScaffoldTree or ScaffoldNetwork.
Version:
1.0.1.0
Author:
Julian Zander, Jonas Schaub (zanderjulian@gmx.de, jonas.schaub@uni-jena.de)
  • Field Details

    • molecule

      protected MoleculeType molecule
      Molecule that can be stored in each node
    • originSmilesList

      protected List<String> originSmilesList
      List of SMILES of the molecules from which this fragment originates. If additional information of the origin is needed, it can be stored in a matrix with the IAtomContainer. The SMILES stored here can then be used as a key.
    • nonVirtualOriginSmilesList

      protected List<String> nonVirtualOriginSmilesList
      List of SMILES of the molecules from which this fragment directly originates. NonVirtualOrigin: This node is the direct(without further fragmentation) scaffold of this origin molecule. If additional information of the origin is needed, it can be stored in a matrix with the IAtomContainer. The SMILES stored here can then be used as a key.
    • children

      protected List<ScaffoldNodeBase<MoleculeType>> children
      Children of the Node
  • Constructor Details

  • Method Details

    • isLeaf

      public boolean isLeaf()
      Indicates whether it has children
      Returns:
      true if it has no children
    • isOrphan

      public abstract boolean isOrphan()
      Shows if the node has parents
      Returns:
      Whether the node has parents
    • addChild

      public abstract ScaffoldNodeBase<MoleculeType> addChild(MoleculeType aMolecule) throws NullPointerException
      Adds a child to the ScaffoldNodeBase, i.e. links it to a ScaffoldNodeBase on the level below
      Parameters:
      aMolecule - Molecule of the child
      Returns:
      Node of the child
      Throws:
      NullPointerException - if parameter is null
    • addOriginSmiles

      public void addOriginSmiles(String aString) throws NullPointerException
      Adds another string to the OriginSmilesList if it is not already present.
      Parameters:
      aString - String to be added
      Throws:
      NullPointerException - if parameter is null
    • addNonVirtualOriginSmiles

      public void addNonVirtualOriginSmiles(String aString) throws NullPointerException
      Adds another string to the NonVirtualOriginSmilesList if it is not already present. NonVirtualOrigin: This node is the direct(without further fragmentation) scaffold of this origin molecule.
      Parameters:
      aString - String to be added
      Throws:
      NullPointerException - if parameter is null
    • hasNonVirtualOriginSmiles

      public boolean hasNonVirtualOriginSmiles()
      Indicates whether the molecule has at least one nonVirtualOrigin. NonVirtualOrigin: This node is the direct(without further fragmentation) scaffold of this origin molecule.
      Returns:
      true if the molecule has at least one nonVirtualOrigin
    • getLevel

      public abstract int getLevel()
      Outputs the level on which the node is located in the entire graph structure. The level indicates the distance to the root (node without parents) and is determined by setting the level of the parent node + 1. The root itself has the level 0. The level is therefore dependent on the data structure and does not have to be set.
      Returns:
      level of the node in the entire node collection
    • getMolecule

      public MoleculeType getMolecule()
      Get the node molecule.
      Returns:
      node molecule
    • setMolecule

      public void setMolecule(MoleculeType aMolecule) throws NullPointerException
      Set the node molecule.
      Parameters:
      aMolecule - molecule that are set
      Throws:
      NullPointerException - if parameter is null
    • getChildren

      public List<ScaffoldNodeBase<MoleculeType>> getChildren()
      Get the children nodes.
      Returns:
      children nodes
    • setChildren

      public void setChildren(List<ScaffoldNodeBase<MoleculeType>> aChildren) throws NullPointerException
      Set the children node.
      Parameters:
      aChildren - children that are set
      Throws:
      NullPointerException - if parameter is null
    • getOriginSmilesList

      public List<String> getOriginSmilesList()
      Get the originSmilesList
      Returns:
      List of SMILES of the molecules from which this fragment originates
    • getNonVirtualOriginSmilesList

      public List<String> getNonVirtualOriginSmilesList()
      Get the nonVirtualOriginSmilesList NonVirtualOrigin: This node is the direct(without further fragmentation) scaffold of this origin molecule.
      Returns:
      List of SMILES of the molecules from which this fragment originates
    • getOriginCount

      public Integer getOriginCount()
      Get the size of the originSmilesList
      Returns:
      size of the originSmilesList
    • getNonVirtualOriginCount

      public Integer getNonVirtualOriginCount()
      Get the size of the nonVirtualSmilesList NonVirtualOrigin: This node is the direct(without further fragmentation) scaffold of this origin molecule.
      Returns:
      size of the nonVirtualSmilesList
    • setOriginSmilesList

      public void setOriginSmilesList(List<String> aOriginSmilesList) throws NullPointerException
      Set the entire originSmilesList
      Parameters:
      aOriginSmilesList - SMILES of molecules that are set
      Throws:
      NullPointerException - if parameter is null
    • setNonVirtualOriginSmilesList

      public void setNonVirtualOriginSmilesList(List<String> aNonVirtualOriginSmilesList) throws NullPointerException
      Set the entire nonVirtualOriginSmilesList. NonVirtualOrigin: This node is the direct(without further fragmentation) scaffold of this origin molecule.
      Parameters:
      aNonVirtualOriginSmilesList - SMILES of molecules that are set
      Throws:
      NullPointerException - if parameter is null