$darkmode
DENOPTIM
|
Helper methods for the genetic algorithm. More...
Classes | |
enum | CandidateSource |
A chosen method for generation of new Candidate s. More... | |
Static Public Member Functions | |
static int | chooseNumberOfSitesToMutate (double[] multiSiteMutationProb, double hit) |
Takes a decision on how many sites to mutate on a candidate. More... | |
static CandidateSource | pickNewCandidateGenerationMode (double xoverWeight, double mutWeight, double newWeight, Randomizer randomizer) |
Takes a decision on which CandidateSource method to use for generating a new Candidate . More... | |
static Candidate | buildCandidateByFragmentingMolecule (IAtomContainer mol, Monitor mnt, GAParameters settings, int index) throws DENOPTIMException |
Generates a candidate by fragmenting a molecule and generating the graph that reconnects all fragments to reform the original molecule. More... | |
static DGraph | makeGraphFromFragmentationOfMol (IAtomContainer mol, List< CuttingRule > cuttingRules, Logger logger, ScaffoldingPolicy scaffoldingPolicy) throws DENOPTIMException |
Converts a molecule into a DGraph by fragmentation and re-assembling of the fragments. More... | |
static DGraph | makeGraphFromFragmentationOfMol (IAtomContainer mol, List< CuttingRule > cuttingRules, Logger logger, ScaffoldingPolicy scaffoldingPolicy, double linearAngleLimit) throws DENOPTIMException |
Converts a molecule into a DGraph by fragmentation and re-assembling of the fragments. More... | |
static DGraph | makeGraphFromFragmentationOfMol (IAtomContainer mol, List< CuttingRule > cuttingRules, Logger logger, ScaffoldingPolicy scaffoldingPolicy, FragmentSpace fragSpace) throws DENOPTIMException |
Converts a molecule into a DGraph by fragmentation and re-assembling of the fragments. More... | |
static DGraph | makeGraphFromFragmentationOfMol (IAtomContainer mol, List< CuttingRule > cuttingRules, Logger logger, ScaffoldingPolicy scaffoldingPolicy, double linearAngleLimit, FragmentSpace fragSpace) throws DENOPTIMException |
Converts a molecule into a DGraph by fragmentation and re-assembling of the fragments. More... | |
static void | outputPopulationDetails (Population population, String filename, GAParameters settings, boolean printpathNames) throws DENOPTIMException |
Write out summary for the current GA population. More... | |
static String | getPathNameToGenerationFolder (int genID, GAParameters settings) |
static String | getPathNameToGenerationDetailsFile (int genID, GAParameters settings) |
static String | getPathNameToFinalPopulationFolder (GAParameters settings) |
static String | getPathNameToFinalPopulationDetailsFile (GAParameters settings) |
static double | getGrowthProbabilityAtLevel (int level, int scheme, double lambda, double sigmaOne, double sigmaTwo) |
Calculates the probability of adding a fragment to the given level. More... | |
static double | getMolSizeProbability (DGraph graph, GAParameters settings) |
Calculated the probability of extending a graph based on the current size of the molecular representation contained in the graph and the given parameters. More... | |
static double | getMolSizeProbability (DGraph graph, int scheme, double lambda, double sigmaOne, double sigmaTwo) |
Calculated the probability of extending a graph based on the current size of the molecular representation contained in the graph and the given parameters. More... | |
static double | getProbability (double value, int scheme, double lambda, double sigmaOne, double sigmaTwo) |
Calculated a probability given parameters defining the shape of the probability function and a single input value. More... | |
static double | getGrowthByLevelProbability (int level, GAParameters settings) |
Calculates the probability of adding a fragment to the given level. More... | |
static double | getCrowdingProbability (AttachmentPoint ap, GAParameters settings) |
Calculated the probability of using and attachment point rooted on an atom that is holding other attachment points which have already been used. More... | |
static double | getCrowdingProbability (int crowdedness, GAParameters settings) |
Calculated the probability of using and attachment point rooted on an atom that is holding other attachment points which have already been used. More... | |
static int | getCrowdedness (AttachmentPoint ap) |
Calculate the current crowdedness of the given attachment point. More... | |
static int | getCrowdedness (AttachmentPoint ap, boolean ignoreFreeRCVs) |
Calculate the current crowdedness of the given attachment point. More... | |
static double | getCrowdingProbability (AttachmentPoint ap, int scheme, double lambda, double sigmaOne, double sigmaTwo) |
Calculated the probability of using and attachment point rooted on an atom that is holding other attachment points that have already been used. More... | |
static double | getCrowdingProbabilityForCrowdedness (int crowdedness, int scheme, double lambda, double sigmaOne, double sigmaTwo) |
Calculated the crowding probability for a given level of crowdedness. More... | |
static List< List< RelatedAPPair > > | searchRingFusionSites (DGraph graph, GAParameters gaParams) throws DENOPTIMException |
static List< List< RelatedAPPair > > | searchRingFusionSites (DGraph graph, FragmentSpace fragSpace, RingClosureParameters rcParams, boolean projectOnSymmetricAPs, Logger logger, Randomizer rng) throws DENOPTIMException |
static Boolean | apPairsAreOverlapping (Iterable< RelatedAPPair > pairs) |
Evaluates if any pair of AttachmentPoint pairs involve the same AttachmentPoint , i.e., if there is overlap between any pair of pairs. More... | |
static Boolean | shareAPs (RelatedAPPair pairA, Iterable< RelatedAPPair > lstB) |
Evaluates if a RelatedAPPair involves the same AttachmentPoint present in a collection. More... | |
static List< Vertex > | getUsableAromaticBridges (String elInIncomingFrag, int[] allowedLengths, FragmentSpace fragSpace) |
Finds all vertexes that can be used as aromatic bridge, i.e., can be used to create an aromatic ring by fusion with another aromatic ring. More... | |
static List< Vertex > | getUsableAliphaticBridges (APClass apcA, APClass apcB, int[] allowedLengths, FragmentSpace fragSpace) |
Finds all vertexes that can be used as aliphatic bridge. More... | |
Static Protected Member Functions | |
static void | createFolderForGeneration (int genId, GAParameters settings) |
Creates a folder meant to hold all the data generated during a generation. More... | |
static Population | importInitialPopulation (SizeControlledSet uniqueIDsSet, GAParameters settings) throws DENOPTIMException, IOException |
Reads unique identifiers and initial population file according to the GAParameters . More... | |
static CandidateSource | chooseGenerationMethod (GAParameters settings) |
Choose one of the methods to make new Candidate s. More... | |
static List< Candidate > | buildCandidatesByXOver (List< Candidate > eligibleParents, Population population, Monitor mnt, GAParameters settings) throws DENOPTIMException |
Generates a pair of new offspring by performing a crossover operation. More... | |
static Candidate | buildCandidateByXOver (List< Candidate > eligibleParents, Population population, Monitor mnt, GAParameters settings) throws DENOPTIMException |
Generates a new offspring by performing a crossover operation. More... | |
static Candidate | buildCandidateByXOver (List< Candidate > eligibleParents, Population population, Monitor mnt, int[] choiceOfParents, int choiceOfXOverSites, int choiceOfOffstring, GAParameters settings) throws DENOPTIMException |
Generates a new offspring by performing a crossover operation. More... | |
static List< Candidate > | buildCandidatesByXOver (List< Candidate > eligibleParents, Population population, Monitor mnt, int[] choiceOfParents, int choiceOfXOverSites, int choiceOfOffstring, GAParameters settings, int maxCandidatesToReturn) throws DENOPTIMException |
Generates up to a pair of new offspring by performing a crossover operation. More... | |
static Candidate | buildCandidateByMutation (List< Candidate > eligibleParents, Monitor mnt, GAParameters settings) throws DENOPTIMException |
static Candidate | readCandidateFromFile (File srcFile, Monitor mnt, GAParameters settings) throws DENOPTIMException |
static Candidate | buildCandidateFromScratch (Monitor mnt, GAParameters settings) throws DENOPTIMException |
static Candidate[] | selectBasedOnFitness (List< Candidate > eligibleParents, int number, GAParameters settings) |
Selects a number of members from the given population. More... | |
static Vertex | selectNonScaffoldNonCapVertex (DGraph g, Randomizer randomizer) |
Chose randomly a vertex that is neither scaffold or capping group. More... | |
static XoverSite | performFBCC (List< Candidate > eligibleParents, Population population, int[] choiceOfParents, int choiceOfXOverSites, GAParameters settings) |
Perform fitness-based, class-compatible selection of parents that can do crossover operations. More... | |
static void | outputFinalResults (Population popln, GAParameters settings) throws DENOPTIMException |
Saves the final results to disk. More... | |
static void | getPopulationFromFile (String filename, Population population, SizeControlledSet uniqueIDsSet, String genDir, GAParameters settings) throws DENOPTIMException, IOException |
Reconstruct the molecular population from the file. More... | |
static void | writeUID (String outfile, HashSet< String > lstInchi, boolean append) throws DENOPTIMException |
static void | setVertexCounterValue (Population population) throws DENOPTIMException |
Set the Vertex counter value according to the largest value found in the given population. More... | |
static DGraph | buildGraph (GAParameters settings) throws DENOPTIMException |
Graph construction starts with selecting a random core/scaffold. More... | |
static boolean | setupRings (Object[] res, DGraph molGraph, GAParameters settings) throws DENOPTIMException |
Evaluates the possibility of closing rings in a given graph and if any ring can be closed, it chooses one of the combinations of ring closures that involves the highest number of new rings. More... | |
static boolean | containsMolecule (Population mols, String molcode) |
Check if the population contains the specified InChi code. More... | |
static double[] | getFitnesses (Population mols) |
Get the fitness values for the list of molecules. More... | |
static double | getPopulationSD (Population molPopulation) |
Check if fitness values have significant standard deviation. More... | |
static boolean | foundForbiddenEnd (DGraph molGraph, FragmentSpaceParameters fsParams) |
Check if there are forbidden ends: free attachment points that are not suitable for capping and not allowed to stay unused. More... | |
static void | readUID (String infile, HashSet< String > lstInchi) throws DENOPTIMException |
Static Protected Attributes | |
static HashMap< Integer, ArrayList< Integer > > | fragmentPool |
static HashMap< Integer, ArrayList< String > > | lstFragmentClass |
Static Private Member Functions | |
static DecimalFormat | initialiseFormatter () |
static void | appendVertexesToGraphFollowingEdges (DGraph graph, AtomicInteger vId, List< Vertex > vertexes) throws DENOPTIMException |
static String | getSummaryStatistics (Population popln, GAParameters settings) |
static List< List< RelatedAPPair > > | combineRelatedAPPair (List< RelatedAPPair > pool, int k, int limit) |
static void | combineRelatedAPPairUtil (List< RelatedAPPair > pool, int left, int k, List< RelatedAPPair > tmp, List< List< RelatedAPPair > > allCombs, int limit) |
static void | storePairsSymmetricRelations (RelatedAPPair pair, SymmetricAPs symAPs, Map< SymmetricSetWithMode, List< RelatedAPPair > > storage) |
static boolean | canBeUsedForRingFusion (AttachmentPoint ap, Set< Long > originalVertexIDs, FragmentSpace fs) |
Decides if an AttachmentPoint can be considered for making a ring fusion operation, i.e., attach a bridge on one AP and use another AP to close a ring. More... | |
Static Private Attributes | |
static Locale | enUsLocale = new Locale("en", "US") |
Locale used to write reports. More... | |
static DecimalFormat | df = initialiseFormatter() |
Format for decimal fitness numbers that overwrites Locale to en_US. More... | |
static final String | NL =System.getProperty("line.separator") |
static final String | FSEP = System.getProperty("file.separator") |
Helper methods for the genetic algorithm.
Definition at line 106 of file EAUtils.java.
|
static |
Evaluates if any pair of AttachmentPoint
pairs involve the same AttachmentPoint
, i.e., if there is overlap between any pair of pairs.
pairs | the collection of pairs to evaluate for overlap. |
true
if there is any AttachmentPoint
that is present in more than one pair visited by the iterations. Definition at line 2905 of file EAUtils.java.
Referenced by denoptim.ga.EAUtils.combineRelatedAPPairUtil().
|
staticprivate |
Definition at line 1248 of file EAUtils.java.
References denoptim.graph.Edge.BondType.ANY, denoptim.ga.EAUtils.appendVertexesToGraphFollowingEdges(), denoptim.graph.APClass.ATPLUS, denoptim.graph.Vertex.BBType.FRAGMENT, denoptim.graph.Vertex.getAP(), denoptim.graph.Vertex.getAttachmentPoints(), denoptim.fragmenter.FragmenterTools.getRCPForAP(), denoptim.graph.Vertex.isRCV, denoptim.graph.APClass.make(), denoptim.graph.APClass.RCACLASSMINUS, denoptim.graph.Vertex.setBuildingBlockType(), and denoptim.graph.Vertex.setVertexId().
Referenced by denoptim.ga.EAUtils.appendVertexesToGraphFollowingEdges(), and denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol().
|
static |
Generates a candidate by fragmenting a molecule and generating the graph that reconnects all fragments to reform the original molecule.
Essentially, it converts an IAtomContainer
into a DGraph
and makes a Candidate
out of it.
mol | the molecule to convert. |
cutRules | the cutting rules to use in the fragmentation. |
mnt | the tool monitoring events for logging purposes. |
settings | GA settings. |
index | identifies the given IAtomContainer in a collection of systems to work on. This is used only for logging. |
DENOPTIMException |
Definition at line 943 of file EAUtils.java.
References denoptim.graph.DGraph.checkConsistency(), denoptim.graph.DGraph.cleanup(), denoptim.logging.CounterID.CONVERTBYFRAGATTEMPTS, denoptim.graph.DGraph.embedPatternsInTemplates(), denoptim.programs.fragmenter.FragmenterParameters.embedRingsInTemplate, denoptim.logging.CounterID.FAILEDCONVERTBYFRAGATTEMPTS, denoptim.logging.CounterID.FAILEDCONVERTBYFRAGATTEMPTS_EVAL, denoptim.logging.CounterID.FAILEDCONVERTBYFRAGATTEMPTS_FRAGMENTATION, denoptim.logging.CounterID.FAILEDCONVERTBYFRAGATTEMPTS_TMPLEMBEDDING, denoptim.programs.RunTimeParameters.ParametersType.FRG_PARAMS, denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.programs.fragmenter.FragmenterParameters.getCuttingRules(), denoptim.programs.fragmenter.FragmenterParameters.getEmbeddedRingsContract(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.programs.fragmenter.FragmenterParameters.getLinearAngleLimit(), denoptim.utils.GeneralUtils.getPaddedString(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.programs.fragmenter.FragmenterParameters.getScaffoldingPolicy(), denoptim.utils.GraphUtils.getUniqueMoleculeIndex(), denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol(), denoptim.constants.DENOPTIMConstants.MOLDIGITS, denoptim.logging.CounterID.NEWCANDIDATEATTEMPTS, denoptim.fragmenter.FragmenterTools.prepareMolToFragmentation(), denoptim.graph.GraphPattern.RING, denoptim.graph.Candidate.setChemicalRepresentation(), denoptim.graph.DGraph.setLocalMsg(), denoptim.graph.Candidate.setName(), denoptim.graph.Candidate.setSmiles(), and denoptim.graph.Candidate.setUID().
Referenced by denoptim.ga.EvolutionaryAlgorithm.initializePopulation().
|
staticprotected |
Definition at line 645 of file EAUtils.java.
References denoptim.graph.DGraph.addCappingGroups(), denoptim.graph.DGraph.checkConsistency(), denoptim.graph.DGraph.cleanup(), denoptim.graph.DGraph.clone(), denoptim.logging.CounterID.FAILEDMUTATTEMTS, denoptim.logging.CounterID.FAILEDMUTATTEMTS_EVAL, denoptim.logging.CounterID.FAILEDMUTATTEMTS_FORBENDS, denoptim.logging.CounterID.FAILEDMUTATTEMTS_PERFORM, denoptim.logging.CounterID.FAILEDMUTATTEMTS_SETUPRINGS, denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.fragspace.FragmentSpace.getCappingMap(), denoptim.fragspace.FragmentSpace.getForbiddenEndList(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.graph.DGraph.getFreeRCVertices(), denoptim.graph.Candidate.getGeneration(), denoptim.graph.Candidate.getGraph(), denoptim.graph.DGraph.getGraphId(), denoptim.graph.DGraph.getLocalMsg(), denoptim.utils.GeneralUtils.getPaddedString(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.graph.Candidate.getSDFFile(), denoptim.utils.GraphUtils.getUniqueGraphIndex(), denoptim.utils.GraphUtils.getUniqueMoleculeIndex(), denoptim.constants.DENOPTIMConstants.MOLDIGITS, denoptim.logging.CounterID.MUTATTEMPTS, denoptim.logging.CounterID.MUTPARENTSEARCH, denoptim.logging.CounterID.NEWCANDIDATEATTEMPTS, denoptim.ga.GraphOperations.performMutation(), denoptim.graph.DGraph.renumberGraphVertices(), denoptim.ga.EAUtils.selectBasedOnFitness(), denoptim.graph.Candidate.setChemicalRepresentation(), denoptim.graph.DGraph.setGraphId(), denoptim.graph.DGraph.setLocalMsg(), denoptim.graph.Candidate.setName(), denoptim.graph.Candidate.setSmiles(), denoptim.graph.Candidate.setUID(), denoptim.ga.EAUtils.setupRings(), and denoptim.io.DenoptimIO.writeGraphToSDF().
Referenced by denoptim.ga.EvolutionaryAlgorithm.makeOffspringA(), and denoptim.ga.EvolutionaryAlgorithm.makeOffspringB().
|
staticprotected |
Generates a new offspring by performing a crossover operation.
eligibleParents | candidates that can be used as parents of the offspring. |
population | the collection of candidates where eligible candidates are hosted. |
mnt | monitoring tool used to record events during the run of the evolutionary algorithm. |
Definition at line 313 of file EAUtils.java.
References denoptim.ga.EAUtils.buildCandidateByXOver().
Referenced by denoptim.ga.EAUtils.buildCandidateByXOver(), denoptim.ga.EAUtilsTest.testAvoidRedundantXOver(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FixedStructure(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_Free(), denoptim.ga.EAUtilsTest.testBuildByXOver_Embedded_FreeBackwards(), and denoptim.ga.EAUtilsTest.testBuildByXOver_SubGraph().
|
staticprotected |
Generates a new offspring by performing a crossover operation.
eligibleParents | candidates that can be used as parents of the offspring. |
population | the collection of candidates where eligible candidates are hosted. |
mnt | monitoring tool used to record events during the run of the evolutionary algorithm. |
choiceOfParents | a pair of indexes dictating which ones among the eligible parents we should use as parents. This avoids randomized decision making in case of test that need to be reproducible, but can be null which means "use random choice". |
choiceOfXOverSites | index indicating which crossover site to use. This avoids randomized decision making in case of test that need to be reproducible, but can be null which means "use random choice". |
choiceOfOffstring | index dictating which among the available two offspring (at most two, for now) is returned as result. This avoids randomized decision making in case of test that need to be reproducible, but can be null which means "use random choice". |
DENOPTIMException |
Definition at line 347 of file EAUtils.java.
References denoptim.ga.EAUtils.buildCandidatesByXOver().
|
staticprotected |
Definition at line 842 of file EAUtils.java.
References denoptim.logging.CounterID.BUILDANEWATTEMPTS, denoptim.ga.EAUtils.buildGraph(), denoptim.graph.DGraph.checkConsistency(), denoptim.graph.DGraph.cleanup(), denoptim.logging.CounterID.FAILEDBUILDATTEMPTS, denoptim.logging.CounterID.FAILEDBUILDATTEMPTS_EVAL, denoptim.logging.CounterID.FAILEDBUILDATTEMPTS_FORBIDENDS, denoptim.logging.CounterID.FAILEDBUILDATTEMPTS_GRAPHBUILD, denoptim.logging.CounterID.FAILEDBUILDATTEMPTS_SETUPRINGS, denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.fragspace.FragmentSpace.getCappingMap(), denoptim.fragspace.FragmentSpace.getForbiddenEndList(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.graph.DGraph.getFreeRCVertices(), denoptim.utils.GeneralUtils.getPaddedString(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.utils.GraphUtils.getUniqueMoleculeIndex(), denoptim.constants.DENOPTIMConstants.MOLDIGITS, denoptim.logging.CounterID.NEWCANDIDATEATTEMPTS, denoptim.graph.Candidate.setChemicalRepresentation(), denoptim.graph.DGraph.setLocalMsg(), denoptim.graph.Candidate.setName(), denoptim.graph.Candidate.setSmiles(), denoptim.graph.Candidate.setUID(), and denoptim.ga.EAUtils.setupRings().
Referenced by denoptim.ga.EvolutionaryAlgorithm.initializePopulation(), denoptim.ga.EvolutionaryAlgorithm.makeOffspringA(), and denoptim.ga.EvolutionaryAlgorithm.makeOffspringB().
|
staticprotected |
Generates a pair of new offspring by performing a crossover operation.
eligibleParents | candidates that can be used as parents of the offspring. |
population | the collection of candidates where eligible candidates are hosted. |
mnt | monitoring tool used to record events during the run of the evolutionary algorithm. |
settings | the settings of the genetic algorithm. |
Definition at line 293 of file EAUtils.java.
References denoptim.ga.EAUtils.buildCandidatesByXOver().
Referenced by denoptim.ga.EAUtils.buildCandidateByXOver(), denoptim.ga.EAUtils.buildCandidatesByXOver(), denoptim.ga.EvolutionaryAlgorithm.makeOffspringA(), and denoptim.ga.EvolutionaryAlgorithm.makeOffspringB().
|
staticprotected |
Generates up to a pair of new offspring by performing a crossover operation.
eligibleParents | candidates that can be used as parents of the offspring. |
population | the collection of candidates where eligible candidates are hosted. |
mnt | monitoring tool used to record events during the run of the evolutionary algorithm. |
choiceOfParents | a pair of indexes dictating which ones among the eligible parents we should use as parents. This avoids randomized decision making in case of test that need to be reproducible, but can be null which means "use random choice". |
choiceOfXOverSites | index indicating which crossover site to use. This avoids randomized decision making in case of test that need to be reproducible, but can be null which means "use random choice". |
choiceOfOffstring | index dictating which among the available two offspring (at most two, for now) is returned as result. This avoids randomized decision making in case of test that need to be reproducible, but can be null which means "use random choice". |
maxCandidatesToReturn | the number of offspring to return in the list. Up to 2. |
DENOPTIMException |
Definition at line 392 of file EAUtils.java.
References denoptim.graph.DGraph.addCappingGroups(), denoptim.graph.DGraph.checkConsistency(), denoptim.graph.DGraph.cleanup(), denoptim.logging.CounterID.FAILEDXOVERATTEMPTS, denoptim.logging.CounterID.FAILEDXOVERATTEMPTS_EVAL, denoptim.logging.CounterID.FAILEDXOVERATTEMPTS_FINDPARENTS, denoptim.logging.CounterID.FAILEDXOVERATTEMPTS_FORBENDS, denoptim.logging.CounterID.FAILEDXOVERATTEMPTS_PERFORM, denoptim.logging.CounterID.FAILEDXOVERATTEMPTS_SETUPRINGS, denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.ga.XoverSite.getA(), denoptim.ga.XoverSite.getB(), denoptim.graph.DGraph.getCandidateOwner(), denoptim.fragspace.FragmentSpace.getCappingMap(), denoptim.graph.DGraph.getChildrenTree(), denoptim.fragspace.FragmentSpace.getForbiddenEndList(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.graph.DGraph.getFreeRCVertices(), denoptim.graph.Candidate.getGeneration(), denoptim.graph.Candidate.getGraph(), denoptim.graph.DGraph.getGraphId(), denoptim.graph.Vertex.getGraphOwner(), denoptim.graph.Candidate.getName(), denoptim.graph.DGraph.getOutermostGraphOwner(), denoptim.utils.GeneralUtils.getPaddedString(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.utils.GraphUtils.getUniqueGraphIndex(), denoptim.utils.GraphUtils.getUniqueMoleculeIndex(), denoptim.constants.DENOPTIMConstants.MOLDIGITS, denoptim.logging.CounterID.NEWCANDIDATEATTEMPTS, denoptim.ga.EAUtils.NL, denoptim.ga.GraphOperations.performCrossover(), denoptim.ga.EAUtils.performFBCC(), denoptim.ga.XoverSite.projectToClonedGraphs(), denoptim.graph.DGraph.renumberGraphVertices(), denoptim.ga.EAUtils.selectBasedOnFitness(), denoptim.ga.EAUtils.selectNonScaffoldNonCapVertex(), denoptim.graph.Candidate.setChemicalRepresentation(), denoptim.graph.DGraph.setGraphId(), denoptim.graph.DGraph.setLocalMsg(), denoptim.graph.Candidate.setName(), denoptim.graph.Candidate.setSmiles(), denoptim.graph.Candidate.setUID(), denoptim.ga.EAUtils.setupRings(), denoptim.ga.XoverSite.toString(), denoptim.fragspace.FragmentSpace.useAPclassBasedApproach(), denoptim.io.DenoptimIO.writeGraphsToSDF(), denoptim.logging.CounterID.XOVERATTEMPTS, and denoptim.logging.CounterID.XOVERPARENTSEARCH.
|
staticprotected |
Graph construction starts with selecting a random core/scaffold.
DENOPTIMException |
Definition at line 1803 of file EAUtils.java.
References denoptim.graph.DGraph.addCappingGroups(), denoptim.graph.DGraph.addVertex(), denoptim.graph.DGraph.containsOrEmbedsVertex(), denoptim.ga.GraphOperations.extendGraph(), denoptim.logging.CounterID.FAILEDMUTATTEMTS, denoptim.logging.CounterID.FAILEDMUTATTEMTS_PERFORM, denoptim.graph.Template.ContractLevel.FIXED, denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.graph.Vertex.getBuildingBlockId(), denoptim.graph.rings.RingClosuresArchive.getCCFromTurningPointId(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.graph.DGraph.getMutableSites(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.graph.rings.RingClosureParameters.getRingClosuresArchive(), denoptim.utils.GraphUtils.getUniqueGraphIndex(), denoptim.graph.DGraph.getVertexCount(), denoptim.graph.Vertex.hasFreeAP(), denoptim.logging.Monitor.increase(), denoptim.fragspace.FragmentSpace.makeRandomScaffold(), denoptim.ga.GraphOperations.performMutation(), denoptim.programs.RunTimeParameters.ParametersType.RC_PARAMS, denoptim.graph.DGraph.setCandidateClosableChains(), denoptim.graph.DGraph.setGraphId(), and denoptim.graph.DGraph.setLocalMsg().
Referenced by denoptim.ga.EAUtils.buildCandidateFromScratch(), and denoptim.ga.EAUtilsTest.testBuildGraphFromTemplateScaffold().
|
staticprivate |
Decides if an AttachmentPoint
can be considered for making a ring fusion operation, i.e., attach a bridge on one AP and use another AP to close a ring.
The condition to return true
is that both these are satisfied:
APClass
of the AP allows ring closure, i.e., it is present in the ring-closing compatibility matrix. ap | the attachment point we want to analyze. Note this is NOT the actual AP in the graph, but a copy of it that is stored in the IAtom properties! |
originalVertexIDs | list of ID defining which vertex is from the original graph. This is used to explode any vertex that has been added on the graph to saturate valences. |
fs | the fragment space containing the ring-closures compatibility matrix. |
Definition at line 2967 of file EAUtils.java.
References denoptim.graph.AttachmentPoint.getAPClass(), denoptim.graph.AttachmentPoint.getLinkedAPThroughout(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.fragspace.FragmentSpace.getRCCompatibilityMatrix(), denoptim.graph.Vertex.getVertexId(), and denoptim.graph.AttachmentPoint.isAvailableThroughout().
Referenced by denoptim.ga.EAUtils.searchRingFusionSites().
|
staticprotected |
Choose one of the methods to make new Candidate
s.
The choice is biased by the weights of the methods as defined in the GAParameters
.
the | genetic algorithm settings |
CandidateSource
excluding {@value CandidateSource::MANUAL}. Definition at line 207 of file EAUtils.java.
References denoptim.programs.denovo.GAParameters.getConstructionWeight(), denoptim.programs.denovo.GAParameters.getCrossoverWeight(), denoptim.programs.denovo.GAParameters.getMutationWeight(), denoptim.programs.RunTimeParameters.getRandomizer(), and denoptim.ga.EAUtils.pickNewCandidateGenerationMode().
Referenced by denoptim.ga.EvolutionaryAlgorithm.makeOffspringA().
|
static |
Takes a decision on how many sites to mutate on a candidate.
multiSiteMutationProb | the probability (0-1) of multi-site mutation. |
hit | a random real number between 0 and 1. |
Definition at line 224 of file EAUtils.java.
Referenced by denoptim.ga.GraphOperations.performMutation(), and denoptim.ga.EAUtilsTest.testChooseNumberOfSitesToMutate().
|
staticprivate |
Definition at line 2833 of file EAUtils.java.
References denoptim.ga.EAUtils.combineRelatedAPPairUtil().
Referenced by denoptim.ga.EAUtils.searchRingFusionSites().
|
staticprivate |
Definition at line 2844 of file EAUtils.java.
References denoptim.ga.EAUtils.apPairsAreOverlapping(), denoptim.ga.EAUtils.combineRelatedAPPairUtil(), and denoptim.ga.EAUtils.shareAPs().
Referenced by denoptim.ga.EAUtils.combineRelatedAPPair(), and denoptim.ga.EAUtils.combineRelatedAPPairUtil().
|
staticprotected |
Check if the population contains the specified InChi code.
mols | |
molcode |
true
if found Definition at line 2070 of file EAUtils.java.
|
staticprotected |
Creates a folder meant to hold all the data generated during a generation.
The folder is created under the work space.
genId | the generation's identity number |
DENOPTIMException |
Definition at line 148 of file EAUtils.java.
References denoptim.ga.EAUtils.getPathNameToGenerationFolder().
Referenced by denoptim.ga.EvolutionaryAlgorithm.evolvePopulation(), and denoptim.ga.EvolutionaryAlgorithm.run().
|
staticprotected |
Check if there are forbidden ends: free attachment points that are not suitable for capping and not allowed to stay unused.
molGraph | the Graph representation of the molecule |
true
if a forbidden end is found Definition at line 2399 of file EAUtils.java.
References denoptim.fragspace.FragmentSpace.getForbiddenEndList(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.programs.RunTimeParameters.getLogger(), and denoptim.graph.DGraph.getVertexList().
|
static |
Calculate the current crowdedness of the given attachment point.
ap | the attachment point to consider |
Definition at line 2299 of file EAUtils.java.
References denoptim.ga.EAUtils.getCrowdedness().
Referenced by denoptim.ga.GraphOperations.extendGraph(), denoptim.ga.EAUtils.getCrowdedness(), denoptim.ga.EAUtils.getCrowdingProbability(), and denoptim.ga.EAUtils.setupRings().
|
static |
Calculate the current crowdedness of the given attachment point.
ap | the attachment point to consider |
ignoreFreeRCVs | use true to avoid counting unused ring-closing vertexes and actual connections. |
EmptyVertex
s. Definition at line 2315 of file EAUtils.java.
References denoptim.graph.Vertex.BBType.CAP, denoptim.graph.AttachmentPoint.getAtomPositionNumber(), denoptim.graph.Vertex.getAttachmentPoints(), denoptim.graph.Vertex.getGraphOwner(), denoptim.graph.AttachmentPoint.getOwner(), and denoptim.graph.DGraph.getUsedRCVertices().
|
static |
Calculated the probability of using and attachment point rooted on an atom that is holding other attachment points which have already been used.
ap | the attachment point candidate to be used. |
Definition at line 2254 of file EAUtils.java.
References denoptim.programs.denovo.GAParameters.getCrowdingFactorMiddleSigma(), denoptim.programs.denovo.GAParameters.getCrowdingFactorSteepSigma(), denoptim.programs.denovo.GAParameters.getCrowdingMultiplier(), denoptim.ga.EAUtils.getCrowdingProbability(), and denoptim.programs.denovo.GAParameters.getCrowdingProbabilityScheme().
Referenced by denoptim.ga.GraphOperations.extendGraph(), denoptim.ga.EAUtils.getCrowdingProbability(), denoptim.ga.EAUtils.setupRings(), and denoptim.ga.EAUtilsTest.testCrowdingProbability().
|
static |
Calculated the probability of using and attachment point rooted on an atom that is holding other attachment points that have already been used.
ap | the attachment point candidate to be used. |
scheme | the chosen shape of the probability function. |
lambda | parameter used by scheme 0 and 1 |
sigmaOne | parameter used by scheme 2 (steepness) |
sigmaTwo | parameter used by scheme 2 (middle point) |
Definition at line 2357 of file EAUtils.java.
References denoptim.ga.EAUtils.getCrowdedness(), denoptim.ga.EAUtils.getCrowdingProbabilityForCrowdedness(), and denoptim.graph.AttachmentPoint.getOwner().
|
static |
Calculated the probability of using and attachment point rooted on an atom that is holding other attachment points which have already been used.
This method does not use the actual information on attachment point usage, but relies on a externally calculated values of the crowdedness. Use EAUtils#getCrowdingProbability(AttachmentPoint)
to get the crowding probability for an actual attachment point. Use EAUtils#getCrowdedness(AttachmentPoint)
to calculate the crowdedness for an attachment point.
crowdedness | the level of crowdedness |
Definition at line 2279 of file EAUtils.java.
References denoptim.programs.denovo.GAParameters.getCrowdingFactorMiddleSigma(), denoptim.programs.denovo.GAParameters.getCrowdingFactorSteepSigma(), denoptim.programs.denovo.GAParameters.getCrowdingMultiplier(), denoptim.ga.EAUtils.getCrowdingProbabilityForCrowdedness(), and denoptim.programs.denovo.GAParameters.getCrowdingProbabilityScheme().
|
static |
Calculated the crowding probability for a given level of crowdedness.
crowdedness | the level of crowdedness |
scheme | the chosen shape of the probability function. |
lambda | parameter used by scheme 0 and 1 |
sigmaOne | parameter used by scheme 2 (steepness) |
sigmaTwo | parameter used by scheme 2 (middle point) |
Definition at line 2382 of file EAUtils.java.
References denoptim.ga.EAUtils.getProbability().
Referenced by denoptim.gui.GAParametersForm.createCrowdProbDataset(), and denoptim.ga.EAUtils.getCrowdingProbability().
|
staticprotected |
Get the fitness values for the list of molecules.
mols |
Definition at line 2093 of file EAUtils.java.
Referenced by denoptim.ga.EAUtils.getPopulationSD(), and denoptim.ga.EAUtils.getSummaryStatistics().
|
static |
Calculates the probability of adding a fragment to the given level.
Used the settings defined by the GAParameters class.
level | level of the graph at which fragment is to be added |
Definition at line 2231 of file EAUtils.java.
References denoptim.programs.denovo.GAParameters.getGrowthFactorMiddleSigma(), denoptim.programs.denovo.GAParameters.getGrowthFactorSteepSigma(), denoptim.programs.denovo.GAParameters.getGrowthMultiplier(), denoptim.ga.EAUtils.getGrowthProbabilityAtLevel(), denoptim.programs.denovo.GAParameters.getGrowthProbabilityScheme(), and denoptim.programs.denovo.GAParameters.useLevelBasedProb.
Referenced by denoptim.ga.GraphOperations.extendGraph().
|
static |
Calculates the probability of adding a fragment to the given level.
This will require a coin toss with the calculated probability. If a newly drawn random number is less than this value, a new fragment may be added.
level | level of the graph at which fragment is to be added |
scheme | the chosen scheme. |
lambda | parameter used by scheme 0 and 1. |
sigmaOne | parameter used by scheme 2 (steepness). |
sigmaTwo | parameter used by scheme 2 (middle point). |
Definition at line 2134 of file EAUtils.java.
References denoptim.ga.EAUtils.getProbability().
Referenced by denoptim.gui.GAParametersForm.createLvlProbDataset(), and denoptim.ga.EAUtils.getGrowthByLevelProbability().
|
static |
Calculated the probability of extending a graph based on the current size of the molecular representation contained in the graph and the given parameters.
graph | the current graph for which to calculate the probability of extension. |
scheme | the chosen shape of the probability function. |
lambda | parameter used by scheme 0 and 1 |
sigmaOne | parameter used by scheme 2 (steepness) |
sigmaTwo | parameter used by scheme 2 (middle point) |
Definition at line 2154 of file EAUtils.java.
References denoptim.programs.denovo.GAParameters.getMolGrowthFactorMiddleSigma(), denoptim.programs.denovo.GAParameters.getMolGrowthFactorSteepSigma(), denoptim.programs.denovo.GAParameters.getMolGrowthMultiplier(), denoptim.programs.denovo.GAParameters.getMolGrowthProbabilityScheme(), denoptim.ga.EAUtils.getMolSizeProbability(), and denoptim.programs.denovo.GAParameters.useMolSizeBasedProb.
Referenced by denoptim.ga.GraphOperations.extendGraph(), and denoptim.ga.EAUtils.getMolSizeProbability().
|
static |
Calculated the probability of extending a graph based on the current size of the molecular representation contained in the graph and the given parameters.
graph | the current graph for which to calculate the probability of extension. |
scheme | the chosen shape of the probability function. |
lambda | parameter used by scheme 0 and 1 |
sigmaOne | parameter used by scheme 2 (steepness) |
sigmaTwo | parameter used by scheme 2 (middle point) |
Definition at line 2180 of file EAUtils.java.
References denoptim.graph.DGraph.getHeavyAtomsCount(), and denoptim.ga.EAUtils.getProbability().
|
static |
Definition at line 1613 of file EAUtils.java.
References denoptim.ga.EAUtils.FSEP, and denoptim.programs.denovo.GAParameters.getDataDirectory().
Referenced by denoptim.ga.EAUtils.outputFinalResults().
|
static |
Definition at line 1604 of file EAUtils.java.
References denoptim.ga.EAUtils.FSEP, and denoptim.programs.denovo.GAParameters.getDataDirectory().
Referenced by denoptim.ga.EAUtils.outputFinalResults().
|
static |
Definition at line 1584 of file EAUtils.java.
References denoptim.ga.EAUtils.FSEP, denoptim.constants.DENOPTIMConstants.GAGENDIRNAMEROOT, denoptim.programs.denovo.GAParameters.getDataDirectory(), denoptim.programs.denovo.GAParameters.getNumberOfGenerations(), and denoptim.utils.GeneralUtils.getPaddedString().
Referenced by denoptim.ga.EvolutionaryAlgorithm.run(), and denoptim.io.DenoptimIOTest.testReadGenerationFromSummary().
|
static |
Definition at line 1568 of file EAUtils.java.
References denoptim.ga.EAUtils.FSEP, denoptim.constants.DENOPTIMConstants.GAGENDIRNAMEROOT, denoptim.programs.denovo.GAParameters.getDataDirectory(), denoptim.programs.denovo.GAParameters.getNumberOfGenerations(), and denoptim.utils.GeneralUtils.getPaddedString().
Referenced by denoptim.ga.EAUtils.createFolderForGeneration(), denoptim.ga.EvolutionaryAlgorithm.evolvePopulation(), denoptim.ga.EAUtils.importInitialPopulation(), denoptim.ga.EvolutionaryAlgorithm.processInitialPopCandidate(), and denoptim.io.DenoptimIOTest.testReadGenerationFromSummary().
|
staticprotected |
Reconstruct the molecular population from the file.
filename | the pathname to read in. |
population | the collection of population members. |
uniqueIDsSet | collection of unique identifiers. |
DENOPTIMException | |
IOException |
Definition at line 1692 of file EAUtils.java.
References denoptim.constants.DENOPTIMConstants.FITFILENAMEEXTOUT, denoptim.utils.GeneralUtils.getPaddedString(), denoptim.utils.GraphUtils.getUniqueGraphIndex(), denoptim.utils.GraphUtils.getUniqueMoleculeIndex(), denoptim.io.DenoptimIO.readCandidates(), denoptim.ga.EAUtils.setVertexCounterValue(), and denoptim.io.DenoptimIO.writeCandidateToFile().
Referenced by denoptim.ga.EAUtils.importInitialPopulation().
|
staticprotected |
Check if fitness values have significant standard deviation.
molPopulation |
true
if population standard deviation of fitness values exceeds 0.0001 Definition at line 2114 of file EAUtils.java.
References denoptim.ga.EAUtils.getFitnesses(), and denoptim.utils.StatUtils.stddev().
Referenced by denoptim.ga.EvolutionaryAlgorithm.run().
|
static |
Calculated a probability given parameters defining the shape of the probability function and a single input value.
value | the value x for which we calculate f(x). |
scheme | the chosen shape of the probability function. |
lambda | parameter used by scheme 0 and 1 |
sigmaOne | parameter used by scheme 2 (steepness) |
sigmaTwo | parameter used by scheme 2 (middle point) |
Definition at line 2199 of file EAUtils.java.
Referenced by denoptim.gui.GAParametersForm.createMolSizeProbDataset(), denoptim.ga.EAUtils.getCrowdingProbabilityForCrowdedness(), denoptim.ga.EAUtils.getGrowthProbabilityAtLevel(), and denoptim.ga.EAUtils.getMolSizeProbability().
|
staticprivate |
Definition at line 1383 of file EAUtils.java.
References denoptim.ga.EAUtils.df, denoptim.ga.EAUtils.getFitnesses(), denoptim.programs.denovo.GAParameters.getPrecisionLevel(), denoptim.utils.StatUtils.max(), denoptim.utils.StatUtils.mean(), denoptim.utils.StatUtils.median(), denoptim.utils.StatUtils.min(), denoptim.ga.EAUtils.NL, denoptim.utils.StatUtils.skewness(), and denoptim.utils.StatUtils.stddev().
Referenced by denoptim.ga.EAUtils.outputPopulationDetails().
|
static |
Finds all vertexes that can be used as aliphatic bridge.
apcA | class of one of the AP to be used to attach the bridge. |
apcB | class of the other AP to be used to attach the bridge. |
allowedLengths | list of allowed lengths in number of atoms. |
fragSpace | the fragment space where to look for fragments. |
Vertex
property DENOPTIMConstants#VRTPROPBRIDGELENGH
. Definition at line 3038 of file EAUtils.java.
References denoptim.graph.Vertex.clone(), denoptim.fragspace.FragmentSpace.getCompatibleAPClasses(), denoptim.fragspace.FragmentSpace.getVerticesWithAPFingerprint(), denoptim.graph.Vertex.setProperty(), denoptim.constants.DENOPTIMConstants.VRTPROPBRIDGEEND_A, denoptim.constants.DENOPTIMConstants.VRTPROPBRIDGEEND_B, and denoptim.constants.DENOPTIMConstants.VRTPROPBRIDGELENGTH.
Referenced by denoptim.ga.GraphOperations.addFusedRing(), and denoptim.ga.EAUtilsTest.testGetUsableAliphaticBridges().
|
static |
Finds all vertexes that can be used as aromatic bridge, i.e., can be used to create an aromatic ring by fusion with another aromatic ring.
elInIncomingFrag | beginning of the APClass required on the aromatic bridge fragment. This is conventionally used to define the number of electrons available to the aromatic system. |
allowedBridgeLength | number of atoms. |
fragSpace | the fragment space where to look for fragments. |
Vertex
property DENOPTIMConstants#VRTPROPBRIDGELENGH
. Definition at line 2994 of file EAUtils.java.
References denoptim.graph.Vertex.clone(), denoptim.fragspace.FragmentSpace.getVerticesWithAPClassStartingWith(), denoptim.graph.Vertex.setProperty(), and denoptim.constants.DENOPTIMConstants.VRTPROPBRIDGELENGTH.
Referenced by denoptim.ga.GraphOperations.addFusedRing(), and denoptim.ga.EAUtilsTest.testGetUsableAromaticBridges().
|
staticprotected |
Reads unique identifiers and initial population file according to the GAParameters
.
IOException |
Definition at line 162 of file EAUtils.java.
References denoptim.ga.EAUtils.getPathNameToGenerationFolder(), denoptim.ga.EAUtils.getPopulationFromFile(), and denoptim.ga.EAUtils.readUID().
Referenced by denoptim.ga.EvolutionaryAlgorithm.run().
|
staticprivate |
Definition at line 120 of file EAUtils.java.
References denoptim.ga.EAUtils.df, and denoptim.ga.EAUtils.enUsLocale.
|
static |
Converts a molecule into a DGraph
by fragmentation and re-assembling of the fragments.
mol | the molecule to convert |
cuttingRules | the cutting rules defining how to do fragmentation. |
logger | tool managing log. |
scaffoldingPolicy | the policy for deciding which vertex should be given the role of scaffold. |
DENOPTIMException |
Definition at line 1044 of file EAUtils.java.
References denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol().
Referenced by denoptim.gui.GUIGraphHandler.appendGraphsFromConvertingMolecule(), denoptim.ga.EAUtils.buildCandidateByFragmentingMolecule(), denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol(), denoptim.programs.mol2graph.Mol2Graph.runProgram(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_cappingGroups(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_linearities(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_ScaffoldingPolicy(), denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_Symmetry(), and denoptim.ga.EAUtilsTest.testMakeGraphFromFragmentationOfMol_symmetry().
|
static |
Converts a molecule into a DGraph
by fragmentation and re-assembling of the fragments.
mol | the molecule to convert |
cuttingRules | the cutting rules defining how to do fragmentation. |
logger | tool managing log. |
scaffoldingPolicy | the policy for deciding which vertex should be given the role of scaffold. |
linearAngleLimit | the max bond angle before we start considering the angle linear and add a linearity-breaking dummy atom. |
DENOPTIMException |
Definition at line 1070 of file EAUtils.java.
References denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol().
|
static |
Converts a molecule into a DGraph
by fragmentation and re-assembling of the fragments.
mol | the molecule to convert |
cuttingRules | the cutting rules defining how to do fragmentation. |
logger | tool managing log. |
scaffoldingPolicy | the policy for deciding which vertex should be given the role of scaffold. |
linearAngleLimit | the max bond angle before we start considering the angle linear and add a linearity-breaking dummy atom. |
fragSpace | the definition of the fragment space to consider when generating fragments. |
DENOPTIMException |
Definition at line 1122 of file EAUtils.java.
References denoptim.utils.DummyAtomHandler.addDummiesOnLinearities(), denoptim.graph.DGraph.addVertex(), denoptim.ga.EAUtils.appendVertexesToGraphFollowingEdges(), denoptim.graph.Vertex.BBType.CAP, denoptim.graph.DGraph.detectSymVertexSets(), denoptim.fragmenter.FragmenterTools.fragmentation(), denoptim.graph.Vertex.getHeavyAtomsCount(), denoptim.graph.Vertex.getIAtomContainer(), denoptim.utils.MoleculeUtils.getSymbolOrLabel(), denoptim.graph.DGraph.getVertexList(), denoptim.graph.Fragment.isIsomorphicTo(), denoptim.graph.Vertex.BBType.SCAFFOLD, denoptim.graph.Vertex.setBuildingBlockType(), denoptim.graph.Vertex.setVertexId(), and denoptim.graph.Fragment.updateAPs().
|
static |
Converts a molecule into a DGraph
by fragmentation and re-assembling of the fragments.
mol | the molecule to convert |
cuttingRules | the cutting rules defining how to do fragmentation. |
logger | tool managing log. |
scaffoldingPolicy | the policy for deciding which vertex should be given the role of scaffold. |
fragSpace | the fragment space for defining things like, what capping groups we have. |
DENOPTIMException |
Definition at line 1094 of file EAUtils.java.
References denoptim.ga.EAUtils.makeGraphFromFragmentationOfMol().
|
staticprotected |
Saves the final results to disk.
If the files for each candidate have been saved on disk along the way, then it copies them from their location into the folder for final results, which is defined based on the GA settings.
popln | the final list of best molecules |
settings | the GS settings containing defaults and parameters given by the user. |
Definition at line 1634 of file EAUtils.java.
References denoptim.programs.RunTimeParameters.ParametersType.FIT_PARAMS, denoptim.constants.DENOPTIMConstants.FITFILENAMEEXTOUT, denoptim.graph.Candidate.getImageFile(), denoptim.graph.Candidate.getName(), denoptim.ga.EAUtils.getPathNameToFinalPopulationDetailsFile(), denoptim.ga.EAUtils.getPathNameToFinalPopulationFolder(), denoptim.graph.Candidate.getSDFFile(), denoptim.ga.EAUtils.outputPopulationDetails(), denoptim.graph.Candidate.setSDFFile(), and denoptim.io.DenoptimIO.writeCandidateToFile().
Referenced by denoptim.ga.EvolutionaryAlgorithm.run().
|
static |
Write out summary for the current GA population.
population | |
filename | the pathname of the file where we write the details of the population. If required by the GAParameters , we use this also to define a pathname where to write all the members of the population. |
DENOPTIMException |
Definition at line 1324 of file EAUtils.java.
References denoptim.ga.EAUtils.df, denoptim.constants.DENOPTIMConstants.GAGENSUMMARYHEADER, denoptim.graph.Candidate.getFitness(), denoptim.graph.Candidate.getGraph(), denoptim.graph.DGraph.getGraphId(), denoptim.graph.Candidate.getName(), denoptim.graph.Candidate.getSDFFile(), denoptim.ga.EAUtils.getSummaryStatistics(), denoptim.graph.Candidate.getUID(), denoptim.ga.EAUtils.NL, denoptim.io.DenoptimIO.writeCandidatesToFile(), and denoptim.io.DenoptimIO.writeData().
Referenced by denoptim.ga.EAUtils.outputFinalResults(), denoptim.ga.EvolutionaryAlgorithm.run(), and denoptim.io.DenoptimIOTest.testReadGenerationFromSummary().
|
staticprotected |
Perform fitness-based, class-compatible selection of parents that can do crossover operations.
eligibleParents | list of candidates among which to choose. |
population | the dynamic population containing the eligible parents. |
choiceOfParents | the integers dictating the selection of parents. Use this only to ensure reproducibility in tests, otherwise use null |
choiceOfXOverSites | the integers dictating the selection of crossover sites. Use this only to ensure reproducibility in tests, otherwise use negative |
Definition at line 1518 of file EAUtils.java.
References denoptim.programs.RunTimeParameters.containsParameters(), denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.programs.RunTimeParameters.getRandomizer(), denoptim.ga.Population.getXoverPartners(), denoptim.ga.Population.getXoverSites(), denoptim.utils.Randomizer.randomlyChooseOne(), and denoptim.ga.EAUtils.selectBasedOnFitness().
Referenced by denoptim.ga.EAUtils.buildCandidatesByXOver().
|
static |
Takes a decision on which CandidateSource
method to use for generating a new Candidate
.
The choice is made according to the weights given as arguments, and shooting a random number over a weighted score range.
xoverWeight | weight of crossover between existing population members. |
mutWeight | weight of mutation of existing population members. |
newWeight | weight of construction from scratch. |
CandidateSource
excluding {@value CandidateSource::MANUAL}. Definition at line 263 of file EAUtils.java.
References denoptim.ga.EAUtils.CandidateSource.CONSTRUCTION, denoptim.ga.EAUtils.CandidateSource.CROSSOVER, denoptim.ga.EAUtils.CandidateSource.MUTATION, and denoptim.utils.Randomizer.nextDouble().
Referenced by denoptim.ga.EAUtils.chooseGenerationMethod(), denoptim.ga.EvolutionaryAlgorithm.makeOffspringB(), denoptim.ga.EAUtilsTest.testCandidateGenerationMethod(), and denoptim.ga.EAUtilsTest.testCandidateGenerationMethodReproducibility().
|
staticprotected |
Definition at line 769 of file EAUtils.java.
References denoptim.graph.DGraph.checkConsistency(), denoptim.graph.DGraph.cleanup(), denoptim.logging.CounterID.FAILEDMANUALADDATTEMPTS, denoptim.logging.CounterID.FAILEDMANUALADDATTEMPTS_EVAL, denoptim.graph.Candidate.getName(), denoptim.utils.GeneralUtils.getPaddedString(), denoptim.utils.GraphUtils.getUniqueMoleculeIndex(), denoptim.logging.CounterID.MANUALADDATTEMPTS, denoptim.constants.DENOPTIMConstants.MOLDIGITS, denoptim.logging.CounterID.NEWCANDIDATEATTEMPTS, denoptim.io.DenoptimIO.readDENOPTIMGraphsFromFile(), denoptim.graph.Candidate.setChemicalRepresentation(), denoptim.graph.DGraph.setLocalMsg(), denoptim.graph.Candidate.setName(), denoptim.graph.Candidate.setSmiles(), and denoptim.graph.Candidate.setUID().
Referenced by denoptim.ga.EvolutionaryAlgorithm.evolvePopulation().
|
staticprotected |
Definition at line 2432 of file EAUtils.java.
References denoptim.io.DenoptimIO.readList().
Referenced by denoptim.ga.EAUtils.importInitialPopulation().
|
static |
Searches for combinations of sites suitable for ring fusion, i.e., combinations of RelatedAPPair
where each such pair allows to expand a ring system by adding a fused ring resulting by connecting the two AttachmentPoint
s in the RelatedAPPair
by a non-empty bridge. The tile of bridge can depend on the properties of the RelatedAPPair
.
The set of combinations is only a sample resulting by taking random decisions that prevent combinatorial explosion.
graph | the definition of the system to work with |
projectOnSymmetricAPs | use true to impose projection onto symmetric APs (within a vertex) and onto symmetric vertexes. When this is true the result will be a list of lists, where the nested list may contain more than one item. Yet, each such item is symmetric projection of the other items. |
logger | a tool to deal with log messages. |
rng | a tool to deal with random decisions. |
RelatedAPPair
. DENOPTIMException | if the conversion into a molecular representation fails. |
Definition at line 2527 of file EAUtils.java.
References denoptim.constants.DENOPTIMConstants.ATMPROPAPS, denoptim.constants.DENOPTIMConstants.ATMPROPVERTEXID, denoptim.ga.EAUtils.canBeUsedForRingFusion(), denoptim.graph.DGraph.clone(), denoptim.ga.EAUtils.combineRelatedAPPair(), denoptim.molecularmodeling.ThreeDimTreeBuilder.convertGraphTo3DAtomContainer(), denoptim.graph.AttachmentPoint.getID(), denoptim.utils.ManySMARTSQuery.getMatchesOfSMARTS(), denoptim.utils.ManySMARTSQuery.getMessage(), denoptim.utils.ManySMARTSQuery.getNumMatchesOfQuery(), denoptim.graph.AttachmentPoint.getOwner(), denoptim.graph.Vertex.getSymmetricAPs(), denoptim.utils.ManySMARTSQuery.hasProblems(), denoptim.molecularmodeling.ThreeDimTreeBuilder.setAlignBBsIn3D(), and denoptim.ga.EAUtils.storePairsSymmetricRelations().
|
static |
Searches for combinations of sites suitable for ring fusion, i.e., combinations of RelatedAPPair
where each such pair allows to expand a ring system by adding a fused ring resulting by connecting the two AttachmentPoint
s in the RelatedAPPair
by a non-empty bridge. The tile of bridge can depend on the properties of the RelatedAPPair
.
The set of combinations is only a sample resulting by taking random decisions that prevent combinatorial explosion.
graph | the definition of the system to work with |
projectOnSymmetricAPs | use true to impose projection onto symmetric APs (within a vertex) and onto symmetric vertexes. When this is true the result will be a list of lists, where the nested list may contain more than one item. Yet, each such item is symmetric projection of the other items. |
logger | a tool to deal with log messages. |
rng | a tool to deal with random decisions. |
RelatedAPPair
. DENOPTIMException | if the conversion into a molecular representation fails. |
Definition at line 2471 of file EAUtils.java.
References denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.utils.Randomizer.nextBoolean(), denoptim.programs.RunTimeParameters.ParametersType.RC_PARAMS, and denoptim.ga.EAUtils.searchRingFusionSites().
Referenced by denoptim.ga.GraphOperations.addFusedRing(), denoptim.ga.GraphOperations.performMutation(), denoptim.ga.EAUtils.searchRingFusionSites(), denoptim.ga.EAUtilsTest.testFusionSiteDetection_ImposeSymmetry(), and denoptim.ga.EAUtilsTest.testSearchForApPairsSuitableToRingFusion().
|
staticprotected |
Selects a number of members from the given population.
The selection method is what specified by the configuration of the genetic algorithm (GAParameters
).
eligibleParents | the list of candidates to chose from. |
number | how many candidate to pick. |
Definition at line 1440 of file EAUtils.java.
References denoptim.programs.denovo.GAParameters.getMonitorFile(), denoptim.programs.denovo.GAParameters.getSelectionStrategyType(), denoptim.graph.Candidate.getUID(), denoptim.programs.RunTimeParameters.NL, denoptim.ga.SelectionHelper.performRandomSelection(), denoptim.ga.SelectionHelper.performRWS(), denoptim.ga.SelectionHelper.performSUS(), denoptim.ga.SelectionHelper.performTournamentSelection(), denoptim.programs.denovo.GAParameters.recordMateSelection, and denoptim.io.DenoptimIO.writeData().
Referenced by denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.buildCandidatesByXOver(), and denoptim.ga.EAUtils.performFBCC().
|
staticprotected |
Chose randomly a vertex that is neither scaffold or capping group.
Definition at line 1490 of file EAUtils.java.
References denoptim.graph.Vertex.BBType.CAP, denoptim.graph.DGraph.getVertexList(), denoptim.utils.Randomizer.randomlyChooseOne(), and denoptim.graph.Vertex.BBType.SCAFFOLD.
Referenced by denoptim.ga.EAUtils.buildCandidatesByXOver(), and denoptim.ga.EAUtilsTest.testSelectNonScaffoldNonCapVertex().
|
staticprotected |
Evaluates the possibility of closing rings in a given graph and if any ring can be closed, it chooses one of the combinations of ring closures that involves the highest number of new rings.
res | an object array containing the inchi code, the smiles string and the 2D representation of the molecule. This object can be null if inchi/smiles/2D conversion fails. |
molGraph | the DENOPTIMGraph on which rings are to be identified |
true
unless no ring can be set up even if required Definition at line 1898 of file EAUtils.java.
References denoptim.graph.rings.RingClosureParameters.allowRingClosures(), denoptim.graph.rings.RingClosureParameters.buildChelatesMode, denoptim.graph.rings.CyclicGraphHandler.checkChelatesGraph(), denoptim.molecularmodeling.ThreeDimTreeBuilder.convertGraphTo3DAtomContainer(), denoptim.utils.RotationalSpaceUtils.defineRotatableBonds(), denoptim.programs.RunTimeParameters.ParametersType.FS_PARAMS, denoptim.ga.EAUtils.getCrowdedness(), denoptim.ga.EAUtils.getCrowdingProbability(), denoptim.fragspace.FragmentSpaceParameters.getFragmentSpace(), denoptim.utils.MoleculeUtils.getInChIKeyForMolecule(), denoptim.graph.rings.RingClosureParameters.getMaxRingClosures(), denoptim.programs.RunTimeParameters.getParameters(), denoptim.graph.rings.CyclicGraphHandler.getPossibleCombinationOfRings(), denoptim.graph.rings.CyclicGraphHandler.getRandomCombinationOfRings(), denoptim.utils.MoleculeUtils.getSMILESForMolecule(), denoptim.programs.RunTimeParameters.ParametersType.RC_PARAMS, denoptim.molecularmodeling.ThreeDimTreeBuilder.setAlignBBsIn3D(), and denoptim.fragspace.FragmentSpace.useAPclassBasedApproach().
Referenced by denoptim.ga.EAUtils.buildCandidateByMutation(), denoptim.ga.EAUtils.buildCandidateFromScratch(), and denoptim.ga.EAUtils.buildCandidatesByXOver().
|
staticprotected |
Set the Vertex counter value according to the largest value found in the given population.
population | the collection of candidates to analyse. |
DENOPTIMException |
Definition at line 1782 of file EAUtils.java.
References denoptim.utils.GraphUtils.ensureVertexIDConsistency(), and denoptim.graph.DGraph.getMaxVertexId().
Referenced by denoptim.ga.EAUtils.getPopulationFromFile().
|
static |
Evaluates if a RelatedAPPair
involves the same AttachmentPoint
present in a collection.
pairA | the pair to test. |
lstB | the collection. |
true
if any AttachmentPoint
of the given pair is present in the collection. Definition at line 2931 of file EAUtils.java.
References denoptim.graph.RelatedAPPair.apA, and denoptim.graph.RelatedAPPair.apB.
Referenced by denoptim.ga.EAUtils.combineRelatedAPPairUtil().
|
staticprivate |
Definition at line 2880 of file EAUtils.java.
References denoptim.graph.RelatedAPPair.propID.
Referenced by denoptim.ga.EAUtils.searchRingFusionSites().
|
staticprotected |
Definition at line 1749 of file EAUtils.java.
References denoptim.ga.EAUtils.NL, and denoptim.io.DenoptimIO.writeData().
|
staticprivate |
Format for decimal fitness numbers that overwrites Locale to en_US.
Definition at line 119 of file EAUtils.java.
Referenced by denoptim.ga.EAUtils.getSummaryStatistics(), denoptim.ga.EAUtils.initialiseFormatter(), and denoptim.ga.EAUtils.outputPopulationDetails().
|
staticprivate |
Locale used to write reports.
Definition at line 114 of file EAUtils.java.
Referenced by denoptim.ga.EAUtils.initialiseFormatter().
|
staticprotected |
Definition at line 109 of file EAUtils.java.
|
staticprivate |
|
staticprotected |
Definition at line 128 of file EAUtils.java.
|
staticprivate |
Definition at line 137 of file EAUtils.java.
Referenced by denoptim.ga.EAUtils.buildCandidatesByXOver(), denoptim.ga.EAUtils.getSummaryStatistics(), denoptim.ga.EAUtils.outputPopulationDetails(), and denoptim.ga.EAUtils.writeUID().