19package denoptim.graph.rings;
22import java.lang.reflect.Field;
23import java.util.ArrayList;
24import java.util.HashMap;
25import java.util.HashSet;
29import java.util.logging.Level;
31import denoptim.exception.DENOPTIMException;
32import denoptim.files.FileUtils;
33import denoptim.graph.APClass;
34import denoptim.logging.StaticLogger;
35import denoptim.programs.RunTimeParameters;
71 new HashSet<APClass>();
102 protected Map<String,Integer>
minRcaPerType =
new HashMap<String,Integer>();
107 protected Map<String,Integer>
maxRcaPerType =
new HashMap<String,Integer>();
170 private static final long serialVersionUID = 1L;
191 new HashMap<String,String>();
491 switch (key.toUpperCase())
500 msg =
"Unable to understand value '" + value +
"'";
510 case "BUILDCHELATESMODE":
513 case "ORPHANAPCLASS=":
517 case "SELECTFRAGMENTSFROMCLOSABLECHAINS":
520 case "EVALUATIONCLOSABILITYMODE=":
521 switch (value.toUpperCase())
531 case "3D-CONFORMATION":
535 case "CONSTITUTION_AND_3D-CONFORMATION":
540 msg =
"Unable to understand value '" + value +
"'";
551 msg =
"Unable to understand value '" + value +
"'";
555 case "MAXSIZENEWRINGS=":
562 msg =
"Unable to understand value '" + value +
"'";
566 case "MINRCAPERTYPEPERGRAPH=":
569 String[] words = value.trim().split(
"\\s+");
572 msg =
"Unable to understand value '" + value +
"'";
579 msg =
"Unable to understand value '" + value +
"'";
583 case "MAXRCAPERTYPEPERGRAPH=":
586 String[] words = value.trim().split(
"\\s+");
589 msg =
"Unable to understand value '" + value +
"'";
596 msg =
"Unable to understand value '" + value +
"'";
600 case "MINNUMBEROFRINGCLOSURES=":
607 msg =
"Unable to understand value '" + value +
"'";
611 case "MAXNUMBERRINGCLOSURES=":
618 msg =
"Unable to understand value '" + value +
"'";
622 case "LINEARITYLIMIT=":
629 msg =
"Unable to understand value '" + value +
"'";
633 case "DISTANCETOLERANCEFACTOR=":
640 msg =
"Unable to understand value '" + value +
"'";
644 case "EXTRADISTANCETOLERANCEFACTOR=":
651 msg =
"Unable to understand value '" + value +
"'";
658 rcMaxDot = Double.parseDouble(value);
662 msg =
"Unable to understand value '" + value +
"'";
666 case "CONFSEARCHSTEP=":
673 msg =
"Unable to understand value '" + value +
"'";
677 case "RINGSIZEBIAS=":
678 String[] words = value.split(
"\\s+");
679 if (words.length != 2)
681 msg =
"Unable to read ring size and bias wevight from "
682 +
"'" + value +
"'. Expected syntax is: "
683 +
"'5 2' as to specify that 5-member rings "
684 +
"are given a weight of 2.";
691 size = Integer.parseInt(words[0]);
692 }
catch (Throwable t)
698 weight = Integer.parseInt(words[1]);
699 }
catch (Throwable t)
705 msg =
"Ring size must be >= 0";
710 msg =
"Bias for ring size must be >= 0";
727 case "CLOSABLERINGSMARTS=":
731 case "REQUIREDELEMENTINRINGS=":
741 case "EXHAUSTIVECONFSEARCH":
744 case "CHECKINTERDEPENDENTCHAINS":
748 msg =
"Keyword '" + key +
"' is not a known ring closure-"
749 +
"related keyword. Check input files.";
761 msg =
"The use of ring-closure related keywords "
762 +
"is dependent on the activation of the ring-closing "
765 +
"CLOSERINGS keyword).";
771 msg =
"Unknown ring-closure evaluation mode '" +
rceMode +
"' "
772 +
"Acceptable values are: "
773 +
"-1 (only ring size)"
774 +
"0 (only contitutional), "
775 +
"1 (only 3D chain), "
776 +
"2 (both constitutional and 3D chain). ";
789 msg =
"CyclicGraphHandler can't make folder " +
rccFolder
797 msg =
"To use the BuildChelates mode you need to perform "
798 +
"experiments capable of closing/opening and modifying "
801 +
"CLOSERINGS keyword "
802 +
"and provide the related input (i.e., ring "
803 +
"closing attractor fragments).";
811 msg =
"Check values of max and min number of RCA for type '"
819 msg =
"Check values of minRingClosures and maxRingClosures";
830 msg =
"Exhaustive conformational search has been turned ON. "
831 +
"This is a very time consuming task!";
837 msg =
"DENOPTIM can guide the selection of fragments to "
838 +
"those leading to known closable chains. This "
839 +
"functionality is currently under development "
840 +
"and is fully operative only for rings "
841 +
"involving the scaffolds. ";
865 StringBuilder sb =
new StringBuilder(1024);
867 for (Field f : this.getClass().getDeclaredFields())
871 sb.append(f.getName()).append(
" = ").append(
872 f.get(
this)).append(
NL);
877 +
" parameters. Cause: " + t);
883 sb.append(otherCollector.getPrintedList());
885 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()
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...
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...
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.