$darkmode
DENOPTIM
denoptim.fragspace.FragmentSpace Class Reference

Class defining a space of building blocks. More...

Collaboration diagram for denoptim.fragspace.FragmentSpace:
[legend]

Public Member Functions

 FragmentSpace ()
 Creates an empty fragment space, which is marked as invalid. More...
 
 FragmentSpace (FragmentSpaceParameters settings, String scaffFile, String fragFile, String capFile, String cpmFile) throws DENOPTIMException
 Define all components of a fragment space that implements the attachment point class-approach. More...
 
 FragmentSpace (FragmentSpaceParameters settings, ArrayList< Vertex > scaffLib, ArrayList< Vertex > fragLib, ArrayList< Vertex > cappLib, HashMap< APClass, ArrayList< APClass > > cpMap, HashMap< APClass, APClass > capMap, HashSet< APClass > forbEnds, HashMap< APClass, ArrayList< APClass > > rcCpMap) throws DENOPTIMException
 Define all components of a fragment space that implements the attachment point class-approach. More...
 
 FragmentSpace (FragmentSpaceParameters settings, ArrayList< Vertex > scaffLib, ArrayList< Vertex > fragLib, ArrayList< Vertex > cappLib, HashMap< APClass, ArrayList< APClass > > cpMap, HashMap< APClass, APClass > capMap, HashSet< APClass > forbEnds, HashMap< APClass, ArrayList< APClass > > rcCpMap, HashMap< APClass, Double > symCntrMap) throws DENOPTIMException
 Define all components of a fragment space that implements the attachment point class-approach. More...
 
 FragmentSpace (FragmentSpaceParameters settings, String scaffFile, String fragFile, String capFile, String cpmFile, String rcpmFile, HashMap< APClass, Double > symCntrMap) throws DENOPTIMException
 Define all components of a fragment space that implements the attachment point class-approach. More...
 
boolean isDefined ()
 Checks for valid definition of this fragment space. More...
 
Randomizer getRandomizer ()
 Returns the program-specific randomizer that is associated with this program-specific fragment space. More...
 
void setAPclassBasedApproach (boolean useAPC)
 Set the fragment space to behave according to APClass-based approach. More...
 
boolean useAPclassBasedApproach ()
 Check usage of APClass-based approach, i.e., uses attachment points with annotated data (i.e., the APClass) to evaluate compatibilities between attachment points. More...
 
APClass getAPClassForFragment (IdFragmentAndAP apId)
 Search for a specific AP on a specific fragment and finds out its class. More...
 
Vertex getVertexFromLibrary (Vertex.BBType bbType, int bbIdx) throws DENOPTIMException
 Returns a clone of the requested building block. More...
 
int getCappingFragment (APClass rcnCap)
 Select a compatible capping group for the given APClass. More...
 
ArrayList< Integer > getCompatibleCappingFragments (APClass cmpReac)
 Retrieve a list of compatible capping groups. More...
 
Vertex makeRandomScaffold ()
 Randomly select a scaffold and return a fully configured clone of it. More...
 
ArrayList< VertexgetScaffoldLibrary ()
 
ArrayList< VertexgetFragmentLibrary ()
 
ArrayList< VertexgetCappingLibrary ()
 
ArrayList< Integer > getCappingGroupsWithAPClass (APClass capApCls)
 
Vertex getCappingVertexWithAPClass (APClass capApCls)
 
void importCompatibilityMatrixFromFile (String inFile) throws DENOPTIMException
 Load info from a compatibility matrix file. More...
 
void importRCCompatibilityMatrixFromFile (String inFile) throws DENOPTIMException
 Load info for ring closures compatibilities from a compatibility matrix file. More...
 
HashMap< APClass, ArrayList< APClass > > getCompatibilityMatrix ()
 
ArrayList< APClassgetCompatibleAPClasses (APClass apc)
 Returns a list of APClasses compatible with the given APClass. More...
 
HashMap< APClass, ArrayList< APClass > > getRCCompatibilityMatrix ()
 Returns the compatibility matrix for ring closing fragment-fragment connections or null if not provided in the parameters file. More...
 
HashMap< APClass, APClassgetCappingMap ()
 
APClass getAPClassOfCappingVertex (APClass srcApClass)
 
Set< APClassgetForbiddenEndList ()
 
Set< APClassgetAllAPClassesFromCPMap ()
 Return the set of APClasses that used in the compatibility matrix for the growing graph APs. More...
 
HashMap< Integer, ArrayList< Integer > > getMapOfFragsPerNumAps ()
 
ArrayList< Integer > getFragsWithNumAps (int nAps)
 Returns the list of fragments with given number of APs. More...
 
ArrayList< APClassgetAPClassesPerFragment (int fragId)
 Returns the APclasses associated with a given fragment. More...
 
ArrayList< IdFragmentAndAPgetFragsWithAPClass (APClass apc)
 Returns the list of attachment points with the given class. More...
 
ArrayList< VertexgetVerticesWithAPClass (APClass apc)
 Returns the list of vertexes with attachment points of the given class. More...
 
List< VertexgetVerticesWithAPClasses (Set< APClass > apcs)
 Returns the list of vertexes with at least one attachment point of each of the given classes. More...
 
List< VertexgetVerticesWithAPFingerprint (Map< APClass, Integer > apcCounts)
 Returns the list of vertexes that have the specified number of AttachmentPoints with the given APClasses. More...
 
List< VertexgetVerticesWithAPClassStartingWith (String root)
 Extracts vertexes from the collection of vertexes defined by this FragmentSpace. More...
 
ArrayList< VertexgetFragmentsCompatibleWithTheseAPs (ArrayList< IdFragmentAndAP > srcAPs)
 Searches for all building blocks that are compatible with the given list of APs. More...
 
List< VertexgetRCVsWithAPClass (APClass apc)
 Searches for all building blocks that are ring-closing vertexes and hold an AP with the given class. More...
 
List< VertexgetRCVsForAPClass (APClass apc)
 Searches for all building blocks that are ring-closing vertexes and are compatible with the given AP. More...
 
ArrayList< AttachmentPointgetAPsCompatibleWithThese (ArrayList< AttachmentPoint > srcAPs)
 Searches for all attachment points that are compatible with the given list of attachment points. More...
 
ArrayList< IdFragmentAndAPgetFragAPsCompatibleWithTheseAPs (ArrayList< IdFragmentAndAP > srcAPs)
 Searches for all APs that are compatible with the given list of APs. More...
 
ArrayList< AttachmentPointgetAPsCompatibleWithClass (APClass aPC1)
 Returns the list of attachment points found in the fragment space and that are compatible with a given AP class. More...
 
ArrayList< IdFragmentAndAPgetFragAPsCompatibleWithClass (APClass aPC1)
 Returns the list of attachment points found in the fragment space and that are compatible with a given AP class. More...
 
boolean imposeSymmetryOnAPsOfClass (APClass apClass)
 Checks if the symmetry settings impose use of symmetry on attachment points of the given AP class. More...
 
boolean hasSymmetryConstrain (APClass apClass)
 Checks if there is a constraint on the constitutional symmetry probability for the given AP class. More...
 
double getSymmetryConstrain (APClass apClass)
 Return the constitutional symmetry constrain for the given APclass, or null. More...
 
void setScaffoldLibrary (ArrayList< Vertex > lib)
 
void setFragmentLibrary (ArrayList< Vertex > lib)
 
void setCappingLibrary (ArrayList< Vertex > lib)
 
void setCompatibilityMatrix (HashMap< APClass, ArrayList< APClass > > map)
 
void setRCCompatibilityMatrix (HashMap< APClass, ArrayList< APClass > > map)
 
void setCappingMap (HashMap< APClass, APClass > map)
 
void setForbiddenEndList (Set< APClass > lst)
 
void setSymmConstraints (HashMap< APClass, Double > map)
 
void clearAll ()
 Clears all settings of this fragment space. More...
 
void appendVerticesToLibrary (ArrayList< Vertex > list, Vertex.BBType bbt, ArrayList< Vertex > library)
 Takes a list of vertices and add them to a given library. More...
 
void appendVertexToLibrary (Vertex v, Vertex.BBType bbt, ArrayList< Vertex > library)
 Takes a vertex and add it to a given library. More...
 
void addFusedRingsToFragmentLibrary (DGraph graph)
 Extracts a system of one or more fused rings and adds them to the fragment space if not already present. More...
 
