19package denoptim.graph.rings;
21import java.io.BufferedReader;
23import java.io.IOException;
24import java.io.InputStreamReader;
25import java.lang.reflect.Field;
26import java.util.ArrayList;
27import java.util.HashMap;
28import java.util.HashSet;
32import java.util.logging.Level;
34import denoptim.exception.DENOPTIMException;
35import denoptim.files.FileUtils;
36import denoptim.fragmenter.BridgeHeadFindingRule;
37import denoptim.graph.APClass;
38import denoptim.io.DenoptimIO;
39import denoptim.logging.StaticLogger;
40import denoptim.programs.RunTimeParameters;
76 new HashSet<APClass>();
107 protected Map<String,Integer>
minRcaPerType =
new HashMap<String,Integer>();
112 protected Map<String,Integer>
maxRcaPerType =
new HashMap<String,Integer>();
175 private static final long serialVersionUID = 1L;
196 new HashMap<String,String>();
264 new BufferedReader(
new InputStreamReader(
265 this.getClass().getClassLoader().getResourceAsStream(
266 "data/bridge-head_finding_rules.json"))));
267 }
catch (IOException e)
521 switch (key.toUpperCase())
530 msg =
"Unable to understand value '" + value +
"'";
540 case "BUILDCHELATESMODE":
543 case "ORPHANAPCLASS=":
547 case "SELECTFRAGMENTSFROMCLOSABLECHAINS":
550 case "EVALUATIONCLOSABILITYMODE=":
551 switch (value.toUpperCase())
561 case "3D-CONFORMATION":
565 case "CONSTITUTION_AND_3D-CONFORMATION":
570 msg =
"Unable to understand value '" + value +
"'";
581 msg =
"Unable to understand value '" + value +
"'";
585 case "MAXSIZENEWRINGS=":
592 msg =
"Unable to understand value '" + value +
"'";
596 case "MINRCAPERTYPEPERGRAPH=":
599 String[] words = value.trim().split(
"\\s+");
602 msg =
"Unable to understand value '" + value +
"'";
609 msg =
"Unable to understand value '" + value +
"'";
613 case "MAXRCAPERTYPEPERGRAPH=":
616 String[] words = value.trim().split(
"\\s+");
619 msg =
"Unable to understand value '" + value +
"'";
626 msg =
"Unable to understand value '" + value +
"'";
630 case "MINNUMBEROFRINGCLOSURES=":
637 msg =
"Unable to understand value '" + value +
"'";
641 case "MAXNUMBERRINGCLOSURES=":
648 msg =
"Unable to understand value '" + value +
"'";
652 case "LINEARITYLIMIT=":
659 msg =
"Unable to understand value '" + value +
"'";
663 case "DISTANCETOLERANCEFACTOR=":
670 msg =
"Unable to understand value '" + value +
"'";
674 case "EXTRADISTANCETOLERANCEFACTOR=":
681 msg =
"Unable to understand value '" + value +
"'";
688 rcMaxDot = Double.parseDouble(value);
692 msg =
"Unable to understand value '" + value +
"'";
696 case "CONFSEARCHSTEP=":
703 msg =
"Unable to understand value '" + value +
"'";
707 case "RINGSIZEBIAS=":
708 String[] words = value.split(
"\\s+");
709 if (words.length != 2)
711 msg =
"Unable to read ring size and bias weight from "
712 +
"'" + value +
"'. Expected syntax is: "
713 +
"'5 2' as to specify that 5-member rings "
714 +
"are given a weight of 2.";
721 size = Integer.parseInt(words[0]);
722 }
catch (Throwable t)
728 weight = Integer.parseInt(words[1]);
729 }
catch (Throwable t)
735 msg =
"Ring size must be >= 0";
740 msg =
"Bias for ring size must be >= 0";
758 case "CLOSABLERINGSMARTS=":
763 case "REQUIREDELEMENTINRINGS=":
776 case "EXHAUSTIVECONFSEARCH":
780 case "CHECKINTERDEPENDENTCHAINS":
784 case "BRIDGEHEADFINDINGRULESFILE=":
792 msg =
"Keyword '" + key +
"' is not a known ring closure-"
793 +
"related keyword. Check input files.";
805 msg =
"The use of ring-closure related keywords "
806 +
"is dependent on the activation of the ring-closing "
809 +
"CLOSERINGS keyword).";
815 msg =
"Unknown ring-closure evaluation mode '" +
rceMode +
"' "
816 +
"Acceptable values are: "
817 +
"-1 (only ring size)"
818 +
"0 (only contitutional), "
819 +
"1 (only 3D chain), "
820 +
"2 (both constitutional and 3D chain). ";
833 msg =
"CyclicGraphHandler can't make folder " +
rccFolder
841 msg =
"To use the BuildChelates mode you need to perform "
842 +
"experiments capable of closing/opening and modifying "
845 +
"CLOSERINGS keyword "
846 +
"and provide the related input (i.e., ring "
847 +
"closing attractor fragments).";
855 msg =
"Check values of max and min number of RCA for type '"
863 msg =
"Check values of minRingClosures and maxRingClosures";
874 msg =
"Exhaustive conformational search has been turned ON. "
875 +
"This is a very time consuming task!";
881 msg =
"DENOPTIM can guide the selection of fragments to "
882 +
"those leading to known closable chains. This "
883 +
"functionality is currently under development "
884 +
"and is fully operative only for rings "
885 +
"involving the scaffolds. ";
909 StringBuilder sb =
new StringBuilder(1024);
911 for (Field f : this.getClass().getDeclaredFields())
915 sb.append(f.getName()).append(
" = ").append(
916 f.get(
this)).append(
NL);
921 +
" parameters. Cause: " + t);
927 sb.append(otherCollector.getPrintedList());
929 return sb.toString();
static boolean checkExists(String fileName)
static APClass make(String ruleAndSubclass)
Creates an APClass if it does not exist already, or returns the reference to the existing instance.
Parameters and setting related to handling ring closures.
boolean doExhaustiveConfSrch()
int getVerbosity()
Returns the level of verbosity, i.e., the amount of log that we want to print.
int maxRingSize
Maximum size (number of atoms) in ring closing chain.
Map< String, String > ringClosabCondAsSMARTS
SMARTS defining the constitution-based ring closability condition.
void setRingSizeBias(List< Integer > biases)
Sets the preference for certain ring sizes or the prohibition to generate certain rings (i....
double getRCDistTolerance()
int maxRingClosures
Maximum number of RingClosures in a valid graph.
boolean serializeRCCs
Flag controlling the serialization of the RingClosingConformations.
double getRCDotPrTolerance()
boolean requireCompleteRingclosure
Flag requesting complete ring closure of all pairs of RCAs in at least one combination of RCAs to con...
RingClosureParameters()
Constructor.
Set< APClass > metalCoordinatingAPClasses
List of metal-coordinating APClasses.
String getPrintedList()
Returns the list of parameters in a string with newline characters as delimiters.
void processParameters()
Processes all parameters and initialize related objects.
Set< String > reqElInRings
Required elements in closable chains.
double rcMaxDot
Maximum value of dot product between the normalized attachment point vectors at the head and tail of ...
double pathConfSearchStep
Torsion angle step for conformational scan of candidate closable chain.
boolean checkInterdependentChains()
double pathConfSearchExtraTol
Extra tolerance factor for interatomic distances.
double getConfPathExtraTolerance()
int getMaxNumberRotatableBonds()
List< BridgeHeadFindingRule > getBridgeHeadFindingRules()
Set< String > getRequiredRingElements()
int getMaxRcaPerType(String type)
double getLinearityLimit()
RingClosuresArchive getRingClosuresArchive()
String rccIndex
Pathname of the text file containing the list of visited RingClosingConformations (i....
void checkParameters()
Evaluate consistency of input parameters.
Map< String, Integer > maxRcaPerType
Maximum number of RingClosingAttractors in a valid graph.
boolean selectFragsFromCC
Flag activating the biased selection of closable fragment chains.
boolean allowRingClosures()
int getMinRcaPerType(String type)
String getRCCLibraryFolder()
boolean exhaustiveConfSrch
Flag controlling conformational search.
boolean buildChelatesMode()
String rccFolder
Pathname of the root folder containing the archive of serialized RingClosingConformations.
int maxRotBonds
Maximum number of rotatable bonds for which conformational space is explored.
boolean buildChelatesMode
Flag activating procedures favoring formation of chelates.
int minRingClosures
Minimum number of RingClosures in a valid graph.
void setConstitutionalClosabilityConds(Map< String, String > ringClosabCondAsSMARTS)
Sets the list of constitutions that can be formed by ring closure.
void allowRingClosures(boolean value)
int getClosabilityEvalMode()
List< Integer > getRingSizeBias()
String getRCCLibraryIndexFile()
RingClosuresArchive rcArchive
Collection of information about ring-closability of graph substructures.
double linearityLimit
Maximum value for non-flat bond angle (in degree).
boolean selectFragmentsFromClosableChains()
void interpretKeyword(String key, String value)
Processes a keyword/value pair and assign the related parameters.
double rcTolDist
Tolerance factor for interatomic distances.
double getPathConfSearchStep()
boolean closeRings
Flag activating the ring closing machinery.
Map< String, Integer > minRcaPerType
Minimum number of RingClosingAttractors in a valid graph.
int rceMode
The ring closability evaluation mode: -1= only ring rize bias 0 = only constitution of candidate ring...
boolean checkInterdepPaths
Flag controlling the ring-closing criterion evaluating the simultaneous closability of interdependent...
List< BridgeHeadFindingRule > bridgeHeadFindingRules
Rules that identify the atoms that can become bridge heads to form fused rings.
Map< String, String > getConstitutionalClosabilityConds()
List< Integer > ringSizeBias
Relative weight of ring sizes to bias the selection of a ring combination among the various alternati...
Data structure to store and handle information about sub-structures (i.e., chains of fragments) and r...
Utility methods for input/output.
static List< BridgeHeadFindingRule > readBridgeHesFindingRules(String fileName)
Reads a list of rules for identifying potential bridge-head sites.
Logger class for DENOPTIM.
static final Logger appLogger
Collection of parameters controlling the behavior of the software.
Map< ParametersType, RunTimeParameters > otherParameters
Collection of other parameters by type.
String paramTypeName()
Returns a string defining the type the parameters collected here.
void checkOtherParameters()
Checks any of the parameter collections contained in this instance.
final String NL
New line character.
void processOtherParameters()
Processes any of the parameter collections contained in this instance.
int verbosity
Verbosity level for logger.
Identifier of the type of parameters.
RC_PARAMS
Parameters pertaining to ring closures in graphs.