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
Inspired by: Another Tree Structure
Base class of node objects. Contains the basic functionality of nodes needed for a
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 Summary
FieldsModifier and TypeFieldDescriptionprotected List<ScaffoldNodeBase<MoleculeType>>
Children of the Nodeprotected MoleculeType
Molecule that can be stored in each nodeList of SMILES of the molecules from which this fragment directly originates.List of SMILES of the molecules from which this fragment originates. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ScaffoldNodeBase<MoleculeType>
addChild
(MoleculeType aMolecule) Adds a child to the ScaffoldNodeBase, i.e. links it to a ScaffoldNodeBase on the level belowvoid
addNonVirtualOriginSmiles
(String aString) Adds another string to the NonVirtualOriginSmilesList if it is not already present.void
addOriginSmiles
(String aString) Adds another string to the OriginSmilesList if it is not already present.Get the children nodes.abstract int
getLevel()
Outputs the level on which the node is located in the entire graph structure.Get the node molecule.Get the size of the nonVirtualSmilesList NonVirtualOrigin: This node is the direct(without further fragmentation) scaffold of this origin molecule.Get the nonVirtualOriginSmilesList NonVirtualOrigin: This node is the direct(without further fragmentation) scaffold of this origin molecule.Get the size of the originSmilesListGet the originSmilesListboolean
Indicates whether the molecule has at least one nonVirtualOrigin.boolean
isLeaf()
Indicates whether it has childrenabstract boolean
isOrphan()
Shows if the node has parentsvoid
setChildren
(List<ScaffoldNodeBase<MoleculeType>> aChildren) Set the children node.void
setMolecule
(MoleculeType aMolecule) Set the node molecule.void
setNonVirtualOriginSmilesList
(List<String> aNonVirtualOriginSmilesList) Set the entire nonVirtualOriginSmilesList.void
setOriginSmilesList
(List<String> aOriginSmilesList) Set the entire originSmilesList
-
Field Details
-
molecule
Molecule that can be stored in each node -
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
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
Children of the Node
-
-
Constructor Details
-
ScaffoldNodeBase
Constructor- Parameters:
aMolecule
- molecule of the ScaffoldNodeBase- Throws:
NullPointerException
- if parameter is null
-
-
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
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
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
Get the node molecule.- Returns:
- node molecule
-
setMolecule
Set the node molecule.- Parameters:
aMolecule
- molecule that are set- Throws:
NullPointerException
- if parameter is null
-
getChildren
Get the children nodes.- Returns:
- children nodes
-
setChildren
Set the children node.- Parameters:
aChildren
- children that are set- Throws:
NullPointerException
- if parameter is null
-
getOriginSmilesList
Get the originSmilesList- Returns:
- List of SMILES of the molecules from which this fragment originates
-
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
Get the size of the originSmilesList- Returns:
- size of the originSmilesList
-
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
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
-