void addFusedRingsToFragmentLibrary (DGraph graph, boolean addIfScaffold, boolean addIfFragment)
 Extracts a system of one or more fused rings and adds them to the fragment space if not already present. More...
 
void addFusedRingsToFragmentLibrary (DGraph graph, boolean addIfScaffold, boolean addIfFragment, IAtomContainer wholeMol)
 Extracts a system of one or more fused rings and adds them to the fragment space if not already present. More...
 
boolean hasIsomorph (DGraph graph, BBType type)
 Checks if a graph is isomorphic to another template's inner graph in its appropriate fragment space library (inferred from BBType). More...
 
void registerRCV (Vertex v)
 Adds the reference to a ring-closing vertex (RCV) to the quick-access list of RCVs known in this building block space. More...
 
ArrayList< VertexgetRCVs ()
 Returns the list of registered ring-closing vertexes (RCVs). More...
 
List< APMappingmapAPClassCompatibilities (List< AttachmentPoint > listA, List< AttachmentPoint > listB, int maxCombinations)
 Given two lists of APs this method maps the APClass-compatibilities from between the two lists considering the APs in the first list the for the role of source AP in the hypothetical edge. More...
 
void classifyFragment (Vertex frg, int fragId)
 Classify a fragment in terms of the number of APs and possibly their type (AP-Class). More...
 
void groupAndClassifyFragments (boolean apClassBasedApproch) throws DENOPTIMException
 Performs grouping and classification operations on the library of building blocks of BBType#FRAGMENT. More...
 

Static Public Member Functions

static Vertex getPolarizedRCV (boolean polarity)
 Returns a newly-built vertex that can play the role of a ring-closing vertex even when working with 3D building blocks. More...
 

Private Member Functions

void define (FragmentSpaceParameters settings, ArrayList< Vertex > scaffLib, ArrayList< Vertex > fragLib, ArrayList< Vertex > cappLib, HashMap< APClass, ArrayList< APClass > > cpMap, HashMap< APClass, APClass > capMap, HashSet< APClass > forbEnds, HashMap< APClass, ArrayList< APClass > > rcCpMap, HashMap< APClass, Double > symCntrMap) throws DENOPTIMException
 Define all components of this fragment space. More...
 

Private Attributes

ArrayList< VertexscaffoldLib = null
 Data structure containing the molecular representation of building blocks: scaffolds section - fragments that can be used as seeds to grow a new molecule. More...
 
ArrayList< VertexfragmentLib = null
 Data structure containing the molecular representation of building blocks: fragment section - fragments for general use. More...
 
ArrayList< VertexcappingLib = null
 Data structure containing the molecular representation of building blocks: capping group section - fragments with only one attachment point used to saturate unused attachment points on a graph. More...
 
HashMap< APClass, ArrayList< APClass > > apClassCompatibilityMatrix
 Data structure that stored the true entries of the attachment point classes compatibility matrix. More...
 
ArrayList< Vertexrcvs = new ArrayList<Vertex>()
 Store references to the Ring-Closing Vertexes found in the library of fragments. More...
 
HashMap< APClass, ArrayList< APClass > > rcCompatMap
 Data structure that stores compatible APclasses for joining APs in ring-closing bonds. More...
 
HashMap< APClass, APClasscappingMap
 Data structure that stores the AP-classes to be used to cap unused APS on the growing molecule. More...
 
Set< APClassforbiddenEndList
 Data structure that stores AP classes that cannot be held unused. More...
 
HashMap< Integer, ArrayList< Integer > > fragPoolPerNumAP
 Clusters of fragments based on the number of APs. More...
 
HashMap< Integer, ArrayList< APClass > > apClassesPerFrag
 List of APClasses per each fragment. More...
 
HashMap< APClass, ArrayList< ArrayList< Integer > > > fragsApsPerApClass
 Clusters of fragments'AP based on AP classes. More...
 
final Object LOCK = new Object()
 Lock for synchronizing tasks. More...
 
HashMap< APClass, Double > symmConstraints
 APclass-specific constraints to constitutional symmetry. More...
 
boolean apClassBasedApproch = false
 Flag defining use of AP class-based approach. More...
 
boolean isValid = false
 Flag signaling that this fragment space was built and validated. More...
 
FragmentSpaceParameters settings = null
 Settings used to configure this fragment space. More...
 

Detailed Description

Class defining a space of building blocks.

The space comprises of the lists of building blocks and the rules governing the connection of building blocks to forms a DGraph.

Author
Vishwesh Venkatraman
Marco Foscato

Definition at line 67 of file FragmentSpace.java.

Constructor & Destructor Documentation

◆ FragmentSpace() [1/5]

denoptim.fragspace.FragmentSpace.FragmentSpace ( )

Creates an empty fragment space, which is marked as invalid.

Such fragment space has very limited functionality, but can be used to manipulate information related to fragment spaces, such as, handling compatibility rules even without having any defined vertex in it.

Definition at line 180 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.cappingLib, denoptim.fragspace.FragmentSpace.fragmentLib, denoptim.fragspace.FragmentSpace.scaffoldLib, and denoptim.fragspace.FragmentSpace.settings.

◆ FragmentSpace() [2/5]

denoptim.fragspace.FragmentSpace.FragmentSpace ( FragmentSpaceParameters  settings,
String  scaffFile,
String  fragFile,
String  capFile,
String  cpmFile 
) throws DENOPTIMException

Define all components of a fragment space that implements the attachment point class-approach.

Parameters
scaffFilepathname to library of fragments used to start the construction of any new graph (i.e., seed or root fragments, a.k.a. scaffolds).
fragFilepathname to the library of fragments for general purpose.
capFilepathname to the library of single-AP fragments used to cap free attachment points (i.e., the capping groups).
cpmFilepathname to the compatibility matrix, bond type mapping, capping, and forbidden ends rules.
Exceptions
DENOPTIMException

Definition at line 205 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.settings.

◆ FragmentSpace() [3/5]

denoptim.fragspace.FragmentSpace.FragmentSpace ( FragmentSpaceParameters  settings,
ArrayList< Vertex scaffLib,
ArrayList< Vertex fragLib,
ArrayList< Vertex cappLib,
HashMap< APClass, ArrayList< APClass > >  cpMap,
HashMap< APClass, APClass capMap,
HashSet< APClass forbEnds,
HashMap< APClass, ArrayList< APClass > >  rcCpMap 
) throws DENOPTIMException

Define all components of a fragment space that implements the attachment point class-approach.

Parameters
scaffLiblibrary of fragments used to start the construction of any new graph (i.e., seed or root fragments, a.k.a. scaffolds).
fragLiblibrary of fragments for general purpose.
cappLiblibrary of single-AP fragments used to cap free attachment points (i.e., the capping groups).
cpMapthe APClass compatibility map. This data structure is a map of the APClass-on-growing-graph (key) to list of permitted APClasses on incoming fragment (values).
capMapthe capping rules. This data structure is a map of APClass-to-cap (keys) to APClass-of-capping-group (values).
forbEndsthe list of forbidden ends, i.e., APClasses that cannot be left unused neither capped.
rcCpMapthe APClass compatibility matrix for ring closures.
Exceptions
DENOPTIMException

Definition at line 236 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.define(), and denoptim.fragspace.FragmentSpace.settings.

Here is the call graph for this function:

◆ FragmentSpace() [4/5]

denoptim.fragspace.FragmentSpace.FragmentSpace ( FragmentSpaceParameters  settings,
ArrayList< Vertex scaffLib,
ArrayList< Vertex fragLib,
ArrayList< Vertex cappLib,
HashMap< APClass, ArrayList< APClass > >  cpMap,
HashMap< APClass, APClass capMap,
HashSet< APClass forbEnds,
HashMap< APClass, ArrayList< APClass > >  rcCpMap,
HashMap< APClass, Double >  symCntrMap 
) throws DENOPTIMException

Define all components of a fragment space that implements the attachment point class-approach.

Parameters
scaffLiblibrary of fragments used to start the construction of any new graph (i.e., seed or root fragments, a.k.a. scaffolds).
fragLiblibrary of fragments for general purpose.
cappLiblibrary of single-AP fragments used to cap free attachment points (i.e., the capping groups).
cpMapthe APClass compatibility map. This data structure is a map of the APClass-on-growing-graph (key) to list of permitted APClasses on incoming fragment (values).
capMapthe capping rules. This data structure is a map of APClass-to-cap (keys) to APClass-of-capping-group (values).
forbEndsthe list of forbidden ends, i.e., APClasses that cannot be left unused neither capped.
rcCpMapthe APClass compatibility matrix for ring closures.
symCntrMapmap of symmetry probability constraints.
Exceptions
DENOPTIMException

Definition at line 274 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.define(), and denoptim.fragspace.FragmentSpace.settings.

Here is the call graph for this function:

◆ FragmentSpace() [5/5]

denoptim.fragspace.FragmentSpace.FragmentSpace ( FragmentSpaceParameters  settings,
String  scaffFile,
String  fragFile,
String  capFile,
String  cpmFile,
String  rcpmFile,
HashMap< APClass, Double >  symCntrMap 
) throws DENOPTIMException

Define all components of a fragment space that implements the attachment point class-approach.

Parameters
scaffFilepathname to library of fragments used to start the construction of any new graph (i.e., seed or root fragments, a.k.a. scaffolds). Can be null or empty in which case no scaffold is imported.
fragFilepathname to the library of fragments for general purpose. Can be null or empty in which case no fragment is imported.
capFilepathname to the library of single-AP fragments used to cap free attachment points (i.e., the capping groups).
cpmFilepathname to the compatibility matrix, capping, and forbidden ends rules.
rcpmFilethe APClass compatibility matrix for ring closures.
symCntrMapmap of symmetry probability constraints.
Exceptions
DENOPTIMException

Definition at line 310 of file FragmentSpace.java.

References denoptim.graph.Vertex.BBType.CAP, denoptim.fragspace.FragmentSpace.define(), denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.io.DenoptimIO.readCompatibilityMatrix(), denoptim.io.DenoptimIO.readRCCompatibilityMatrix(), denoptim.io.DenoptimIO.readVertexes(), denoptim.graph.Vertex.BBType.SCAFFOLD, and denoptim.fragspace.FragmentSpace.settings.

Here is the call graph for this function:

Member Function Documentation

◆ addFusedRingsToFragmentLibrary() [1/3]

void denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary ( DGraph  graph)

Extracts a system of one or more fused rings and adds them to the fragment space if not already present.

This method does not create any molecular geometry in the building block that is stores in the library. See FragmentSpace#addFusedRingsToFragmentLibrary(DGraph, boolean, boolean, IAtomContainer) to include a molecular representation on the stored building block. WARNING Expanding the libraries of building blocks on-the-fly has the potential to overload the memory.

Definition at line 1629 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary().

Referenced by denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary(), denoptim.ga.OffspringEvaluationTask.call(), denoptim.programs.fitnessevaluator.FitnessEvaluationTask.call(), denoptim.fragspace.FragmentSpaceTest.testFusedRingAddedToFragmentLibrary(), denoptim.fragspace.FragmentSpaceTest.testFusedRingAddedToScaffoldLibrary(), denoptim.fragspace.FragmentSpaceTest.testFusedRingOnlyAddedOnce(), and denoptim.fragspace.FragmentSpaceTest.testUseWholeMolGeometryForExtractedTemplates().

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

◆ addFusedRingsToFragmentLibrary() [2/3]

void denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary ( DGraph  graph,
boolean  addIfScaffold,
boolean  addIfFragment 
)

Extracts a system of one or more fused rings and adds them to the fragment space if not already present.

WARNING Expanding the libraries of building blocks on-the-fly has the potential to overload the memory.

Parameters
graphthe graph to analyze and possibly chop.
addIfScaffolduse true to enable saving of new ring systems that contain any scaffold vertexes as new scaffolds.
addIfFragmentuse true to enable saving of new ring systems that do NOT contain any scaffold vertexes as new fragments.

Definition at line 1648 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary().

Here is the call graph for this function:

◆ addFusedRingsToFragmentLibrary() [3/3]

void denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary ( DGraph  graph,
boolean  addIfScaffold,
boolean  addIfFragment,
IAtomContainer  wholeMol 
)

Extracts a system of one or more fused rings and adds them to the fragment space if not already present.

WARNING Expanding the libraries of building blocks on-the-fly has the potential to overload the memory.

Parameters
graphthe graph to analyze and possibly chop.
addIfScaffolduse true to enable saving of new ring systems that contain any scaffold vertexes as new scaffolds.
addIfFragmentuse true to enable saving of new ring systems that do NOT contain any scaffold vertexes as new fragments.
wholeMolthe complete molecular representation of graph. If this parameter is not null, then we'll try to use the geometry found in this parameter to define the geometry of the fused-rings templates. The atoms in this container are expected to have property DENOPTIMConstants#ATMPROPVERTEXID that defines the ID of the vertex from which each atom comes from.

Definition at line 1681 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.appendVertexToLibrary(), denoptim.fragspace.FragmentSpace.classifyFragment(), denoptim.utils.MoleculeUtils.extractIACForSubgraph(), denoptim.graph.DGraph.extractPattern(), denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.fragspace.FragmentSpace.fragmentLib, denoptim.graph.DGraph.getCandidateOwner(), denoptim.graph.DGraph.getGraphId(), denoptim.graph.Template.getInnerGraph(), denoptim.programs.RunTimeParameters.getLogger(), denoptim.graph.Candidate.getName(), denoptim.fragspace.FragmentSpaceParameters.getPathnameToAppendedFragments(), denoptim.fragspace.FragmentSpaceParameters.getPathnameToAppendedScaffolds(), denoptim.programs.RunTimeParameters.getRandomizer(), denoptim.fragspace.FragmentSpace.hasIsomorph(), denoptim.fragspace.FragmentSpace.LOCK, denoptim.graph.GraphPattern.RING, denoptim.graph.Vertex.BBType.SCAFFOLD, denoptim.fragspace.FragmentSpace.scaffoldLib, denoptim.graph.Template.setIAtomContainer(), denoptim.graph.Template.setInnerGraph(), denoptim.fragspace.FragmentSpace.settings, denoptim.io.DenoptimIO.writeGraphsToJSON(), denoptim.io.DenoptimIO.writeGraphToSDF(), and denoptim.io.DenoptimIO.writeSDFFile().

Here is the call graph for this function:

◆ appendVertexToLibrary()

void denoptim.fragspace.FragmentSpace.appendVertexToLibrary ( Vertex  v,
Vertex.BBType  bbt,
ArrayList< Vertex library 
)

Takes a vertex and add it to a given library.

Each vertex is assigned the building block type and ID.

Parameters
vvertex to import.
bbtthe type of building block the vertex should be set to.
librarywhere to import the vertex to.

Definition at line 1597 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.classifyFragment(), denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.graph.Vertex.setBuildingBlockId(), and denoptim.graph.Vertex.setBuildingBlockType().

Referenced by denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary(), denoptim.fragspace.FragmentSpace.appendVerticesToLibrary(), denoptim.fragspace.GraphLinkFinderTest.prepare(), denoptim.ga.EAUtilsTest.prepare(), denoptim.graph.DGraphTest.prepare(), denoptim.fragspace.FragmentSpaceTest.testGetVerticesWithAPFingerprint(), and denoptim.fragspace.FragmentSpaceTest.testUseWholeMolGeometryForExtractedTemplates().

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

◆ appendVerticesToLibrary()

void denoptim.fragspace.FragmentSpace.appendVerticesToLibrary ( ArrayList< Vertex list,
Vertex.BBType  bbt,
ArrayList< Vertex library 
)

Takes a list of vertices and add them to a given library.

Each vertex is assigned the building block type and ID.

Parameters
listof vertices to import.
bbtthe type of building block the vertices should be set to.
librarywhere to import the vertices to.

Definition at line 1577 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.appendVertexToLibrary().

Referenced by denoptim.fragspace.FragmentSpace.setCappingLibrary(), denoptim.fragspace.FragmentSpace.setFragmentLibrary(), and denoptim.fragspace.FragmentSpace.setScaffoldLibrary().

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

◆ classifyFragment()

void denoptim.fragspace.FragmentSpace.classifyFragment ( Vertex  frg,
int  fragId 
)

Classify a fragment in terms of the number of APs and possibly their type (AP-Class).

Parameters
frgthe building block to classify
idthe index of the fragment in the library
Exceptions
DENOPTIMException

Definition at line 1927 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.apClassesPerFrag, denoptim.fragspace.FragmentSpace.fragsApsPerApClass, denoptim.graph.Vertex.getAllAPClasses(), denoptim.graph.AttachmentPoint.getAPClass(), denoptim.graph.Vertex.getAttachmentPoints(), denoptim.fragspace.FragmentSpace.getFragsWithNumAps(), denoptim.graph.Vertex.getFreeAPCount(), denoptim.fragspace.FragmentSpace.getMapOfFragsPerNumAps(), denoptim.graph.AttachmentPoint.isAvailable(), denoptim.graph.Vertex.isRCV, denoptim.fragspace.FragmentSpace.LOCK, denoptim.fragspace.FragmentSpace.registerRCV(), and denoptim.fragspace.FragmentSpace.useAPclassBasedApproach().

Referenced by denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary(), denoptim.fragspace.FragmentSpace.appendVertexToLibrary(), and denoptim.fragspace.FragmentSpace.groupAndClassifyFragments().

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

◆ clearAll()

◆ define()

void denoptim.fragspace.FragmentSpace.define ( FragmentSpaceParameters  settings,
ArrayList< Vertex scaffLib,
ArrayList< Vertex fragLib,
ArrayList< Vertex cappLib,
HashMap< APClass, ArrayList< APClass > >  cpMap,
HashMap< APClass, APClass capMap,
HashSet< APClass forbEnds,
HashMap< APClass, ArrayList< APClass > >  rcCpMap,
HashMap< APClass, Double >  symCntrMap 
) throws DENOPTIMException
private

Define all components of this fragment space.

Parameters
scaffLiblibrary of fragments used to start the construction of any new graph (i.e., seed or root fragments, a.k.a. scaffolds).
fragLiblibrary of fragments for general purpose.
cappLiblibrary of single-AP fragments used to cap free attachment points (i.e., the capping groups).
cpMapthe APClass compatibility map. This data structure is a map of the APClass-on-growing-graph (key) to list of permitted APClasses on incoming fragment (values).
capMapthe capping rules. This data structure is a map of APClass-to-cap (keys) to APClass-of-capping-group (values).
forbEndsthe list of forbidden ends, i.e., APClasses that cannot be left unused neither capped.
rcCpMapthe APClass compatibility matrix for ring closures.
symCntrMapmap of symmetry probability constraints.
Exceptions
DENOPTIMException

Definition at line 415 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.apClassBasedApproch, denoptim.fragspace.FragmentSpace.groupAndClassifyFragments(), denoptim.fragspace.FragmentSpace.isValid, denoptim.fragspace.FragmentSpace.setCappingLibrary(), denoptim.fragspace.FragmentSpace.setCappingMap(), denoptim.fragspace.FragmentSpace.setCompatibilityMatrix(), denoptim.fragspace.FragmentSpace.setForbiddenEndList(), denoptim.fragspace.FragmentSpace.setFragmentLibrary(), denoptim.fragspace.FragmentSpaceParameters.setFragmentSpace(), denoptim.fragspace.FragmentSpace.setRCCompatibilityMatrix(), denoptim.fragspace.FragmentSpace.setScaffoldLibrary(), denoptim.fragspace.FragmentSpace.setSymmConstraints(), and denoptim.fragspace.FragmentSpace.settings.

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

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

◆ getAllAPClassesFromCPMap()

Set< APClass > denoptim.fragspace.FragmentSpace.getAllAPClassesFromCPMap ( )

Return the set of APClasses that used in the compatibility matrix for the growing graph APs.

Note these APClasses do include subclasses. For example, for AP with class MyAPClass:0 the 0 is the subclass.

Returns
the lst of APClasses

Definition at line 915 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.apClassCompatibilityMatrix.

Referenced by denoptim.gui.FSParametersForm.FSParametersForm().

Here is the caller graph for this function:

◆ getAPClassesPerFragment()

ArrayList< APClass > denoptim.fragspace.FragmentSpace.getAPClassesPerFragment ( int  fragId)

Returns the APclasses associated with a given fragment.

Parameters
fragIdthe index of the fragment in the library
Returns
the list of APclasses found of the fragment

Definition at line 955 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.apClassesPerFrag, and denoptim.fragspace.FragmentSpace.LOCK.

◆ getAPClassForFragment()

APClass denoptim.fragspace.FragmentSpace.getAPClassForFragment ( IdFragmentAndAP  apId)

Search for a specific AP on a specific fragment and finds out its class.

Parameters
apIdthe identified of a specific attachment point.
Returns
the AP class or null

Definition at line 502 of file FragmentSpace.java.

References denoptim.fragspace.IdFragmentAndAP.getApId(), denoptim.graph.Vertex.getAttachmentPoints(), denoptim.fragspace.FragmentSpace.getVertexFromLibrary(), denoptim.fragspace.IdFragmentAndAP.getVertexMolId(), and denoptim.fragspace.IdFragmentAndAP.getVertexMolType().

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

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

◆ getAPClassOfCappingVertex()

APClass denoptim.fragspace.FragmentSpace.getAPClassOfCappingVertex ( APClass  srcApClass)
Parameters
srcApClassthe attachment point class of the attachment point to be capped
Returns
the APClass of the capping group or null

Definition at line 892 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.cappingMap.

Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), and denoptim.graph.DGraph.graphNeedsCappingGroups().

Here is the caller graph for this function:

◆ getAPsCompatibleWithClass()

ArrayList< AttachmentPoint > denoptim.fragspace.FragmentSpace.getAPsCompatibleWithClass ( APClass  aPC1)

Returns the list of attachment points found in the fragment space and that are compatible with a given AP class.

Multiple APs can be found for each fragment.

Parameters
aPC1the AP class for which we want compatible APs.

Definition at line 1351 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.getCompatibleAPClasses(), denoptim.programs.RunTimeParameters.getLogger(), denoptim.fragspace.FragmentSpace.getVerticesWithAPClass(), and denoptim.fragspace.FragmentSpace.settings.

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

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

◆ getAPsCompatibleWithThese()

ArrayList< AttachmentPoint > denoptim.fragspace.FragmentSpace.getAPsCompatibleWithThese ( ArrayList< AttachmentPoint srcAPs)

Searches for all attachment points that are compatible with the given list of attachment points.

Parameters
srcAPsattachment points meant to results have to be compatible with.
Returns
a list of compatible attachment points found in the library of fragments.

Definition at line 1247 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.getAPsCompatibleWithClass().

Referenced by denoptim.gui.GUIGraphHandler.collectFragAndAPsCompatibleWithSelectedAPs().

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

◆ getCappingFragment()

int denoptim.fragspace.FragmentSpace.getCappingFragment ( APClass  rcnCap)

Select a compatible capping group for the given APClass.

Parameters
rcnCapthe class of the attachment point to be capped.
Returns
the index of capping group

Definition at line 670 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.getCompatibleCappingFragments(), denoptim.programs.RunTimeParameters.getRandomizer(), denoptim.utils.Randomizer.randomlyChooseOne(), and denoptim.fragspace.FragmentSpace.settings.

Here is the call graph for this function:

◆ getCappingGroupsWithAPClass()

ArrayList< Integer > denoptim.fragspace.FragmentSpace.getCappingGroupsWithAPClass ( APClass  capApCls)
Parameters
capApClsthe APClass of the attachment point on the capping group
Returns
all the capping groups which have the given APClass.

Definition at line 759 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.cappingLib, and denoptim.graph.APClass.equals().

Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator().

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

◆ getCappingLibrary()

ArrayList< Vertex > denoptim.fragspace.FragmentSpace.getCappingLibrary ( )

Definition at line 747 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.cappingLib.

Referenced by denoptim.gui.GUIGraphHandler.extendGraphFromFragSpace(), denoptim.fragspace.FragmentSpace.getCompatibleCappingFragments(), and denoptim.graph.DGraphTest.prepare().

Here is the caller graph for this function:

◆ getCappingMap()

HashMap< APClass, APClass > denoptim.fragspace.FragmentSpace.getCappingMap ( )

Definition at line 879 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.cappingMap.

Referenced by denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.buildCandidateFromScratch(), and denoptim.ga.EAUtils.buildCandidatesByXOver().

Here is the caller graph for this function:

◆ getCappingVertexWithAPClass()

Vertex denoptim.fragspace.FragmentSpace.getCappingVertexWithAPClass ( APClass  capApCls)
Parameters
capApClsthe APClass of the attachment point on the capping group.
Returns
a clone of the first 'capping group' having the given APClass, or null if none was found.

Definition at line 782 of file FragmentSpace.java.

References denoptim.graph.Vertex.BBType.CAP, denoptim.fragspace.FragmentSpace.cappingLib, denoptim.graph.APClass.equals(), and denoptim.fragspace.FragmentSpace.getVertexFromLibrary().

Here is the call graph for this function:

◆ getCompatibilityMatrix()

HashMap< APClass, ArrayList< APClass > > denoptim.fragspace.FragmentSpace.getCompatibilityMatrix ( )

Definition at line 841 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.apClassCompatibilityMatrix.

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

Here is the caller graph for this function:

◆ getCompatibleAPClasses()

ArrayList< APClass > denoptim.fragspace.FragmentSpace.getCompatibleAPClasses ( APClass  apc)

Returns a list of APClasses compatible with the given APClass.

The compatibility among classes is defined by the compatibility matrix

Parameters
apc
Returns
the list of compatible APClasses. Can be empty but not null.

Definition at line 854 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.apClassCompatibilityMatrix.

Referenced by denoptim.fragspace.FragmentSpace.getAPsCompatibleWithClass(), denoptim.fragspace.FragmentSpace.getFragAPsCompatibleWithClass(), denoptim.ga.EAUtils.getUsableAliphaticBridges(), and denoptim.graph.APClass.isCPMapCompatibleWith().

Here is the caller graph for this function:

◆ getCompatibleCappingFragments()

ArrayList< Integer > denoptim.fragspace.FragmentSpace.getCompatibleCappingFragments ( APClass  cmpReac)

Retrieve a list of compatible capping groups.

Parameters
cmpReac
Returns
a list of compatible capping groups

Definition at line 694 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.cappingLib, denoptim.graph.Vertex.getAllAPClasses(), and denoptim.fragspace.FragmentSpace.getCappingLibrary().

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

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

◆ getForbiddenEndList()

Set< APClass > denoptim.fragspace.FragmentSpace.getForbiddenEndList ( )

◆ getFragAPsCompatibleWithClass()

ArrayList< IdFragmentAndAP > denoptim.fragspace.FragmentSpace.getFragAPsCompatibleWithClass ( APClass  aPC1)

Returns the list of attachment points found in the fragment space and that are compatible with a given AP class.

Multiple APs can be found for each fragment.

Parameters
aPC1the AP class for which we want compatible APs.

Definition at line 1398 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.getCompatibleAPClasses(), and denoptim.fragspace.FragmentSpace.getFragsWithAPClass().

Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), denoptim.fragspace.FragmentSpace.getFragAPsCompatibleWithTheseAPs(), and denoptim.fragspace.FragmentSpaceTest.testGetFragAPsCompatibleWithClass().

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

◆ getFragAPsCompatibleWithTheseAPs()

ArrayList< IdFragmentAndAP > denoptim.fragspace.FragmentSpace.getFragAPsCompatibleWithTheseAPs ( ArrayList< IdFragmentAndAP srcAPs)

Searches for all APs that are compatible with the given list of APs.

Parameters
srcAPsthe identifiers of APs meant to hold any of the desired fragments.
Returns
a list of identifiers for APs on fragments in the library.

Definition at line 1298 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.getAPClassForFragment(), and denoptim.fragspace.FragmentSpace.getFragAPsCompatibleWithClass().

Referenced by denoptim.fragspace.FragmentSpace.getFragmentsCompatibleWithTheseAPs(), and denoptim.fragspace.FragmentSpaceTest.testGetFragAPsCompatibleWithTheseAPs().

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

◆ getFragmentLibrary()

◆ getFragmentsCompatibleWithTheseAPs()

ArrayList< Vertex > denoptim.fragspace.FragmentSpace.getFragmentsCompatibleWithTheseAPs ( ArrayList< IdFragmentAndAP srcAPs)

Searches for all building blocks that are compatible with the given list of APs.

Parameters
srcAPsthe identifiers of APs meant to hold any of the desired fragments.
Returns
a list of fragments.

Definition at line 1133 of file FragmentSpace.java.

References denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.fragspace.FragmentSpace.getFragAPsCompatibleWithTheseAPs(), denoptim.programs.RunTimeParameters.getLogger(), denoptim.fragspace.FragmentSpace.getVertexFromLibrary(), and denoptim.fragspace.FragmentSpace.settings.

Referenced by denoptim.fragspace.FragmentSpaceTest.testGetFragmentsCompatibleWithTheseAPs().

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

◆ getFragsWithAPClass()

ArrayList< IdFragmentAndAP > denoptim.fragspace.FragmentSpace.getFragsWithAPClass ( APClass  apc)

Returns the list of attachment points with the given class.

The returned identifiers have vertex_id=-1 because these APs are only on the individual fragments held in the library and do not belong to any graph.

Parameters
apc
Returns
the list of AP identifiers.

Definition at line 975 of file FragmentSpace.java.

References denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.fragspace.FragmentSpace.fragsApsPerApClass, and denoptim.fragspace.FragmentSpace.LOCK.

Referenced by denoptim.fragspace.FragmentSpace.getFragAPsCompatibleWithClass(), and denoptim.fragspace.FragmentSpaceTest.testGetFragsWithAPClass().

Here is the caller graph for this function:

◆ getFragsWithNumAps()

ArrayList< Integer > denoptim.fragspace.FragmentSpace.getFragsWithNumAps ( int  nAps)

Returns the list of fragments with given number of APs.

Parameters
nApsthe number of attachment points
Returns
the list of fragments as indexes in the library of fragments.

Definition at line 936 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.fragPoolPerNumAP.

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

Here is the caller graph for this function:

◆ getMapOfFragsPerNumAps()

HashMap< Integer, ArrayList< Integer > > denoptim.fragspace.FragmentSpace.getMapOfFragsPerNumAps ( )

Definition at line 922 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.fragPoolPerNumAP.

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

Here is the caller graph for this function:

◆ getPolarizedRCV()

static Vertex denoptim.fragspace.FragmentSpace.getPolarizedRCV ( boolean  polarity)
static

Returns a newly-built vertex that can play the role of a ring-closing vertex even when working with 3D building blocks.

Parameters
polarityuse true to get an RCV with attachment point class APClass#ATPLUSS and false to get APClass#ATMINUS.
Returns
the ring-closing vertex.

Definition at line 2017 of file FragmentSpace.java.

References denoptim.graph.Fragment.addAP(), denoptim.graph.Fragment.addAtom(), denoptim.graph.APClass.RCACLASSMINUS, denoptim.graph.APClass.RCACLASSPLUS, denoptim.graph.rings.RingClosingAttractor.RCALABELPERAPCLASS, and denoptim.graph.Vertex.setAsRCV().

Referenced by denoptim.graph.VertexTest.testIsConnectedToAromaticBridge(), and denoptim.ga.EAUtilsTest.testSearchForApPairsSuitableToRingFusion().

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

◆ getRandomizer()

Randomizer denoptim.fragspace.FragmentSpace.getRandomizer ( )

Returns the program-specific randomizer that is associated with this program-specific fragment space.

Returns
the program-specific randomizer.

Definition at line 463 of file FragmentSpace.java.

References denoptim.programs.RunTimeParameters.getRandomizer(), and denoptim.fragspace.FragmentSpace.settings.

Referenced by denoptim.fragspace.APMapFinder.findAllMappings().

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

◆ getRCCompatibilityMatrix()

HashMap< APClass, ArrayList< APClass > > denoptim.fragspace.FragmentSpace.getRCCompatibilityMatrix ( )

Returns the compatibility matrix for ring closing fragment-fragment connections or null if not provided in the parameters file.

Returns

Definition at line 872 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.rcCompatMap.

Referenced by denoptim.ga.EAUtils.canBeUsedForRingFusion(), and denoptim.graph.rings.RingSizeManager.evaluateRCVPair().

Here is the caller graph for this function:

◆ getRCVs()

ArrayList< Vertex > denoptim.fragspace.FragmentSpace.getRCVs ( )

Returns the list of registered ring-closing vertexes (RCVs).

Returns
the list of registered ring-closing vertexes (RCVs).

Definition at line 1844 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.rcvs.

Referenced by denoptim.fragspace.FragmentSpace.getRCVsForAPClass(), and denoptim.fragspace.FragmentSpace.getRCVsWithAPClass().

Here is the caller graph for this function:

◆ getRCVsForAPClass()

List< Vertex > denoptim.fragspace.FragmentSpace.getRCVsForAPClass ( APClass  apc)

Searches for all building blocks that are ring-closing vertexes and are compatible with the given AP.

Parameters
apcthe class of the attachment point meant to hold the RCV.
Returns
a list of vertexes ready to be used (i.e., clones of the vertexes stored in the library). The list can be empty.

Definition at line 1207 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.getCompatibilityMatrix(), denoptim.fragspace.FragmentSpace.getRCVs(), and denoptim.fragspace.FragmentSpace.getVertexFromLibrary().

Referenced by denoptim.fragspace.FragmentSpaceTest.testGetRCVsForAPClass().

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

◆ getRCVsWithAPClass()

List< Vertex > denoptim.fragspace.FragmentSpace.getRCVsWithAPClass ( APClass  apc)

Searches for all building blocks that are ring-closing vertexes and hold an AP with the given class.

Parameters
apcthe desired class of the attachment point.
Returns
a list of vertexes ready to be used (i.e., clones of the vertexes stored in the library). The list can be empty.

Definition at line 1172 of file FragmentSpace.java.

References denoptim.graph.APClass.equals(), denoptim.fragspace.FragmentSpace.getRCVs(), and denoptim.fragspace.FragmentSpace.getVertexFromLibrary().

Referenced by denoptim.fragspace.FragmentSpaceTest.testGetRCVsWithAPClass().

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

◆ getScaffoldLibrary()

◆ getSymmetryConstrain()

double denoptim.fragspace.FragmentSpace.getSymmetryConstrain ( APClass  apClass)

Return the constitutional symmetry constrain for the given APclass, or null.

The constrain is a fixed probability that is not dependent on the distance from the root of the DENOPTIMGraph (i.e. the level).

Parameters
apClassthe attachment point class
Returns
the constrained value of the symmetric substitution probability (0.0 - 1.0).

Definition at line 1481 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.symmConstraints.

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

Here is the caller graph for this function:

◆ getVertexFromLibrary()

Vertex denoptim.fragspace.FragmentSpace.getVertexFromLibrary ( Vertex.BBType  bbType,
int  bbIdx 
) throws DENOPTIMException

Returns a clone of the requested building block.

The type of vertex returned depends on the type stored in the library.

Parameters
bbTypethe type of building block. This basically selects the sub library from which the building block is taken: 0 for scaffold (i.e., building blocks that can be used to start a new graph), 1 for standard building blocks (i.e., can be used freely to grow or modify an existing graph), or 2 for capping group (i.e., can be used only to saturate attachment points that cannot remain unused in a finished graph).
bbIdxthe index (0-based) of the building block in the corresponding library defied by the type of building block 'bbType'
Returns
a clone of the chosen building block.
Exceptions
DENOPTIMExceptionwhen the given indexes cannot be used, for example, any of the indexes is out of range.

Definition at line 539 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.cappingLib, denoptim.graph.Vertex.clone(), denoptim.fragspace.FragmentSpace.fragmentLib, denoptim.graph.Vertex.getBuildingBlockId(), denoptim.programs.RunTimeParameters.getLogger(), denoptim.utils.GraphUtils.getUniqueVertexIndex(), denoptim.fragspace.FragmentSpace.scaffoldLib, denoptim.graph.Vertex.setBuildingBlockId(), denoptim.fragspace.FragmentSpace.settings, and denoptim.graph.Vertex.setVertexId().

Referenced by denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), denoptim.fragspace.FragmentSpace.getAPClassForFragment(), denoptim.fragspace.GraphLinkFinder.getCandidateBBs(), denoptim.fragspace.FragmentSpace.getCappingVertexWithAPClass(), denoptim.fragspace.FragmentSpace.getFragmentsCompatibleWithTheseAPs(), denoptim.fragspace.FragmentSpace.getRCVsForAPClass(), denoptim.fragspace.FragmentSpace.getRCVsWithAPClass(), denoptim.fragspace.GraphLinkFinder.GraphLinkFinder(), denoptim.fragspace.GraphLinkFinderTest.makeTestGraphA(), denoptim.fragspace.GraphLinkFinderTest.makeTestGraphE(), denoptim.fragspace.GraphLinkFinderTest.makeTestGraphF(), and denoptim.fragspace.FragmentSpaceTest.testUseWholeMolGeometryForExtractedTemplates().

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

◆ getVerticesWithAPClass()

ArrayList< Vertex > denoptim.fragspace.FragmentSpace.getVerticesWithAPClass ( APClass  apc)

Returns the list of vertexes with attachment points of the given class.

Parameters
apcthe attachment point class to search.
Returns
the list of matching vertexes from the library.

Definition at line 1005 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.fragmentLib, denoptim.fragspace.FragmentSpace.fragsApsPerApClass, and denoptim.fragspace.FragmentSpace.LOCK.

Referenced by denoptim.fragspace.FragmentSpace.getAPsCompatibleWithClass(), and denoptim.fragspace.FragmentSpaceTest.testGetVerticesWithAPClass().

Here is the caller graph for this function:

◆ getVerticesWithAPClasses()

List< Vertex > denoptim.fragspace.FragmentSpace.getVerticesWithAPClasses ( Set< APClass apcs)

Returns the list of vertexes with at least one attachment point of each of the given classes.

Parameters
apcsthe wanted attachment point classes.
Returns
the list of matching vertexes from the library.

Definition at line 1032 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.fragmentLib, denoptim.fragspace.FragmentSpace.fragsApsPerApClass, denoptim.graph.Vertex.getAllAPClasses(), and denoptim.fragspace.FragmentSpace.LOCK.

Referenced by denoptim.fragspace.FragmentSpace.getVerticesWithAPFingerprint(), and denoptim.fragspace.FragmentSpaceTest.testGetVerticesWithAPClasses().

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

◆ getVerticesWithAPClassStartingWith()

List< Vertex > denoptim.fragspace.FragmentSpace.getVerticesWithAPClassStartingWith ( String  root)

Extracts vertexes from the collection of vertexes defined by this FragmentSpace.

Parameters
rootthe initial part of the APClass full name.
Returns
the available vertexes that have AttachmentPoints that start with the given string. The returned vertexes are the original ones, not clones!

Definition at line 1103 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.fragmentLib, denoptim.fragspace.FragmentSpace.fragsApsPerApClass, and denoptim.fragspace.FragmentSpace.LOCK.

Referenced by denoptim.ga.EAUtils.getUsableAromaticBridges(), and denoptim.fragspace.FragmentSpaceTest.testGetFragsWithAPClassStartingWith().

Here is the caller graph for this function:

◆ getVerticesWithAPFingerprint()

List< Vertex > denoptim.fragspace.FragmentSpace.getVerticesWithAPFingerprint ( Map< APClass, Integer >  apcCounts)

Returns the list of vertexes that have the specified number of AttachmentPoints with the given APClasses.

Parameters
apcCountsspecifies for each APClass the desired minimum number of AttachmentPoints.
Returns
the list of matching vertexes from the library.

Definition at line 1070 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.getVerticesWithAPClasses().

Referenced by denoptim.ga.EAUtils.getUsableAliphaticBridges(), and denoptim.fragspace.FragmentSpaceTest.testGetVerticesWithAPFingerprint().

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

◆ groupAndClassifyFragments()

void denoptim.fragspace.FragmentSpace.groupAndClassifyFragments ( boolean  apClassBasedApproch) throws DENOPTIMException

Performs grouping and classification operations on the library of building blocks of BBType#FRAGMENT.

Parameters
apClassBasedApprochtrue if you are using class based approach

Definition at line 1997 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.classifyFragment(), and denoptim.fragspace.FragmentSpace.getFragmentLibrary().

Referenced by denoptim.fragspace.FragmentSpace.define(), and denoptim.fragspace.GraphLinkFinderTest.prepare().

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

◆ hasIsomorph()

boolean denoptim.fragspace.FragmentSpace.hasIsomorph ( DGraph  graph,
BBType  type 
)

Checks if a graph is isomorphic to another template's inner graph in its appropriate fragment space library (inferred from BBType).

Parameters
graphto check if has an isomorph in the fragment space.
typespecifying which fragment library to check for isomorphs in.
Returns
true if there is an isomorph template in the library of the specified type.

Definition at line 1817 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.fragmentLib, denoptim.graph.Template.getInnerGraph(), denoptim.graph.Vertex.BBType.SCAFFOLD, and denoptim.fragspace.FragmentSpace.scaffoldLib.

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

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

◆ hasSymmetryConstrain()

boolean denoptim.fragspace.FragmentSpace.hasSymmetryConstrain ( APClass  apClass)

Checks if there is a constraint on the constitutional symmetry probability for the given AP class.

Parameters
apClassthe attachment point class
Returns
true if there is a constraint on the constitutional symmetry probability for the given AP class.

Definition at line 1462 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.symmConstraints.

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

Here is the caller graph for this function:

◆ importCompatibilityMatrixFromFile()

void denoptim.fragspace.FragmentSpace.importCompatibilityMatrixFromFile ( String  inFile) throws DENOPTIMException

Load info from a compatibility matrix file.

This method imports information such as the compatibility matrix, bond order map, and forbidden ends from a compatibility matrix file (i.e., a formatted text file using DENOPTIM keyword. This overrides any previous setting of such information in this FragmentSpace.

Parameters
inFilethe pathname of the compatibility matrix file

Definition at line 813 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.apClassCompatibilityMatrix, denoptim.fragspace.FragmentSpace.cappingMap, denoptim.fragspace.FragmentSpace.forbiddenEndList, denoptim.io.DenoptimIO.readCompatibilityMatrix(), denoptim.fragspace.FragmentSpace.setCappingMap(), denoptim.fragspace.FragmentSpace.setCompatibilityMatrix(), and denoptim.fragspace.FragmentSpace.setForbiddenEndList().

Referenced by denoptim.gui.FSParametersForm.FSParametersForm().

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

◆ importRCCompatibilityMatrixFromFile()

void denoptim.fragspace.FragmentSpace.importRCCompatibilityMatrixFromFile ( String  inFile) throws DENOPTIMException

Load info for ring closures compatibilities from a compatibility matrix file.

Parameters
inFilethe pathname of the RC-compatibility matrix file

Definition at line 832 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.rcCompatMap, denoptim.io.DenoptimIO.readRCCompatibilityMatrix(), and denoptim.fragspace.FragmentSpace.setRCCompatibilityMatrix().

Here is the call graph for this function:

◆ imposeSymmetryOnAPsOfClass()

boolean denoptim.fragspace.FragmentSpace.imposeSymmetryOnAPsOfClass ( APClass  apClass)

Checks if the symmetry settings impose use of symmetry on attachment points of the given AP class.

The value returned is the result of the action of symmetry-related keyword affecting the definition of this FragmentSpace.

Parameters
apClassthe attachment point class
Returns
true if symmetry has the applied on APs of the given class

Definition at line 1431 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpaceParameters.enforceSymmetry, denoptim.constants.DENOPTIMConstants.FLOATCOMPARISONTOLERANCE, denoptim.fragspace.FragmentSpace.getSymmetryConstrain(), denoptim.fragspace.FragmentSpace.hasSymmetryConstrain(), and denoptim.fragspace.FragmentSpace.settings.

Referenced by denoptim.ga.GraphOperations.attachFragmentInClosableChain(), denoptim.ga.GraphOperations.extendGraph(), denoptim.fragspace.FragsCombinationIterator.FragsCombinationIterator(), and denoptim.fragspace.FragsCombinationIterator.next().

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

◆ isDefined()

◆ makeRandomScaffold()

Vertex denoptim.fragspace.FragmentSpace.makeRandomScaffold ( )

Randomly select a scaffold and return a fully configured clone of it.

Returns
a scaffold-type building block ready to be used in a new graph.
Exceptions
DENOPTIMException

Definition at line 715 of file FragmentSpace.java.

References denoptim.programs.RunTimeParameters.getRandomizer(), denoptim.utils.GraphUtils.getUniqueVertexIndex(), denoptim.graph.Vertex.newVertexFromLibrary(), denoptim.utils.Randomizer.nextInt(), denoptim.graph.Vertex.BBType.SCAFFOLD, denoptim.fragspace.FragmentSpace.scaffoldLib, and denoptim.fragspace.FragmentSpace.settings.

Referenced by denoptim.ga.EAUtils.buildGraph().

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

◆ mapAPClassCompatibilities()

List< APMapping > denoptim.fragspace.FragmentSpace.mapAPClassCompatibilities ( List< AttachmentPoint listA,
List< AttachmentPoint listB,
int  maxCombinations 
)

Given two lists of APs this method maps the APClass-compatibilities from between the two lists considering the APs in the first list the for the role of source AP in the hypothetical edge.

Parameters
listAlist of candidate source APs
listBlist of candidate target APs
maxCombinationsa maximum limit; if reached we are happy we give up finding more combination.
Returns

Definition at line 1861 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpaceUtils.recursiveCombiner(), and denoptim.fragspace.FragmentSpace.useAPclassBasedApproach().

Here is the call graph for this function:

◆ registerRCV()

void denoptim.fragspace.FragmentSpace.registerRCV ( Vertex  v)

Adds the reference to a ring-closing vertex (RCV) to the quick-access list of RCVs known in this building block space.

Parameters
vthe RCV to add to the list.

Definition at line 1833 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.rcvs.

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

Here is the caller graph for this function:

◆ setAPclassBasedApproach()

◆ setCappingLibrary()

void denoptim.fragspace.FragmentSpace.setCappingLibrary ( ArrayList< Vertex lib)

Definition at line 1502 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.appendVerticesToLibrary(), denoptim.graph.Vertex.BBType.CAP, and denoptim.fragspace.FragmentSpace.cappingLib.

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

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

◆ setCappingMap()

void denoptim.fragspace.FragmentSpace.setCappingMap ( HashMap< APClass, APClass map)

Definition at line 1525 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.cappingMap.

Referenced by denoptim.fragspace.FragmentSpace.define(), and denoptim.fragspace.FragmentSpace.importCompatibilityMatrixFromFile().

Here is the caller graph for this function:

◆ setCompatibilityMatrix()

void denoptim.fragspace.FragmentSpace.setCompatibilityMatrix ( HashMap< APClass, ArrayList< APClass > >  map)

Definition at line 1510 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.apClassCompatibilityMatrix.

Referenced by denoptim.fragspace.FragmentSpace.define(), and denoptim.fragspace.FragmentSpace.importCompatibilityMatrixFromFile().

Here is the caller graph for this function:

◆ setForbiddenEndList()

void denoptim.fragspace.FragmentSpace.setForbiddenEndList ( Set< APClass lst)

Definition at line 1532 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.forbiddenEndList.

Referenced by denoptim.fragspace.FragmentSpace.define(), and denoptim.fragspace.FragmentSpace.importCompatibilityMatrixFromFile().

Here is the caller graph for this function:

◆ setFragmentLibrary()

void denoptim.fragspace.FragmentSpace.setFragmentLibrary ( ArrayList< Vertex lib)

Definition at line 1494 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.appendVerticesToLibrary(), denoptim.graph.Vertex.BBType.FRAGMENT, and denoptim.fragspace.FragmentSpace.fragmentLib.

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

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

◆ setRCCompatibilityMatrix()

void denoptim.fragspace.FragmentSpace.setRCCompatibilityMatrix ( HashMap< APClass, ArrayList< APClass > >  map)

Definition at line 1517 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.rcCompatMap.

Referenced by denoptim.fragspace.FragmentSpace.define(), and denoptim.fragspace.FragmentSpace.importRCCompatibilityMatrixFromFile().

Here is the caller graph for this function:

◆ setScaffoldLibrary()

void denoptim.fragspace.FragmentSpace.setScaffoldLibrary ( ArrayList< Vertex lib)

Definition at line 1488 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.appendVerticesToLibrary(), denoptim.graph.Vertex.BBType.SCAFFOLD, and denoptim.fragspace.FragmentSpace.scaffoldLib.

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

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

◆ setSymmConstraints()

void denoptim.fragspace.FragmentSpace.setSymmConstraints ( HashMap< APClass, Double >  map)

Definition at line 1539 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.symmConstraints.

Referenced by denoptim.fragspace.FragmentSpace.define(), and denoptim.ga.EAUtilsTest.testFusionSiteDetection_ImposeSymmetry().

Here is the caller graph for this function:

◆ useAPclassBasedApproach()

boolean denoptim.fragspace.FragmentSpace.useAPclassBasedApproach ( )

Check usage of APClass-based approach, i.e., uses attachment points with annotated data (i.e., the APClass) to evaluate compatibilities between attachment points.

Returns
true if this fragment space makes use of APClass-based approach

Definition at line 488 of file FragmentSpace.java.

References denoptim.fragspace.FragmentSpace.apClassBasedApproch.

Referenced by denoptim.ga.EAUtils.buildCandidatesByXOver(), denoptim.combinatorial.GraphBuildingTask.call(), denoptim.graph.DGraph.checkConsistency(), denoptim.fragspace.FragmentSpace.classifyFragment(), denoptim.fragspace.APMapFinder.findMappingCompatibileAPs(), denoptim.fragspace.GraphLinkFinder.GraphLinkFinder(), denoptim.graph.DGraph.makeAllGraphsWithDifferentRingSets(), denoptim.fragspace.FragmentSpace.mapAPClassCompatibilities(), denoptim.ga.Population.Population(), and denoptim.ga.EAUtils.setupRings().

Here is the caller graph for this function:

Member Data Documentation

◆ apClassBasedApproch

boolean denoptim.fragspace.FragmentSpace.apClassBasedApproch = false
private

◆ apClassCompatibilityMatrix

HashMap<APClass, ArrayList<APClass> > denoptim.fragspace.FragmentSpace.apClassCompatibilityMatrix
private

◆ apClassesPerFrag

HashMap<Integer, ArrayList<APClass> > denoptim.fragspace.FragmentSpace.apClassesPerFrag
private
Initial value:
=
new HashMap<Integer,ArrayList<APClass>>()

List of APClasses per each fragment.

Definition at line 135 of file FragmentSpace.java.

Referenced by denoptim.fragspace.FragmentSpace.classifyFragment(), denoptim.fragspace.FragmentSpace.clearAll(), and denoptim.fragspace.FragmentSpace.getAPClassesPerFragment().

◆ cappingLib

ArrayList<Vertex> denoptim.fragspace.FragmentSpace.cappingLib = null
private

Data structure containing the molecular representation of building blocks: capping group section - fragments with only one attachment point used to saturate unused attachment points on a graph.

WARNING! The objects stores in the library do not have a meaningful value for the two indexes representing the type of building block and the position of the list of all building blocks of that type.

Definition at line 95 of file FragmentSpace.java.

Referenced by denoptim.fragspace.FragmentSpace.clearAll(), denoptim.fragspace.FragmentSpace.FragmentSpace(), denoptim.fragspace.FragmentSpace.getCappingGroupsWithAPClass(), denoptim.fragspace.FragmentSpace.getCappingLibrary(), denoptim.fragspace.FragmentSpace.getCappingVertexWithAPClass(), denoptim.fragspace.FragmentSpace.getCompatibleCappingFragments(), denoptim.fragspace.FragmentSpace.getVertexFromLibrary(), and denoptim.fragspace.FragmentSpace.setCappingLibrary().

◆ cappingMap

HashMap<APClass, APClass> denoptim.fragspace.FragmentSpace.cappingMap
private

◆ forbiddenEndList

Set<APClass> denoptim.fragspace.FragmentSpace.forbiddenEndList
private

◆ fragmentLib

ArrayList<Vertex> denoptim.fragspace.FragmentSpace.fragmentLib = null
private

Data structure containing the molecular representation of building blocks: fragment section - fragments for general use.

WARNING! The objects stores in the library do not have a meaningful value for the two indexes representing the type of building block and the position of the list of all building blocks of that type.

Definition at line 85 of file FragmentSpace.java.

Referenced by denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary(), denoptim.fragspace.FragmentSpace.clearAll(), denoptim.fragspace.FragmentSpace.FragmentSpace(), denoptim.fragspace.FragmentSpace.getFragmentLibrary(), denoptim.fragspace.FragmentSpace.getVertexFromLibrary(), denoptim.fragspace.FragmentSpace.getVerticesWithAPClass(), denoptim.fragspace.FragmentSpace.getVerticesWithAPClasses(), denoptim.fragspace.FragmentSpace.getVerticesWithAPClassStartingWith(), denoptim.fragspace.FragmentSpace.hasIsomorph(), and denoptim.fragspace.FragmentSpace.setFragmentLibrary().

◆ fragPoolPerNumAP

HashMap<Integer, ArrayList<Integer> > denoptim.fragspace.FragmentSpace.fragPoolPerNumAP
private
Initial value:
=
new HashMap<Integer,ArrayList<Integer>>()

Clusters of fragments based on the number of APs.

Definition at line 129 of file FragmentSpace.java.

Referenced by denoptim.fragspace.FragmentSpace.clearAll(), denoptim.fragspace.FragmentSpace.getFragsWithNumAps(), and denoptim.fragspace.FragmentSpace.getMapOfFragsPerNumAps().

◆ fragsApsPerApClass

HashMap<APClass, ArrayList<ArrayList<Integer> > > denoptim.fragspace.FragmentSpace.fragsApsPerApClass
private
Initial value:
=
new HashMap<APClass,ArrayList<ArrayList<Integer>>>()

Clusters of fragments'AP based on AP classes.

The inner list of indexes is a ordered pair defining at position 0 the index of the vertex, and
the index of the AP at position 1.

Definition at line 143 of file FragmentSpace.java.

Referenced by denoptim.fragspace.FragmentSpace.classifyFragment(), denoptim.fragspace.FragmentSpace.clearAll(), denoptim.fragspace.FragmentSpace.getFragsWithAPClass(), denoptim.fragspace.FragmentSpace.getVerticesWithAPClass(), denoptim.fragspace.FragmentSpace.getVerticesWithAPClasses(), and denoptim.fragspace.FragmentSpace.getVerticesWithAPClassStartingWith().

◆ isValid

boolean denoptim.fragspace.FragmentSpace.isValid = false
private

Flag signaling that this fragment space was built and validated.

Definition at line 164 of file FragmentSpace.java.

Referenced by denoptim.fragspace.FragmentSpace.clearAll(), denoptim.fragspace.FragmentSpace.define(), and denoptim.fragspace.FragmentSpace.isDefined().

◆ LOCK

◆ rcCompatMap

HashMap<APClass, ArrayList<APClass> > denoptim.fragspace.FragmentSpace.rcCompatMap
private

Data structure that stores compatible APclasses for joining APs in ring-closing bonds.

Symmetric, purpose specific compatibility matrix.

Definition at line 113 of file FragmentSpace.java.

Referenced by denoptim.fragspace.FragmentSpace.clearAll(), denoptim.fragspace.FragmentSpace.getRCCompatibilityMatrix(), denoptim.fragspace.FragmentSpace.importRCCompatibilityMatrixFromFile(), and denoptim.fragspace.FragmentSpace.setRCCompatibilityMatrix().

◆ rcvs

ArrayList<Vertex> denoptim.fragspace.FragmentSpace.rcvs = new ArrayList<Vertex>()
private

Store references to the Ring-Closing Vertexes found in the library of fragments.

Definition at line 107 of file FragmentSpace.java.

Referenced by denoptim.fragspace.FragmentSpace.getRCVs(), and denoptim.fragspace.FragmentSpace.registerRCV().

◆ scaffoldLib

ArrayList<Vertex> denoptim.fragspace.FragmentSpace.scaffoldLib = null
private

Data structure containing the molecular representation of building blocks: scaffolds section - fragments that can be used as seeds to grow a new molecule.

WARNING! The objects stores in the library do not have a meaningful value for the two indexes representing the type of building block and the position of the list of all building blocks of that type.

Definition at line 76 of file FragmentSpace.java.

Referenced by denoptim.fragspace.FragmentSpace.addFusedRingsToFragmentLibrary(), denoptim.fragspace.FragmentSpace.clearAll(), denoptim.fragspace.FragmentSpace.FragmentSpace(), denoptim.fragspace.FragmentSpace.getScaffoldLibrary(), denoptim.fragspace.FragmentSpace.getVertexFromLibrary(), denoptim.fragspace.FragmentSpace.hasIsomorph(), denoptim.fragspace.FragmentSpace.makeRandomScaffold(), and denoptim.fragspace.FragmentSpace.setScaffoldLibrary().

◆ settings

◆ symmConstraints

HashMap<APClass, Double> denoptim.fragspace.FragmentSpace.symmConstraints
private

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