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;
106 new HashMap<APClass, Double>();
190 return libFile.getAbsolutePath() +
"_addedFragments.sdf";
198 return libFile.getAbsolutePath() +
"_addedScaffolds.sdf";
214 switch (key.toUpperCase())
216 case "SCAFFOLDLIBFILE=":
219 case "FRAGMENTLIBFILE=":
222 case "CAPPINGFRAGMENTLIBFILE=":
225 case "COMPMATRIXFILE=":
228 case "RCCOMPMATRIXFILE=":
231 case "ROTBONDSDEFFILE=":
234 case "MAXHEAVYATOM=":
237 if (value.length() > 0)
242 msg =
"Unable to understand value '" + value +
"'";
246 case "MAXROTATABLEBOND=":
249 if (value.length() > 0)
254 msg =
"Unable to understand value '" + value +
"'";
261 if (value.length() > 0)
262 maxMW = Double.parseDouble(value);
266 msg =
"Unable to understand value '" + value +
"'";
270 case "ENFORCESYMMETRY":
273 case "CONSTRAINSYMMETRY=":
277 if (value.length() > 0)
279 String[] words = value.trim().split(
"\\s+");
280 if (words.length != 2)
282 msg =
"Keyword " + key +
" requires two arguments: "
283 +
"[APClass (String)] [probability (Double)].";
290 prob = Double.parseDouble(words[1]);
294 msg =
"Unable to convert '" + words[1] +
"' into a "
302 msg =
"Keyword '" + key +
"' requires two arguments: "
303 +
"[APClass (String)] [probability (Double)].";
311 msg =
"Unable to understand value '" + value +
"'";
323 msg =
"Unable to understand value '" + value +
"'";
328 msg =
"Keyword " + key +
" is not a known fragment space-"
329 +
"related keyword. Check input files.";
341 getLogger().log(Level.WARNING,
"No scaffolds library file specified.");
352 getLogger().log(Level.WARNING,
"No fragment library file specified.");
365 msg =
"Cannot find the library of capping groups: "
375 msg =
"Cannot find the compatibility matrix file: "
385 msg =
"Cannot find the ring-closures compatibility matrix "
393 msg =
"Cannot find file with definitions of rotatable bonds: "
427 StringBuilder sb =
new StringBuilder(1024);
429 for (Field f : this.getClass().getDeclaredFields())
433 sb.append(f.getName()).append(
" = ").append(
434 f.get(
this)).append(
NL);
439 +
" parameters. Cause: " + t);
445 sb.append(otherCollector.getPrintedList());
447 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.
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.
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.