19package denoptim.fragspace;
22import java.lang.reflect.Field;
23import java.util.HashMap;
24import java.util.logging.Level;
26import denoptim.exception.DENOPTIMException;
27import denoptim.files.FileUtils;
28import denoptim.graph.APClass;
29import denoptim.programs.RunTimeParameters;
111 new HashMap<APClass, Double>();
202 return libFile.getAbsolutePath() +
"_addedFragments.sdf";
210 return libFile.getAbsolutePath() +
"_addedScaffolds.sdf";
226 switch (key.toUpperCase())
228 case "SCAFFOLDLIBFILE=":
231 case "FRAGMENTLIBFILE=":
234 case "CAPPINGFRAGMENTLIBFILE=":
237 case "COMPMATRIXFILE=":
240 case "RCCOMPMATRIXFILE=":
243 case "ROTBONDSDEFFILE=":
246 case "ROTCONSTRDEFFILE=":
249 case "MAXHEAVYATOM=":
252 if (value.length() > 0)
257 msg =
"Unable to understand value '" + value +
"'";
261 case "MAXROTATABLEBOND=":
264 if (value.length() > 0)
269 msg =
"Unable to understand value '" + value +
"'";
276 if (value.length() > 0)
277 maxMW = Double.parseDouble(value);
281 msg =
"Unable to understand value '" + value +
"'";
285 case "ENFORCESYMMETRY":
288 case "CONSTRAINSYMMETRY=":
292 if (value.length() > 0)
294 String[] words = value.trim().split(
"\\s+");
295 if (words.length != 2)
297 msg =
"Keyword " + key +
" requires two arguments: "
298 +
"[APClass (String)] [probability (Double)].";
305 prob = Double.parseDouble(words[1]);
309 msg =
"Unable to convert '" + words[1] +
"' into a "
317 msg =
"Keyword '" + key +
"' requires two arguments: "
318 +
"[APClass (String)] [probability (Double)].";
326 msg =
"Unable to understand value '" + value +
"'";
338 msg =
"Unable to understand value '" + value +
"'";
343 msg =
"Keyword " + key +
" is not a known fragment space-"
344 +
"related keyword. Check input files.";
356 getLogger().log(Level.WARNING,
"No scaffolds library file specified.");
367 getLogger().log(Level.WARNING,
"No fragment library file specified.");
380 msg =
"Cannot find the library of capping groups: "
390 msg =
"Cannot find the compatibility matrix file: "
400 msg =
"Cannot find the ring-closures compatibility matrix "
408 msg =
"Cannot find file with definitions of rotatable bonds: "
415 msg =
"Cannot find file with definitions of constrained rotatable bonds: "
449 StringBuilder sb =
new StringBuilder(1024);
451 for (Field f : this.getClass().getDeclaredFields())
455 sb.append(f.getName()).append(
" = ").append(
456 f.get(
this)).append(
NL);
461 +
" parameters. Cause: " + t);
467 sb.append(otherCollector.getPrintedList());
469 return sb.toString();
static boolean checkExists(String fileName)
Class defining a space of building blocks.
Parameters defining the fragment space.
void processParameters()
Read the information collected in the parameters stored in this class and create the fragment space a...
boolean enforceSymmetry
Flag enforcing constitutional symmetry.
String getRotConstraintDefFile()
double maxMW
Maximum molecular weight accepted.
String fragmentLibFile
PathName of the file containing the molecular representation of building blocks: fragment section - f...
String getPathnameToAppendedFragments()
FragmentSpaceParameters(FragmentSpace fs)
Constructor of a default set of parameters coupled with a given fragment space.
int maxRotatableBond
Maximum number of rotatable bonds accepted.
FragmentSpaceParameters()
Constructor.
String rotBndsFile
Rotatable bonds definition file.
FragmentSpace buildingBlocksSpace
HashMap< APClass, Double > symmConstraintsMap
List of constitutional symmetry constraints.
boolean enforceSymmetry()
String getPrintedList()
Returns the list of parameters in a string with newline characters as delimiters.
boolean symmetryConstraints
Flag for application of selected constitutional symmetry constraints.
void interpretKeyword(String key, String value)
Processes a keyword/value pair and assign the related parameters.
void checkParameters()
Evaluate consistency of input parameters.
String compMatrixFile
Pathname of the file containing the compatibility matrix, bond order to AP-class relation,...
FragmentSpaceParameters(ParametersType paramType)
Constructor.
String cappingLibFile
Pathname of the file containing the molecular representation of building blocks: capping group sectio...
FragmentSpace getFragmentSpace()
boolean symmetryConstraints()
String getPathnameToAppendedScaffolds()
String rcCompMatrixFile
Pathname of the file containing the RC-compatibility matrix.
int maxHeavyAtom
Maximum number of heavy (non-hydrogen) atoms accepted.
int getMaxRotatableBond()
String scaffoldLibFile
Pathname of the file containing the molecular representation of building blocks: scaffolds section - ...
String getRotSpaceDefFile()
void setFragmentSpace(FragmentSpace fragmentSpace)
Sets the fragment space linked to these parameters.
String rotConstraintsFile
Rotatable bonds constraints definition file.
static APClass make(String ruleAndSubclass)
Creates an APClass if it does not exist already, or returns the reference to the existing instance.
Collection of parameters controlling the behavior of the software.
Map< ParametersType, RunTimeParameters > otherParameters
Collection of other parameters by type.
Logger getLogger()
Get the name of the program specific logger.
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.
ParametersType paramType
The type of parameters collected in this instance.
void processOtherParameters()
Processes any of the parameter collections contained in this instance.
int verbosity
Verbosity level for logger.
Identifier of the type of parameters.
FS_PARAMS
Parameters pertaining the definition of the fragment space.