$darkmode
DENOPTIM
denoptim.graph.Template Class Reference
Inheritance diagram for denoptim.graph.Template:
[legend]
Collaboration diagram for denoptim.graph.Template:
[legend]

Classes

enum  ContractLevel
 Enum specifying to what extent the template's inner graph can be changed. More...
 

Public Member Functions

 Template (Vertex.BBType bbType)
 
String[] getPathIDs (AttachmentPoint apA, AttachmentPoint apB)
 Produces a pair of strings that identify the "path" between two given attachment points. More...
 
ContractLevel getContractLevel ()
 Returns the contract level of this template, i.e., to what extent the content of this template can be changed. More...
 
void setContractLevel (ContractLevel contract)
 Imposes the given contract to this template. More...
 
boolean freezeTemplate ()
 Promotes the contract level of this template to the most constrained one (i.e., ContractLevel#FIXED), i.e. More...
 
Template clone ()
 Returns a deep copy of this template. More...
 
DGraph getInnerGraph ()
 
void setInnerGraph (DGraph innerGraph) throws IllegalArgumentException
 
void addInnerToOuterAPMapping (AttachmentPoint newInnerAP)
 Adds the projection of an AP in the template's inner graph (i.e., innerAP) to the list of APs visible from outside the template (i.e., the outerAPs). More...
 
void updateInnerApID (AttachmentPoint oldInnerAP, AttachmentPoint newInnerAP)
 Replaces a given link between APs on the surface of this template (i.e., outerAP) and the corresponding APs in the embedded graph (i.e., innerAPs). More...
 
void removeProjectionOfInnerAP (AttachmentPoint oldInnerAP) throws DENOPTIMException
 Removes the mapping of the given inner AP from this template's surface, if such mapping exists. More...
 
ArrayList< AttachmentPointgetAttachmentPoints ()
 Return the list of attachment points visible from outside the template, i.e., the so-called outer APs. More...
 
List< SymmetricAPsgetSymmetricAPSets ()
 The SymmetricSet produced from this method contain indexes of the AttachmentPoints in the list returned by getAttachmentPoints(). More...
 
int getHeavyAtomsCount ()
 
boolean containsAtoms ()
 
void clearIAtomContainer ()
 Removes the molecular representation. More...
 
void setIAtomContainer (IAtomContainer mol, boolean updateAPsAccordingToIAC) throws DENOPTIMException
 Attaches a molecular representation to this template. More...
 
IAtomContainer getIAtomContainer ()
 The molecular representation, if any, is generated by this method and stored until further changes in the content of this template. More...
 
IAtomContainer getIAtomContainer (Logger logger, Randomizer rng, boolean removeUsedRCAs, boolean rebuild)
 The molecular representation, if any, is generated by this method and stored until further changes in the content of this template. More...
 
AttachmentPoint getInnerAPFromOuterAP (AttachmentPoint outerAP)
 
AttachmentPoint getOuterAPFromInnerAP (AttachmentPoint innerAP)
 
List< MutationTypegetMutationTypes (List< MutationType > ignoredTypes)
 Returns the list of mutation types. More...
 
List< VertexgetMutationSites (List< MutationType > ignoredTypes)
 A list of mutation sites from within this vertex. More...
 
void addRequiredAP (Point3d pt, APClass apClass)
 Adds attachment point (AP) to the list of required APs on this template. More...
 
boolean sameAs (Template other, StringBuilder reason)
 Compares this and another template ignoring vertex IDs. More...
 
String toJson ()
 Produces a string that represents this vertex and that adheres to the JSON format. More...
 
- Public Member Functions inherited from denoptim.graph.Vertex
 Vertex (VertexType vertexType)
 Constructor for an empty vertex. More...
 
 Vertex (VertexType vertexType, long id)
 Constructor for an identified vertex without attachment points. More...
 
abstract List< AttachmentPointgetAttachmentPoints ()
 
void setAsRCV (boolean isRCV)
 
void setVertexId (long vertexId2)
 
long getVertexId ()
 
int getBuildingBlockId ()
 Returns the index of the building block that should correspond to the position of the building block in the library of building blocks of its kind. More...
 
void setBuildingBlockId (int buildingBlockId)
 
Vertex.BBType getBuildingBlockType ()
 
void setBuildingBlockType (Vertex.BBType buildingBlockType)
 
abstract List< SymmetricAPsgetSymmetricAPSets ()
 
SymmetricAPs getSymmetricAPs (AttachmentPoint ap)
 For the given attachment point index locate the symmetric partners i.e. More...
 
int getNumberOfAPs ()
 
int getFreeAPCount ()
 
ArrayList< AttachmentPointgetFreeAPThroughout ()
 Gets attachment points that are availability throughout the graph level, i.e., checks also across the inner graph template boundary. More...
 
int getFreeAPCountThroughout ()
 Counts the number of attachment points that are availability throughout the graph level, i.e., checks also across the inner graph template boundary. More...
 
ArrayList< AttachmentPointgetCappedAPs ()
 Gets attachment points that are used by capping groups. More...
 
ArrayList< AttachmentPointgetCappedAPsThroughout ()
 Gets attachment points that are used by capping groups throughout the graph levels, i.e., checks also across the inner graph template boundary. More...
 
int getCappedAPCountThroughout ()
 Counts the number of attachment points that are used by BBType#CAP vertex. More...
 
boolean hasFreeAP ()
 
boolean isRCV ()
 
boolean hasSymmetricAP ()
 
String toString ()
 Produces a human readable, short string to represent the vertex by its vertex ID, building block ID (1-based), building block type, and level in the graph (if any). More...
 
void cleanup ()
 
abstract Vertex clone ()
 Returns a deep-copy of this vertex. More...
 
boolean sameAs (Vertex other)
 Compares this and another vertex ignoring vertex IDs. More...
 
boolean sameAs (Vertex other, StringBuilder reason)
 Compares this and another vertex ignoring vertex IDs. More...
 
boolean sameVertexFeatures (Vertex other, StringBuilder reason)
 Compares this and another vertex ignoring vertex IDs. More...
 
abstract int getHeavyAtomsCount ()
 
abstract boolean containsAtoms ()
 
abstract IAtomContainer getIAtomContainer ()
 
abstract IAtomContainer getIAtomContainer (Logger logger, Randomizer rng, boolean removeUsedRCAs, boolean rebuild)
 Method meant to trigger regeneration of the chemical representation, typically needed to drop a low quality structure that is good enough for most cheminformatic tasks, and replace it with a better quality structure that is suitable to be fed to molecular modeling tasks. More...
 
ArrayList< APClassgetAllAPClasses ()
 Returns the list of all APClasses present on this vertex. More...
 
ArrayList< APClassgetAllAvailableAPClasses ()
 Returns the list of all APClasses present on free attachment point on this vertex. More...
 
void resetGraphOwner ()
 
void setGraphOwner (DGraph owner)
 
DGraph getGraphOwner ()
 Returns the graph this vertex belongs to or null. More...
 
List< VertexgetMutationSites ()
 A list of mutation sites from within this vertex. More...
 
abstract List< VertexgetMutationSites (List< MutationType > ignoredTypes)
 A list of mutation sites from within this vertex. More...
 
void setMutationTypes (List< MutationType > lst)
 
boolean removeMutationType (MutationType mt)
 Removes the specified mutation type. More...
 
List< MutationTypegetMutationTypes ()
 Returns the list of mutation types. More...
 
List< MutationTypegetMutationTypes (List< MutationType > excludedTypes)
 Returns the list of mutation types. More...
 
AttachmentPoint getAP (int i)
 Get attachment point i on this vertex. More...
 
AttachmentPoint getAPWithId (int i)
 Get attachment point that has the given identifier, or null. More...
 
int getIndexOfAP (AttachmentPoint ap)
 Returns the position of the given AP in the list of APs of this vertex. More...
 
Edge getEdgeToParent ()
 Looks into the edges that use any of the APs that belong to this vertex and returns the edge that has this vertex as the target, i.e., the edge to the parent vertex. More...
 
Vertex getParent ()
 Looks into the edges that use any of the APs that belong to this vertex and returns the vertex which is the source of the edge in which this vertex is the target. More...
 
ArrayList< AttachmentPointgetAPsFromChildren ()
 Looks into the edges that use any of the APs that belong to this vertex and returns the list of attachment point on child vertices that form an edge with any of the APs of this vertex. More...
 
ArrayList< VertexgetChildrenThroughout ()
 Looks into the edges that use any of the APs that belong to this vertex and returns the list of vertices which are target of any edge departing from this vertex. More...
 
ArrayList< VertexgetChilddren ()
 Looks into the edges that use any of the APs that belong to this vertex and returns the list of vertices which are target of any edge departing from this vertex. More...
 
void setUniquefyingProperty (String key)
 Add the given key among the properties that are checked for equality when comparing vertices with the Vertex#sameAs(Vertex, StringBuilder) method. More...
 
Map< Object, Object > getProperties ()
 
boolean hasProperty (Object property)
 
Object getProperty (Object property)
 
void setProperty (Object key, Object property)
 
void removeProperty (Object key)
 
void setProperties (Map< Object, Object > properties)
 
VertexType getVertexType ()
 Returns the value of the vertex type. More...
 
String[] getPathIDs (AttachmentPoint apA, AttachmentPoint apB)
 Produces a pair of strings that identify the "path" between two given attachment points. More...
 
boolean connectedTo (Vertex other)
 Checks if this and another vertex are directly connected by an edge within the same graph recursion level, i.e., both vertices must belong to the same graph. More...
 
Edge getEdgeWith (Vertex other)
 Finds the edge between this and the other vertex, if it exists. More...
 

Static Public Member Functions

static Template getTestTemplate (ContractLevel contractLevel) throws DENOPTIMException
 Method meant for devel phase only. More...
 
static Template fromJson (String json)
 Reads a JSON string and returns an instance of this class. More...
 
- Static Public Member Functions inherited from denoptim.graph.Vertex
static Vertex newVertexFromLibrary (int bbId, Vertex.BBType bbt, FragmentSpace fragSpace) throws DENOPTIMException
 Builds a new molecular fragment kind of vertex. More...
 
static Vertex newVertexFromLibrary (long vertexId, int bbId, Vertex.BBType bbt, FragmentSpace fragSpace) throws DENOPTIMException
 Make a new vertex that is a copy of a vertex in the fragment space. More...
 
static Vertex fromJson (String json)
 
static Vertex convertIACToVertex (IAtomContainer iac, Vertex.BBType bbt) throws DENOPTIMException
 Processes an IAtomContainer and builds a Vertex that is an instance of Fragment. More...
 
static Vertex parseVertexFromSDFFormat (IAtomContainer mol, Gson reader, BBType bbt) throws DENOPTIMException
 Created a Vertex from the SDF representation, i.e., from an IAtomContainer. More...
 

Protected Member Functions

void setSymmetricAPSets (List< SymmetricAPs > sAPs)
 This method exists by contract, but does not do anything because the concept of setting the symmetric set of APs in a template is not defined yet. More...
 
void addSymmetricAPSet (SymmetricAPs symAPs)
 
- Protected Member Functions inherited from denoptim.graph.Vertex
abstract void setSymmetricAPSets (List< SymmetricAPs > sAPs)
 
abstract void addSymmetricAPSet (SymmetricAPs symAPs)
 
int getUniqueAPIndex ()
 
List< MutationTypegetUnfilteredMutationTypes ()
 Returns the mutation types that are constitutionally configures for this vertex irrespectively on the graph or the context in which this vertex is included. More...
 
Map< Object, Object > copyStringBasedProperties ()
 Copies all the string-based properties and properties defined in the Vertex#uniquefyingPropertyKeys set. More...
 

Private Member Functions

void updateInnerToOuter (TreeMap< Integer, AttachmentPoint > map)
 
boolean isValidInnerGraph (DGraph g)
 
void updateMutTypeToFixedSTructure ()
 
List< AttachmentPointgetRequiredAPs ()
 

Private Attributes

DGraph innerGraph
 Graph that is embedded in this vertex. More...
 
IAtomContainer mol = null
 Molecular representation of the content of this template. More...
 
ContractLevel contractLevel = ContractLevel.FIXED
 Denotes the constants in the template. More...
 
List< AttachmentPointrequiredAPs = new ArrayList<>()
 
APTreeMap innerToOuterAPs
 

Additional Inherited Members

- Protected Attributes inherited from denoptim.graph.Vertex
int buildingBlockId = -99
 Index of this building block in the library of building blocks, or negative if this vertex is not part of a library. More...
 
BBType buildingBlockType = Vertex.BBType.UNDEFINED
 
Map< Object, Object > properties
 Map of customizable properties. More...
 
Set< String > uniquefyingPropertyKeys = new HashSet<String>()
 List of properties required to make Vertex#sameAs(Vertex, StringBuilder) method return false when property values differ. More...
 
final VertexType vertexType
 Field distinguishing implementations of Vertex when deserializing JSON representations. More...
 

Detailed Description

A template is a Vertex that contains a DGraph. The content of the template, i.e., the embedded DGraph, is subject to constraints that are defined by the ContractLevel of the template and may or may not allow changes on the embedded DGraph.

The embedded DGraph projects a reflection of any available AttachmentPoint to the surface of the template. The inner AttachmentPoints, i.e., those owned by the embedded DGraph, are not the same instances as the outer ones, i.e., those on the surface of the template. However, this class keeps a one-to-one mapping that is made available by the innerToOuterAPs method. The distinction of inner and outer AttachmentPoints determines the existence of a barrier between the inside and the outside of a template. Methods mark with the word "Throughout" are used for operations that go across such barrier.

For example, consider an AttachmentPoint in the embedded DGraph (i.e., the inner AttachmentPoint. The AttachmentPoint#isAvailable() method returns true even if its extra-template reflection (i.e., the outer AttachmentPoint) is used to make an edge to the template. Instead, the AttachmentPoint#isAvailableThroughout() returns false because it is capable of crossing the template barrier.

Definition at line 79 of file Template.java.

Constructor & Destructor Documentation

◆ Template()

denoptim.graph.Template.Template ( Vertex.BBType  bbType)

Definition at line 134 of file Template.java.

References denoptim.graph.Vertex.setBuildingBlockType(), and denoptim.graph.Vertex.VertexType.Template.

Referenced by denoptim.graph.Template.clone(), denoptim.graph.Template.getTestTemplate(), and denoptim.graph.Template.updateMutTypeToFixedSTructure().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ addInnerToOuterAPMapping()

void denoptim.graph.Template.addInnerToOuterAPMapping ( AttachmentPoint  newInnerAP)

Adds the projection of an AP in the template's inner graph (i.e., innerAP) to the list of APs visible from outside the template (i.e., the outerAPs).

The AP created on the template's surface is a clone of that given as argument. If the given AP already has a mapping, nothing happens.

Parameters
newInnerAPthe inner AP to project on template's surface.

Definition at line 348 of file Template.java.

References denoptim.graph.Template.addInnerToOuterAPMapping(), denoptim.graph.AttachmentPoint.clone(), denoptim.graph.Vertex.getGraphOwner(), denoptim.graph.Template.innerToOuterAPs, denoptim.graph.APTreeMap.put(), denoptim.graph.AttachmentPoint.setOwner(), and denoptim.graph.DGraph.templateJacket.

Referenced by denoptim.graph.Template.addInnerToOuterAPMapping(), denoptim.graph.DGraph.insertSingleVertex(), denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.DGraph.replaceSingleSubGraph(), and denoptim.graph.Template.setInnerGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addRequiredAP()

void denoptim.graph.Template.addRequiredAP ( Point3d  pt,
APClass  apClass 
)

Adds attachment point (AP) to the list of required APs on this template.

Parameters
apattachment point to require from this template
Exceptions
DENOPTIMException

Definition at line 935 of file Template.java.

References denoptim.graph.Template.clearIAtomContainer(), denoptim.graph.Template.getInnerGraph(), and denoptim.graph.Template.requiredAPs.

Referenced by denoptim.graph.Template.clone(), and denoptim.graph.TemplateTest.testAddAP_after_setInnerGraph_throwsException().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addSymmetricAPSet()

void denoptim.graph.Template.addSymmetricAPSet ( SymmetricAPs  symAPs)
protected

Reimplemented from denoptim.graph.Vertex.

Definition at line 482 of file Template.java.

◆ clearIAtomContainer()

void denoptim.graph.Template.clearIAtomContainer ( )

Removes the molecular representation.

Definition at line 600 of file Template.java.

Referenced by denoptim.graph.Template.addRequiredAP(), denoptim.ga.GraphOperations.performMutation(), denoptim.graph.DGraph.replaceSingleSubGraph(), denoptim.graph.Template.setInnerGraph(), and denoptim.graph.Template.updateInnerToOuter().

Here is the caller graph for this function:

◆ clone()

Template denoptim.graph.Template.clone ( )

Returns a deep copy of this template.

Returns
the deep copy

Reimplemented from denoptim.graph.Vertex.

Definition at line 243 of file Template.java.

References denoptim.graph.Template.addRequiredAP(), denoptim.graph.Template.clone(), denoptim.graph.Template.contractLevel, denoptim.graph.Vertex.copyStringBasedProperties(), denoptim.graph.AttachmentPoint.getAtomPositionNumber(), denoptim.graph.Template.getAttachmentPoints(), denoptim.graph.Vertex.getBuildingBlockId(), denoptim.graph.Vertex.getBuildingBlockType(), denoptim.graph.AttachmentPoint.getDirectionVector(), denoptim.graph.Template.getInnerGraph(), denoptim.graph.Vertex.getUnfilteredMutationTypes(), denoptim.graph.Vertex.getVertexId(), denoptim.utils.MoleculeUtils.makeSameAs(), denoptim.graph.Template.mol, denoptim.graph.AttachmentPoint.setAtomPositionNumber(), denoptim.graph.Vertex.setBuildingBlockId(), denoptim.graph.AttachmentPoint.setDirectionVector(), denoptim.graph.Template.setInnerGraph(), denoptim.graph.Vertex.setMutationTypes(), denoptim.graph.Vertex.setProperties(), denoptim.graph.Vertex.setVertexId(), denoptim.graph.Template.Template(), and denoptim.graph.Vertex.uniquefyingPropertyKeys.

Referenced by denoptim.graph.Template.clone(), denoptim.graph.TemplateTest.testClone(), denoptim.graph.AttachmentPointTest.testHasConnectedSrcAtom(), and denoptim.graph.TemplateTest.testNestedTemplateCloning().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ containsAtoms()

boolean denoptim.graph.Template.containsAtoms ( )

Reimplemented from denoptim.graph.Vertex.

Definition at line 585 of file Template.java.

References denoptim.graph.DGraph.containsAtoms(), denoptim.graph.Template.innerGraph, and denoptim.graph.Template.mol.

Referenced by denoptim.gui.VertexViewPanel.loadTemplateToViewer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freezeTemplate()

boolean denoptim.graph.Template.freezeTemplate ( )

Promotes the contract level of this template to the most constrained one (i.e., ContractLevel#FIXED), i.e.

makes the template unable to change after calling this method.

Returns
true if already frozen. Else false.

Definition at line 231 of file Template.java.

References denoptim.graph.Template.contractLevel, and denoptim.graph.Template.ContractLevel.FIXED.

Referenced by denoptim.graph.TemplateTest.testClone().

Here is the caller graph for this function:

◆ fromJson()

static Template denoptim.graph.Template.fromJson ( String  json)
static

Reads a JSON string and returns an instance of this class.

Parameters
jsonthe string to parse.
Returns
a new instance of this class.

Reimplemented from denoptim.graph.Vertex.

Definition at line 1028 of file Template.java.

References denoptim.graph.DGraph.fromJson(), denoptim.graph.Template.fromJson(), denoptim.graph.Template.getAttachmentPoints(), denoptim.json.DENOPTIMgson.getReader(), denoptim.graph.Template.innerGraph, denoptim.graph.Template.setInnerGraph(), and denoptim.graph.Template.updateInnerToOuter().

Referenced by denoptim.graph.Vertex.DENOPTIMVertexDeserializer.deserialize(), and denoptim.graph.Template.fromJson().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAttachmentPoints()

ArrayList< AttachmentPoint > denoptim.graph.Template.getAttachmentPoints ( )

Return the list of attachment points visible from outside the template, i.e., the so-called outer APs.

Each outer AP is a projection of an AP present in the embedded graph, i.e., inner AP.

Returns
the list of outer AP

Reimplemented from denoptim.graph.Vertex.

Definition at line 458 of file Template.java.

References denoptim.graph.Template.innerToOuterAPs.

Referenced by denoptim.graph.Template.clone(), denoptim.graph.Template.fromJson(), denoptim.graph.Template.getIAtomContainer(), denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.gui.GraphViewerPanel.renumberAPs(), denoptim.graph.Template.setIAtomContainer(), denoptim.graph.TemplateTest.testGetIAtomContainer(), denoptim.graph.TemplateTest.testGetIAtomContainer_DeepVertex(), and denoptim.json.DENOPTIMgsonTest.testTemplateSerialization().

Here is the caller graph for this function:

◆ getContractLevel()

ContractLevel denoptim.graph.Template.getContractLevel ( )

Returns the contract level of this template, i.e., to what extent the content of this template can be changed.

Returns
the contract level of this template.

Definition at line 203 of file Template.java.

References denoptim.graph.Template.contractLevel.

Referenced by denoptim.ga.GraphOperations.checkAndAddXoverSites(), denoptim.ga.GraphOperations.locateCompatibleXOverPoints(), and denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol().

Here is the caller graph for this function:

◆ getHeavyAtomsCount()

int denoptim.graph.Template.getHeavyAtomsCount ( )

Reimplemented from denoptim.graph.Vertex.

Definition at line 577 of file Template.java.

References denoptim.graph.DGraph.getHeavyAtomsCount(), and denoptim.graph.Template.innerGraph.

Here is the call graph for this function:

◆ getIAtomContainer() [1/2]

IAtomContainer denoptim.graph.Template.getIAtomContainer ( )

The molecular representation, if any, is generated by this method and stored until further changes in the content of this template.

Successive calls of this method (i.e., prior to any other modification in this template's content) return the result stored in the first run occurred after the last edit of this template's content.

Returns
the molecular representation of the content of this template.

Reimplemented from denoptim.graph.Vertex.

Definition at line 715 of file Template.java.

References denoptim.graph.Template.getIAtomContainer().

Referenced by denoptim.graph.Template.getIAtomContainer(), denoptim.gui.VertexViewPanel.loadTemplateToViewer(), denoptim.graph.TemplateTest.testGetIAtomContainer(), denoptim.graph.TemplateTest.testGetIAtomContainer_DeepVertex(), denoptim.json.DENOPTIMgsonTest.testTemplateSerialization(), and denoptim.gui.GraphVertexMolViewerPanel.visualizeVertexInNestedViewer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIAtomContainer() [2/2]

IAtomContainer denoptim.graph.Template.getIAtomContainer ( Logger  logger,
Randomizer  rng,
boolean  removeUsedRCAs,
boolean  rebuild 
)

The molecular representation, if any, is generated by this method and stored until further changes in the content of this template.

Successive calls of this method (i.e., prior to any other modification in this template's content) return the result stored in the first run occurred after the last edit of this template's content.

Parameters
loggertool dealing with log messages
rngrandom number generator and decision tool.
removeUsedRCAsuse true to remove the ring closing attractors and replace them with a ring-closing bond according to the bond type defined by the ring.
rebuilduse true to ignore any previously stored chemical representation of this vertex and re-build from scratch.
Returns
the molecular representation of the content of this template.

Reimplemented from denoptim.graph.Vertex.

Definition at line 741 of file Template.java.

References denoptim.constants.DENOPTIMConstants.APSTAG, denoptim.molecularmodeling.ThreeDimTreeBuilder.convertGraphTo3DAtomContainer(), denoptim.constants.DENOPTIMConstants.GCODETAG, denoptim.graph.AttachmentPoint.getAPDefinitionsForSDF(), denoptim.graph.AttachmentPoint.getAtomPositionNumberInMol(), denoptim.graph.Template.getAttachmentPoints(), denoptim.graph.AttachmentPoint.getDirectionVector(), denoptim.graph.Template.getInnerAPFromOuterAP(), denoptim.constants.DENOPTIMConstants.GRAPHJSONTAG, denoptim.constants.DENOPTIMConstants.GRAPHTAG, denoptim.graph.Template.innerGraph, denoptim.graph.Template.mol, denoptim.constants.DENOPTIMConstants.PROVENANCE, and denoptim.constants.DENOPTIMConstants.VERTEXJSONTAG.

Here is the call graph for this function:

◆ getInnerAPFromOuterAP()

AttachmentPoint denoptim.graph.Template.getInnerAPFromOuterAP ( AttachmentPoint  outerAP)

Definition at line 808 of file Template.java.

References denoptim.graph.Template.innerToOuterAPs.

Referenced by denoptim.graph.Template.getIAtomContainer(), denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.gui.GraphViewerPanel.renumberAPs(), and denoptim.graph.Template.setIAtomContainer().

Here is the caller graph for this function:

◆ getInnerGraph()

◆ getMutationSites()

List< Vertex > denoptim.graph.Template.getMutationSites ( List< MutationType ignoredTypes)

A list of mutation sites from within this vertex.

This method sets the mutation sites of the embedded vertices according to the Template#contractLevel of this template.

Parameters
ignoredTypesa collection of mutation types to ignore. vertices that allow only ignored types of mutation will not be considered mutation sites.
Returns
the list of vertices that allow any non-ignored mutation type.

Reimplemented from denoptim.graph.Vertex.

Definition at line 872 of file Template.java.

References denoptim.graph.Vertex.BBType.CAP, denoptim.graph.Template.contractLevel, denoptim.graph.Vertex.getBuildingBlockType(), denoptim.graph.Vertex.getMutationSites(), denoptim.graph.Vertex.getMutationTypes(), denoptim.graph.DGraph.gVertices, denoptim.graph.Template.innerGraph, and denoptim.graph.Template.updateMutTypeToFixedSTructure().

Referenced by denoptim.ga.EAUtilsTest.testBuildGraphFromTemplateScaffold().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMutationTypes()

List< MutationType > denoptim.graph.Template.getMutationTypes ( List< MutationType excludedTypes)

Returns the list of mutation types.

Parameters
excludedTypeslist of mutation types to purge from before returning the list.
Returns
the purged list of mutation types.

Reimplemented from denoptim.graph.Vertex.

Definition at line 837 of file Template.java.

References denoptim.utils.MutationType.ADDLINK, denoptim.utils.MutationType.CHANGELINK, denoptim.utils.MutationType.EXTEND, denoptim.graph.Vertex.getBuildingBlockType(), denoptim.graph.Vertex.getChilddren(), denoptim.graph.Vertex.getNumberOfAPs(), and denoptim.graph.Vertex.BBType.SCAFFOLD.

Here is the call graph for this function:

◆ getOuterAPFromInnerAP()

AttachmentPoint denoptim.graph.Template.getOuterAPFromInnerAP ( AttachmentPoint  innerAP)

Definition at line 828 of file Template.java.

References denoptim.graph.APTreeMap.get(), and denoptim.graph.Template.innerToOuterAPs.

Referenced by denoptim.graph.DGraph.embedPatternsInTemplates(), denoptim.graph.AttachmentPoint.getEdgeUserThroughout(), and denoptim.graph.AttachmentPoint.isAvailableThroughout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPathIDs()

String[] denoptim.graph.Template.getPathIDs ( AttachmentPoint  apA,
AttachmentPoint  apB 
)

Produces a pair of strings that identify the "path" between two given attachment points.

The two strings represent one the reverse path of the other. So they identify the path when starting from each of the two APs.

Parameters
apA
apB
Returns
a pair of strings that identify the "path" between two given attachment points.

Reimplemented from denoptim.graph.Vertex.

Definition at line 154 of file Template.java.

References denoptim.graph.Vertex.getBuildingBlockId(), denoptim.graph.Vertex.getBuildingBlockType(), and denoptim.graph.Vertex.getIndexOfAP().

Here is the call graph for this function:

◆ getRequiredAPs()

List< AttachmentPoint > denoptim.graph.Template.getRequiredAPs ( )
private

Definition at line 996 of file Template.java.

References denoptim.graph.Template.requiredAPs.

Referenced by denoptim.graph.Template.isValidInnerGraph().

Here is the caller graph for this function:

◆ getSymmetricAPSets()

List< SymmetricAPs > denoptim.graph.Template.getSymmetricAPSets ( )

The SymmetricSet produced from this method contain indexes of the AttachmentPoints in the list returned by getAttachmentPoints().

Reimplemented from denoptim.graph.Vertex.

Definition at line 495 of file Template.java.

References denoptim.graph.SymmetricSet< T >.add(), denoptim.graph.APTreeMap.get(), denoptim.graph.Vertex.getSymmetricAPs(), denoptim.graph.DGraph.getSymVerticesForVertex(), denoptim.graph.Template.innerGraph, and denoptim.graph.Template.innerToOuterAPs.

Referenced by denoptim.json.DENOPTIMgsonTest.testTemplateSerialization().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTestTemplate()

static Template denoptim.graph.Template.getTestTemplate ( ContractLevel  contractLevel) throws DENOPTIMException
static

Method meant for devel phase only.

Exceptions
DENOPTIMException

Definition at line 172 of file Template.java.

References denoptim.graph.EmptyVertex.addAP(), denoptim.graph.DGraph.addEdge(), denoptim.graph.DGraph.addVertex(), denoptim.graph.Template.contractLevel, denoptim.graph.Vertex.getAP(), denoptim.graph.Edge.BondType.SINGLE, denoptim.graph.Template.Template(), and denoptim.graph.Vertex.BBType.UNDEFINED.

Referenced by denoptim.graph.DGraphTest.testGetMutationSites().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isValidInnerGraph()

boolean denoptim.graph.Template.isValidInnerGraph ( DGraph  g)
private

Definition at line 422 of file Template.java.

References denoptim.graph.AttachmentPoint.getAPClass(), denoptim.graph.DGraph.getAvailableAPs(), denoptim.graph.Template.getRequiredAPs(), and denoptim.graph.Template.requiredAPs.

Referenced by denoptim.graph.Template.setInnerGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeProjectionOfInnerAP()

void denoptim.graph.Template.removeProjectionOfInnerAP ( AttachmentPoint  oldInnerAP) throws DENOPTIMException

Removes the mapping of the given inner AP from this template's surface, if such mapping exists.

If the old innerAP maps to an outer AP that is used, then the edge user and any vertex reachable from it are removed.

Parameters
oldInnerAPthe inner AP of the mapping to remove.

Definition at line 399 of file Template.java.

References denoptim.graph.APTreeMap.get(), denoptim.graph.Vertex.getGraphOwner(), denoptim.graph.AttachmentPoint.getLinkedAP(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Template.innerToOuterAPs, denoptim.graph.AttachmentPoint.isAvailable(), denoptim.graph.APTreeMap.remove(), denoptim.graph.DGraph.removeBranchStartingAt(), denoptim.graph.Template.removeProjectionOfInnerAP(), and denoptim.graph.DGraph.templateJacket.

Referenced by denoptim.graph.DGraph.removeChainUpToBranching(), denoptim.graph.Template.removeProjectionOfInnerAP(), denoptim.graph.DGraph.removeSingleVertexAndWeld(), and denoptim.graph.DGraph.replaceSingleSubGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sameAs()

boolean denoptim.graph.Template.sameAs ( Template  other,
StringBuilder  reason 
)

Compares this and another template ignoring vertex IDs.

Parameters
other
reasonstring builder used to build the message clarifying the reason for returning false.
Returns
true if the two templates have the same content even if the vertex IDs are different.

Definition at line 956 of file Template.java.

References denoptim.graph.Template.contractLevel, denoptim.graph.Vertex.getBuildingBlockId(), denoptim.graph.Template.getInnerGraph(), denoptim.graph.Template.requiredAPs, denoptim.graph.Template.sameAs(), and denoptim.graph.Vertex.sameVertexFeatures().

Referenced by denoptim.graph.Template.sameAs(), denoptim.fragspace.FragmentSpaceTest.testFusedRingAddedToFragmentLibrary(), denoptim.fragspace.FragmentSpaceTest.testFusedRingAddedToScaffoldLibrary(), denoptim.io.DenoptimIOTest.testIOTemplate(), and denoptim.graph.TemplateTest.testNestedTemplateCloning().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setContractLevel()

void denoptim.graph.Template.setContractLevel ( ContractLevel  contract)

Imposes the given contract to this template.

Parameters
contractthe contract to impose on this template.

Definition at line 214 of file Template.java.

References denoptim.graph.Template.ContractLevel.FIXED_STRUCT, and denoptim.graph.Template.updateMutTypeToFixedSTructure().

Referenced by denoptim.graph.DGraph.embedPatternsInTemplates(), denoptim.ga.GraphOperationsTest.getPairOfTestGraphs(), denoptim.ga.PopulationTest.getPairOfTestGraphsB(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxo(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxoxo(), denoptim.gui.GUIGraphHandler.initialize(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FixedStructure(), and denoptim.ga.GraphOperationsTest.testLocateCompatibleXOverPoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setIAtomContainer()

void denoptim.graph.Template.setIAtomContainer ( IAtomContainer  mol,
boolean  updateAPsAccordingToIAC 
) throws DENOPTIMException

Attaches a molecular representation to this template.

Note that changes to this Template have the power to trigger the request to update the molecular representation that we set here, thus removing the representation we define in this method.

Parameters
molthe atom container to be used as molecular representation of this template.
updateAPsAccordingToIACflag that prevents actions when the IAC does not have the details needed to update the APs on the template. For instance, when cloning a template or reading in a template with IAC from file. In these cases we only want to add a molecular representation and we set this flag to false.
Exceptions
DENOPTIMException

Definition at line 621 of file Template.java.

References denoptim.constants.DENOPTIMConstants.APSTAG, denoptim.constants.DENOPTIMConstants.ATMPROPAPS, denoptim.constants.DENOPTIMConstants.ATMPROPORIGINALATMID, denoptim.constants.DENOPTIMConstants.ATMPROPVERTEXID, denoptim.constants.DENOPTIMConstants.GCODETAG, denoptim.graph.AttachmentPoint.getAPDefinitionsForSDF(), denoptim.graph.AttachmentPoint.getAtomPositionNumber(), denoptim.graph.Template.getAttachmentPoints(), denoptim.graph.AttachmentPoint.getDirectionVector(), denoptim.graph.Template.getInnerAPFromOuterAP(), denoptim.graph.Vertex.getVertexId(), denoptim.constants.DENOPTIMConstants.GRAPHJSONTAG, denoptim.constants.DENOPTIMConstants.GRAPHTAG, denoptim.constants.DENOPTIMConstants.LINKAPS, denoptim.graph.Template.mol, denoptim.constants.DENOPTIMConstants.PROVENANCE, denoptim.graph.AttachmentPoint.setDirectionVector(), and denoptim.constants.DENOPTIMConstants.VERTEXJSONTAG.

Referenced by denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setInnerGraph()

void denoptim.graph.Template.setInnerGraph ( DGraph  innerGraph) throws IllegalArgumentException

Definition at line 298 of file Template.java.

References denoptim.graph.Template.addInnerToOuterAPMapping(), denoptim.graph.Template.clearIAtomContainer(), denoptim.graph.DGraph.getAvailableAPs(), denoptim.graph.Template.innerGraph, denoptim.graph.Template.isValidInnerGraph(), and denoptim.graph.DGraph.setTemplateJacket().

Referenced by denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary(), denoptim.graph.Template.clone(), denoptim.graph.DGraph.embedPatternsInTemplates(), denoptim.graph.Template.fromJson(), denoptim.fragspace.FragmentSpaceTest.getExpectedTemplate(), denoptim.graph.TemplateTest.getNestedTemplate(), denoptim.ga.GraphOperationsTest.getPairOfTestGraphs(), denoptim.ga.PopulationTest.getPairOfTestGraphsB(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxo(), denoptim.ga.PopulationTest.getPairOfTestGraphsBxoxo(), denoptim.graph.TemplateTest.getTemplateDeepTest(), denoptim.graph.TemplateTest.getTestAmideTemplate(), denoptim.gui.GUIGraphHandler.initialize(), denoptim.graph.DGraphTest.makeDeeplyEmbeddedGraph(), denoptim.graph.DGraphTest.makeTestGraphI(), denoptim.io.DenoptimIO.readVertexes(), denoptim.graph.TemplateTest.testAddAP_after_setInnerGraph_throwsException(), denoptim.graph.AttachmentPointTest.testAvailableThrougout(), denoptim.graph.TemplateTest.testClone(), denoptim.graph.AttachmentPointTest.testGetEdbeUserThrougout(), denoptim.graph.AttachmentPointTest.testGetEmbeddedAP(), denoptim.graph.AttachmentPointTest.testHasConnectedSrcAtom(), denoptim.graph.AttachmentPointTest.testHasSameSrcAtom(), and denoptim.graph.TemplateTest.testSameAPClass().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSymmetricAPSets()

void denoptim.graph.Template.setSymmetricAPSets ( List< SymmetricAPs sAPs)
protected

This method exists by contract, but does not do anything because the concept of setting the symmetric set of APs in a template is not defined yet.

Reimplemented from denoptim.graph.Vertex.

Definition at line 474 of file Template.java.

◆ toJson()

String denoptim.graph.Template.toJson ( )

Produces a string that represents this vertex and that adheres to the JSON format.

Returns
the JSON format as a single string

Definition at line 1008 of file Template.java.

References denoptim.graph.DGraph.ensureUniqueApIDs(), denoptim.json.DENOPTIMgson.getWriter(), and denoptim.graph.Template.innerGraph.

Referenced by denoptim.graph.VertexTest.testFromToJSON_minimal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateInnerApID()

void denoptim.graph.Template.updateInnerApID ( AttachmentPoint  oldInnerAP,
AttachmentPoint  newInnerAP 
)

Replaces a given link between APs on the surface of this template (i.e., outerAP) and the corresponding APs in the embedded graph (i.e., innerAPs).

This method does change the attributes of the outerAP to reflect the change on innerAP, i.e., the APClass of innerAP is assigned to the outerAP. If there is now mapping for the oldInnerAP, then nothing happens.

Parameters
oldInnerAPthe inner AP to be changed
newInnerAPthe inner AP to change the old one with.

Definition at line 377 of file Template.java.

References denoptim.graph.APTreeMap.get(), denoptim.graph.AttachmentPoint.getAPClass(), denoptim.graph.Template.innerToOuterAPs, denoptim.graph.APTreeMap.put(), denoptim.graph.APTreeMap.remove(), and denoptim.graph.AttachmentPoint.setAPClass().

Referenced by denoptim.graph.DGraph.removeSingleVertexAndWeld(), and denoptim.graph.DGraph.replaceSingleSubGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateInnerToOuter()

void denoptim.graph.Template.updateInnerToOuter ( TreeMap< Integer, AttachmentPoint map)
private

Definition at line 325 of file Template.java.

References denoptim.graph.Template.clearIAtomContainer(), denoptim.graph.DGraph.getAPWithId(), denoptim.graph.Template.innerGraph, denoptim.graph.APTreeMap.put(), and denoptim.graph.AttachmentPoint.setOwner().

Referenced by denoptim.graph.Template.fromJson().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateMutTypeToFixedSTructure()

void denoptim.graph.Template.updateMutTypeToFixedSTructure ( )
private

Definition at line 908 of file Template.java.

References denoptim.utils.MutationType.ADDLINK, denoptim.utils.MutationType.CHANGEBRANCH, denoptim.utils.MutationType.DELETE, denoptim.utils.MutationType.DELETECHAIN, denoptim.utils.MutationType.DELETELINK, denoptim.utils.MutationType.EXTEND, denoptim.graph.Template.ContractLevel.FIXED_STRUCT, denoptim.graph.DGraph.gVertices, denoptim.graph.Template.innerGraph, denoptim.graph.Vertex.removeMutationType(), and denoptim.graph.Template.Template().

Referenced by denoptim.graph.Template.getMutationSites(), and denoptim.graph.Template.setContractLevel().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ contractLevel

◆ innerGraph

◆ innerToOuterAPs

◆ mol

IAtomContainer denoptim.graph.Template.mol = null
private

Molecular representation of the content of this template.

This filed is meant to speed up handling of template's molecular analog. In particular, rather than recalculating the molecular representation multiple times, we make it once (upon calling getIAtomContainer()) and we store the result until further changes in the content of the template.

Definition at line 94 of file Template.java.

Referenced by denoptim.graph.Template.clone(), denoptim.graph.Template.containsAtoms(), denoptim.graph.Template.getIAtomContainer(), and denoptim.graph.Template.setIAtomContainer().

◆ requiredAPs

List<AttachmentPoint> denoptim.graph.Template.requiredAPs = new ArrayList<>()
private

The documentation for this class was generated from the following file: