20package denoptim.fragspace;
23import java.io.IOException;
24import java.util.ArrayList;
25import java.util.HashMap;
26import java.util.HashSet;
30import java.util.logging.Level;
32import javax.vecmath.Point3d;
34import org.openscience.cdk.Atom;
35import org.openscience.cdk.PseudoAtom;
36import org.openscience.cdk.interfaces.IAtomContainer;
38import denoptim.constants.DENOPTIMConstants;
39import denoptim.exception.DENOPTIMException;
40import denoptim.files.UndetectedFileFormatException;
41import denoptim.graph.APClass;
42import denoptim.graph.APMapping;
43import denoptim.graph.AttachmentPoint;
44import denoptim.graph.Candidate;
45import denoptim.graph.DGraph;
46import denoptim.graph.Fragment;
47import denoptim.graph.GraphPattern;
48import denoptim.graph.Template;
49import denoptim.graph.Vertex;
50import denoptim.graph.Vertex.BBType;
51import denoptim.graph.rings.RingClosingAttractor;
52import denoptim.io.DenoptimIO;
53import denoptim.utils.GraphUtils;
54import denoptim.utils.MoleculeUtils;
55import denoptim.utils.Randomizer;
106 private ArrayList<Vertex>
rcvs =
new ArrayList<Vertex>();
143 private final Object
LOCK =
new Object();
200 String fragFile, String capFile, String cpmFile)
203 this(
settings, scaffFile, fragFile, capFile, cpmFile,
"",
204 new HashMap<APClass, Double>());
231 ArrayList<Vertex> scaffLib,
232 ArrayList<Vertex> fragLib,
233 ArrayList<Vertex> cappLib,
234 HashMap<
APClass, ArrayList<APClass>> cpMap,
235 HashMap<APClass, APClass> capMap,
236 HashSet<APClass> forbEnds,
237 HashMap<
APClass, ArrayList<APClass>> rcCpMap)
240 define(
settings, scaffLib, fragLib, cappLib, cpMap, capMap, forbEnds,
269 ArrayList<Vertex> scaffLib,
270 ArrayList<Vertex> fragLib,
271 ArrayList<Vertex> cappLib,
272 HashMap<
APClass, ArrayList<APClass>> cpMap,
273 HashMap<APClass, APClass> capMap,
274 HashSet<APClass> forbEnds,
275 HashMap<
APClass, ArrayList<APClass>> rcCpMap,
276 HashMap<APClass, Double> symCntrMap)
279 define(
settings, scaffLib, fragLib, cappLib, cpMap, capMap, forbEnds,
280 rcCpMap, symCntrMap);
305 String fragFile, String capFile, String cpmFile, String rcpmFile,
308 HashMap<APClass, ArrayList<APClass>> cpMap =
309 new HashMap<APClass, ArrayList<APClass>>();
310 HashMap<APClass, APClass> capMap =
new HashMap<APClass, APClass>();
311 HashSet<APClass> forbEnds =
new HashSet<APClass>();
312 if (cpmFile.length() > 0)
318 HashMap<APClass, ArrayList<APClass>> rcCpMap =
319 new HashMap<APClass, ArrayList<APClass>>();
320 if (rcpmFile !=
null && rcpmFile.length() > 0)
325 ArrayList<Vertex> cappLib =
new ArrayList<Vertex>();
326 if (capFile.length() > 0)
332 for (
int i=0; i<cappLib.size(); i++)
334 cappLib.get(i).setBuildingBlockId(i);
340 +
"groups from file '" + capFile +
"'.", e);
344 ArrayList<Vertex> fragLib =
new ArrayList<Vertex>();
345 if (fragFile !=
null && fragFile.length() > 0)
351 for (
int i=0; i<fragLib.size(); i++)
353 fragLib.get(i).setBuildingBlockId(i);
359 +
"from file '" + fragFile +
"'.", e);
363 ArrayList<Vertex> scaffLib =
new ArrayList<Vertex>();
364 if (scaffFile !=
null && scaffFile.length() > 0)
370 for (
int i=0; i<scaffLib.size(); i++)
372 scaffLib.get(i).setBuildingBlockId(i);
378 +
"from file '" + fragFile +
"'.", e);
382 define(
settings, scaffLib, fragLib, cappLib, cpMap, capMap, forbEnds,
383 rcCpMap, symCntrMap);
410 ArrayList<Vertex> scaffLib,
411 ArrayList<Vertex> fragLib,
412 ArrayList<Vertex> cappLib,
413 HashMap<
APClass, ArrayList<APClass>> cpMap,
414 HashMap<APClass, APClass> capMap,
415 HashSet<APClass> forbEnds,
416 HashMap<
APClass, ArrayList<APClass>> rcCpMap,
417 HashMap<APClass, Double> symCntrMap)
503 }
catch (Throwable t)
541 msg =
"Cannot retrieve scaffolds before initialising the "
542 +
"scaffold library.";
549 msg =
"Cannot retrieve fragments before initialising the "
550 +
"fragment library.";
557 msg =
"Cannot retrieve capping groups before initialising"
558 +
"the library of capping groups.";
565 +
"type '" + bbType +
"' in the fragment space.");
568 Vertex originalVrtx =
null;
578 msg =
"Mismatch between scaffold bbIdx (" + bbIdx
579 +
") and size of the library (" +
scaffoldLib.size()
580 +
"). FragType: " + bbType;
593 msg =
"Mismatch between fragment bbIdx (" + bbIdx
594 +
") and size of the library (" +
fragmentLib.size()
595 +
"). FragType: " + bbType;
608 msg =
"Mismatch between capping group bbIdx " + bbIdx
609 +
") and size of the library (" +
cappingLib.size()
610 +
"). FragType: " + bbType;
617 msg =
"Attempting to take UNDEFINED type of building block from "
618 +
"fragment library.";
626 msg =
"Mismatch between fragment bbIdx (" + bbIdx
627 +
") and size of the library (" +
fragmentLib.size()
628 +
"). FragType: " + bbType;
635 msg =
"Unknown type of fragment '" + bbType +
"'.";
649 +
"the list of building blocks (" + bbIdx +
") for type "
671 if (reacFrags.size() > 0)
690 ArrayList<Integer> lstFragIdx =
new ArrayList<>();
695 if (lstRcn.contains(cmpReac))
754 ArrayList<Integer> selected =
new ArrayList<>();
853 return new ArrayList<APClass>();
931 ArrayList<Integer> lst =
new ArrayList<>();
970 ArrayList<IdFragmentAndAP> lst =
new ArrayList<IdFragmentAndAP>();
1000 ArrayList<Vertex> lst =
new ArrayList<Vertex>();
1027 ArrayList<IdFragmentAndAP> srcAPs)
1030 ArrayList<IdFragmentAndAP> compatFragAps =
1034 Set<Integer> compatFragIds =
new HashSet<Integer>();
1037 compatFragIds.add(apId.getVertexMolId());
1041 ArrayList<Vertex> compatFrags =
new ArrayList<Vertex>();
1042 for (Integer fid : compatFragIds)
1048 +
"to get fragment '" + fid +
"'!");
1049 e.printStackTrace();
1067 List<Vertex> chosenRCVs =
new ArrayList<Vertex>();
1071 if (apc.
equals(rcv.getAP(0).getAPClass()))
1077 rcv.getBuildingBlockId());
1078 chosenRCVs.add(copyOfRCV);
1083 e.printStackTrace();
1102 List<Vertex> chosenRCVs =
new ArrayList<Vertex>();
1111 if (apcsCompatWithSrcAP.contains(rcv.getAP(0).getAPClass()))
1117 rcv.getBuildingBlockId());
1118 chosenRCVs.add(copyOfRCV);
1123 e.printStackTrace();
1141 ArrayList<AttachmentPoint> srcAPs)
1143 ArrayList<AttachmentPoint> compAps =
1144 new ArrayList<AttachmentPoint>();
1145 boolean first =
true;
1148 ArrayList<AttachmentPoint> compForOne =
1153 compAps.addAll(compForOne);
1158 ArrayList<AttachmentPoint> toKeep =
1159 new ArrayList<AttachmentPoint>();
1164 if (newCand == candAp)
1174 if (compAps.size()==0)
1192 ArrayList<IdFragmentAndAP> srcAPs)
1194 ArrayList<IdFragmentAndAP> compFrAps =
new ArrayList<IdFragmentAndAP>();
1195 boolean first =
true;
1199 ArrayList<IdFragmentAndAP> compForOne =
1204 compFrAps.addAll(compForOne);
1209 ArrayList<IdFragmentAndAP> toKeep =
1210 new ArrayList<IdFragmentAndAP>();
1215 if (newId.sameFragAndAp(candAp))
1225 if (compFrAps.size() == 0)
1247 ArrayList<AttachmentPoint> compatAps =
1248 new ArrayList<AttachmentPoint>();
1254 if (compatApClasses !=
null)
1256 for (
APClass klass : compatApClasses)
1263 if (ap.getAPClass() == klass)
1272 if (compatAps.size()==0)
1275 +
"AP found in the fragment space for APClass '"
1294 ArrayList<IdFragmentAndAP> compatFragAps =
1295 new ArrayList<IdFragmentAndAP>();
1301 if (compatApClasses !=
null)
1303 for (
APClass compClass : compatApClasses)
1308 return compatFragAps;
1411 ArrayList<APClass>> map)
1433 HashMap<Integer, ArrayList<Integer>> map)
1546 boolean addIfScaffold,
boolean addIfFragment)
1579 boolean addIfScaffold,
boolean addIfFragment,
1580 IAtomContainer wholeMol)
1582 List<DGraph> subgraphs =
null;
1589 +
"fused ring patters.");
1590 e1.printStackTrace();
1593 for (
DGraph g : subgraphs)
1595 BBType type = g.hasScaffoldTypeVertex() ?
1608 ArrayList<Vertex> library = type == BBType.FRAGMENT ?
1623 boolean has3Dgeometry =
false;
1624 IAtomContainer subIAC =
null;
1633 has3Dgeometry =
true;
1636 e1.printStackTrace();
1637 ArrayList<DGraph> lst =
new ArrayList<>();
1640 String forDebugFile =
"failedExtractIAC_"
1645 new File(forDebugFile), lst);
1647 "WARNING: failed to extract "
1648 +
"molecular representation of graph. "
1649 +
"See file '" + forDebugFile +
"'.");
1653 "WARNING: failed to extract "
1654 +
"molecular representation of graph, "
1655 +
"and failed to write graph to file.");
1660 String msg =
"Adding new template (Inner Graph id: "
1662 +
"library of " + type +
"s. The template is "
1663 +
"generated from graph " + graph.
getGraphId();
1666 msg = msg +
" candidate " + source.
getName();
1677 String destFileName = type == BBType.FRAGMENT ?
1692 e.printStackTrace();
1694 +
"failed to write newly "
1695 +
"generated " + type +
" to file '"
1696 + destFileName +
"'.");
1717 .filter(v -> v instanceof
Template)
1720 .anyMatch(graph::isIsomorphicTo);
1759 List<AttachmentPoint> listA,
1760 List<AttachmentPoint> listB,
int maxCombinations)
1762 Map<AttachmentPoint,List<AttachmentPoint>> apCompatilities =
1763 new HashMap<AttachmentPoint,List<AttachmentPoint>>();
1769 boolean compatible =
false;
1772 if (apA.getAPClass().isCPMapCompatibleWith(apB.getAPClass(),
1782 if (apCompatilities.containsKey(apA))
1784 apCompatilities.get(apA).add(apB);
1786 List<AttachmentPoint> lst =
1787 new ArrayList<AttachmentPoint>();
1789 apCompatilities.put(apA,lst);
1796 List<AttachmentPoint> keys =
1797 new ArrayList<AttachmentPoint>(
1798 apCompatilities.keySet());
1801 List<APMapping> apMappings =
new ArrayList<APMapping>();
1802 if (keys.size() > 0)
1807 apCompatilities, currentMapping, apMappings,
true,
1836 ArrayList<Integer> lst =
new ArrayList<>();
1854 for (
int j=0; j<lstAPs.size(); j++)
1857 ArrayList<Integer> apId =
new ArrayList<Integer>();
1873 ArrayList<ArrayList<Integer>> outLst =
1874 new ArrayList<ArrayList<Integer>>();
1903 ArrayList<Integer>>>();
1937 rcv.
addAP(0,
new Point3d(1.5, 0.0, 0.0), apc);
General set of constants used in DENOPTIM.
static final double FLOATCOMPARISONTOLERANCE
Smallest difference for comparison of double and float numbers.
Class defining a space of building blocks.
HashMap< APClass, ArrayList< APClass > > getCompatibilityMatrix()
ArrayList< Vertex > getFragmentsCompatibleWithTheseAPs(ArrayList< IdFragmentAndAP > srcAPs)
Searches for all building blocks that are compatible with the given list of APs.
boolean hasSymmetryConstrain(APClass apClass)
Checks if there is a constraint on the constitutional symmetry probability for the given AP class.
ArrayList< APClass > getAPClassesPerFragment(int fragId)
Returns the APclasses associated with a given fragment.
List< APMapping > 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 consid...
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 prese...
void classifyFragment(Vertex frg, int fragId)
Classify a fragment in terms of the number of APs and possibly their type (AP-Class).
void registerRCV(Vertex v)
Adds the reference to a ring-closing vertex (RCV) to the quick-access list of RCVs known in this buil...
HashMap< APClass, APClass > cappingMap
Data structure that stores the AP-classes to be used to cap unused APS on the growing molecule.
boolean apClassBasedApproch
Flag defining use of AP class-based approach.
double getSymmetryConstrain(APClass apClass)
Return the constitutional symmetry constrain for the given APclass, or null.
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)
Define all components of a fragment space that implements the attachment point class-approach.
void setScaffoldLibrary(ArrayList< Vertex > lib)
void appendVertexToLibrary(Vertex v, Vertex.BBType bbt, ArrayList< Vertex > library)
Takes a vertex and add it to a given library.
ArrayList< IdFragmentAndAP > getFragAPsCompatibleWithTheseAPs(ArrayList< IdFragmentAndAP > srcAPs)
Searches for all APs that are compatible with the given list of APs.
void setCompatibilityMatrix(HashMap< APClass, ArrayList< APClass > > map)
Vertex getPolarizedRCV(boolean polarity)
Returns a newly-built vertex that can play the role of a ring-closing vertex even when working with 3...
FragmentSpaceParameters settings
Settings used to configure this fragment space.
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 prese...
HashMap< APClass, ArrayList< APClass > > rcCompatMap
Data structure that stores compatible APclasses for joining APs in ring-closing bonds.
boolean isValid
Flag signaling that this fragment space was built and validated.
HashMap< Integer, ArrayList< Integer > > getMapOfFragsPerNumAps()
Randomizer getRandomizer()
Returns the program-specific randomizer that is associated with this program-specific fragment space.
void importRCCompatibilityMatrixFromFile(String inFile)
Load info for ring closures compatibilities from a compatibility matrix file.
ArrayList< AttachmentPoint > getAPsCompatibleWithClass(APClass aPC1)
Returns the list of attachment points found in the fragment space and that are compatible with a give...
FragmentSpace(FragmentSpaceParameters settings, String scaffFile, String fragFile, String capFile, String cpmFile, String rcpmFile, HashMap< APClass, Double > symCntrMap)
Define all components of a fragment space that implements the attachment point class-approach.
APClass getAPClassForFragment(IdFragmentAndAP apId)
Search for a specific AP on a specific fragment and finds out its class.
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)
Define all components of this fragment space.
boolean useAPclassBasedApproach()
Check usage of APClass-based approach, i.e., uses attachment points with annotated data (i....
boolean isDefined()
Checks for valid definition of this fragment space.
Vertex getVertexFromLibrary(Vertex.BBType bbType, int bbIdx)
Returns a clone of the requested building block.
void importCompatibilityMatrixFromFile(String inFile)
Load info from a compatibility matrix file.
ArrayList< Vertex > cappingLib
Data structure containing the molecular representation of building blocks: capping group section - fr...
void setAPclassBasedApproach(boolean useAPC)
Set the fragment space to behave according to APClass-based approach.
ArrayList< IdFragmentAndAP > getFragsWithAPClass(APClass apc)
Returns the list of attachment points with the given class.
ArrayList< Integer > getCappingGroupsWithAPClass(APClass capApCls)
ArrayList< AttachmentPoint > getAPsCompatibleWithThese(ArrayList< AttachmentPoint > srcAPs)
Searches for all attachment points that are compatible with the given list of attachment points.
final Object LOCK
Lock for synchronizing tasks.
void groupAndClassifyFragments(boolean apClassBasedApproch)
Performs grouping and classification operations on the library of building blocks of BBType#FRAGMENT.
Set< APClass > getForbiddenEndList()
void appendVerticesToLibrary(ArrayList< Vertex > list, Vertex.BBType bbt, ArrayList< Vertex > library)
Takes a list of vertices and add them to a given library.
void clearAll()
Clears all settings of this fragment space.
HashMap< APClass, ArrayList< ArrayList< Integer > > > fragsApsPerApClass
Clusters of fragments'AP based on AP classes.
void setForbiddenEndList(Set< APClass > lst)
void setFragmentLibrary(ArrayList< Vertex > lib)
APClass getAPClassOfCappingVertex(APClass srcApClass)
ArrayList< Vertex > scaffoldLib
Data structure containing the molecular representation of building blocks: scaffolds section - fragme...
HashMap< APClass, ArrayList< APClass > > getRCCompatibilityMatrix()
Returns the compatibility matrix for ring closing fragment-fragment connections or null if not provid...
HashMap< APClass, ArrayList< APClass > > apClassCompatibilityMatrix
Data structure that stored the true entries of the attachment point classes compatibility matrix.
HashMap< Integer, ArrayList< APClass > > apClassesPerFrag
List of APClasses per each fragment.
HashMap< APClass, Double > symmConstraints
APclass-specific constraints to constitutional symmetry.
ArrayList< Integer > getCompatibleCappingFragments(APClass cmpReac)
Retrieve a list of compatible capping groups.
void setCappingMap(HashMap< APClass, APClass > map)
Vertex makeRandomScaffold()
Randomly select a scaffold and return a fully configured clone of it.
ArrayList< Vertex > getRCVs()
Returns the list of registered ring-closing vertexes (RCVs).
boolean imposeSymmetryOnAPsOfClass(APClass apClass)
Checks if the symmetry settings impose use of symmetry on attachment points of the given AP class.
List< Vertex > getRCVsWithAPClass(APClass apc)
Searches for all building blocks that are ring-closing vertexes and hold an AP with the given class.
Set< APClass > getAllAPClassesFromCPMap()
Return the set of APClasses that used in the compatibility matrix for the growing graph APs.
boolean hasIsomorph(DGraph graph, BBType type)
Checks if a graph is isomorphic to another template's inner graph in its appropriate fragment space l...
Set< APClass > forbiddenEndList
Data structure that stores AP classes that cannot be held unused.
FragmentSpace(FragmentSpaceParameters settings, String scaffFile, String fragFile, String capFile, String cpmFile)
Define all components of a fragment space that implements the attachment point class-approach.
ArrayList< IdFragmentAndAP > getFragAPsCompatibleWithClass(APClass aPC1)
Returns the list of attachment points found in the fragment space and that are compatible with a give...
Vertex getCappingVertexWithAPClass(APClass capApCls)
void setCappingLibrary(ArrayList< Vertex > lib)
HashMap< Integer, ArrayList< Integer > > fragPoolPerNumAP
Clusters of fragments based on the number of APs.
ArrayList< Vertex > getCappingLibrary()
ArrayList< Vertex > rcvs
Store references to the Ring-Closing Vertexes found in the library of fragments.
ArrayList< Vertex > fragmentLib
Data structure containing the molecular representation of building blocks: fragment section - fragmen...
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)
Define all components of a fragment space that implements the attachment point class-approach.
void addFusedRingsToFragmentLibrary(DGraph graph)
Extracts a system of one or more fused rings and adds them to the fragment space if not already prese...
ArrayList< Vertex > getVerticesWithAPClass(APClass apc)
Returns the list of attachment points with the given class.
HashMap< APClass, APClass > getCappingMap()
ArrayList< APClass > getCompatibleAPClasses(APClass apc)
Returns a list of APClasses compatible with the given APClass.
void setSymmConstraints(HashMap< APClass, Double > map)
ArrayList< Vertex > getScaffoldLibrary()
FragmentSpace()
Creates an empty fragment space, which is marked as invalid.
ArrayList< Integer > getFragsWithNumAps(int nAps)
Returns the list of fragments with given number of APs.
void setRCCompatibilityMatrix(HashMap< APClass, ArrayList< APClass > > map)
ArrayList< Vertex > getFragmentLibrary()
List< Vertex > getRCVsForAPClass(APClass apc)
Searches for all building blocks that are ring-closing vertexes and are compatible with the given AP.
int getCappingFragment(APClass rcnCap)
Select a compatible capping group for the given APClass.
void setFragPoolPerNumAP(HashMap< Integer, ArrayList< Integer > > map)
Parameters defining the fragment space.
boolean enforceSymmetry
Flag enforcing constitutional symmetry.
String getPathnameToAppendedFragments()
String getPathnameToAppendedScaffolds()
void setFragmentSpace(FragmentSpace fragmentSpace)
Sets the fragment space linked to these parameters.
Utility class for the fragment space.
static boolean recursiveCombiner(List< AttachmentPoint > keys, int currentKey, Map< AttachmentPoint, List< AttachmentPoint > > possibilities, APMapping combination, List< APMapping > completeCombinations, boolean screenAll, int maxCombs)
Search for all possible combinations of compatible APs.
Data structure containing information that identifies a single AP of a vertex/fragment.
BBType getVertexMolType()
static final APClass RCACLASSPLUS
Conventional class of attachment points on ring-closing vertexes.
static final APClass RCACLASSMINUS
Conventional class of attachment points on ring-closing vertexes.
Class representing a mapping between attachment points (APs).
An attachment point (AP) is a possibility to attach a Vertex onto the vertex holding the AP (i....
APClass getAPClass()
Returns the Attachment Point class.
boolean isAvailable()
Check availability of this attachment point.
A candidate is the combination of a denoptim graph with molecular representation and may include also...
Container for the list of vertices and the edges that connect them.
List< DGraph > extractPattern(GraphPattern pattern)
Extracts subgraphs that match the provided pattern.
Candidate getCandidateOwner()
Returns the reference of the candidate item that is defined by this graph.
Class representing a continuously connected portion of chemical object holding attachment points.
void addAP(int atomPositionNumber)
Adds an attachment point with a dummy APClass.
void setInnerGraph(DGraph innerGraph)
void setIAtomContainer(IAtomContainer mol, boolean updateAPsAccordingToIAC)
Attaches a molecular representation to this template.
A vertex is a data structure that has an identity and holds a list of AttachmentPoints.
abstract Vertex clone()
Returns a deep-copy of this vertex.
int getBuildingBlockId()
Returns the index of the building block that should correspond to the position of the building block ...
ArrayList< APClass > getAllAPClasses()
Returns the list of all APClasses present on this vertex.
void setVertexId(long vertexId2)
void setAsRCV(boolean isRCV)
abstract List< AttachmentPoint > getAttachmentPoints()
void setBuildingBlockId(int buildingBlockId)
void setBuildingBlockType(Vertex.BBType buildingBlockType)
static Vertex newVertexFromLibrary(int bbId, Vertex.BBType bbt, FragmentSpace fragSpace)
Builds a new molecular fragment kind of vertex.
The RingClosingAttractor represent the available valence/connection that allows to close a ring.
static final HashMap< APClass, String > RCALABELPERAPCLASS
Conventional labels for attractor pseudoatom.
Utility methods for input/output.
static void readRCCompatibilityMatrix(String fileName, HashMap< APClass, ArrayList< APClass > > rcCompatMap)
Reads the APclass compatibility matrix for ring-closing connections (the RC-CPMap).
static void writeGraphsToJSON(File file, List< DGraph > modGraphs)
Writes the graphs to JSON file.
static void writeSDFFile(String fileName, IAtomContainer mol)
Writes IAtomContainer to SDF file.
static void writeGraphToSDF(File file, DGraph graph, boolean append, boolean make3D, Logger logger, Randomizer randomizer)
Writes the graph to SDF file.
static void readCompatibilityMatrix(String fileName, HashMap< APClass, ArrayList< APClass > > compatMap, HashMap< APClass, APClass > cappingMap, Set< APClass > forbiddenEndList)
Read the APclass compatibility matrix data from file.
static ArrayList< Vertex > readVertexes(File file, Vertex.BBType bbt)
Reads Vertexes from any file that can contain such items.
Logger getLogger()
Get the name of the program specific logger.
Randomizer getRandomizer()
Returns the current program-specific randomizer.
static synchronized long getUniqueVertexIndex()
Unique counter for the number of graph vertices generated.
Utilities for molecule conversion.
static IAtomContainer extractIACForSubgraph(IAtomContainer wholeIAC, DGraph subGraph, DGraph wholeGraph, Logger logger, Randomizer randomizer)
Selects only the atoms that originate from a subgraph of a whole graph that originated the whole mole...
Tool to generate random numbers and random decisions.
public< T > T randomlyChooseOne(Collection< T > c)
Chooses one member among the given collection.
int nextInt(int i)
Returns a pseudo-random, uniformly distributed int value between 0 (inclusive) and the specified valu...
The type of building block.