19package denoptim.programs.mol2graph;
21import java.io.BufferedReader;
23import java.io.InputStreamReader;
24import java.lang.reflect.Field;
25import java.util.ArrayList;
28import org.openscience.cdk.interfaces.IAtomContainer;
30import denoptim.exception.DENOPTIMException;
31import denoptim.files.FileFormat;
32import denoptim.files.FileUtils;
33import denoptim.fragmenter.ScaffoldingPolicy;
34import denoptim.fragspace.FragmentSpace;
35import denoptim.fragspace.FragmentSpaceParameters;
36import denoptim.graph.Template.ContractLevel;
37import denoptim.io.DenoptimIO;
38import denoptim.programs.RunTimeParameters;
39import denoptim.programs.fragmenter.CuttingRule;
40import denoptim.programs.fragmenter.FragmenterParameters;
198 switch (key.toUpperCase())
206 case "OUTPUTGRAPHS=":
209 case "OUTPUTGRAPHSFORMAT=":
210 switch (value.toUpperCase())
232 msg =
"Unable to understand value " + key +
"'" + value +
"'";
237 msg =
"Keyword " + key +
" is not a known GraphEditor-"
238 +
"related keyword. Check input files.";
253 StringBuilder sb =
new StringBuilder(1024);
255 for (Field f : this.getClass().getDeclaredFields())
259 sb.append(f.getName()).append(
" = ").append(
260 f.get(
this)).append(
NL);
265 +
" parameters. Cause: " + t);
271 sb.append(otherCollector.getPrintedList());
273 return sb.toString();
288 msg =
"Directory " +
workDir +
" not found. Please specify an "
289 +
"existing directory.";
295 msg =
"Input file not defined. Check you input.";
300 msg =
"File with input molecules not found. Check " +
inFile;
324 }
catch (Exception e) {
340 List<CuttingRule> defaultCutRules =
new ArrayList<CuttingRule>();
342 BufferedReader reader =
null;
344 reader =
new BufferedReader(
new InputStreamReader(
this
345 .getClass().getClassLoader().getResourceAsStream(
346 "data/cutting_rules")));
354 }
catch (Exception e )
static boolean checkExists(String fileName)
Class defining a space of building blocks.
Parameters defining the fragment space.
FragmentSpace getFragmentSpace()
Utility methods for input/output.
static void readCuttingRules(BufferedReader reader, List< CuttingRule > cutRules, String source)
Read cutting rules from a stream.
static List< IAtomContainer > readAllAtomContainers(File file)
Returns a single collection with all atom containers found in a file of any format.
Collection of parameters controlling the behavior of the software.
Map< ParametersType, RunTimeParameters > otherParameters
Collection of other parameters by type.
boolean containsParameters(ParametersType type)
void setParameters(RunTimeParameters otherParams)
RunTimeParameters getParameters(ParametersType 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.
String workDir
Working directory.
final String NL
New line character.
void processOtherParameters()
Processes any of the parameter collections contained in this instance.
int verbosity
Verbosity level for logger.
Parameters controlling execution of the fragmenter.
double getLinearAngleLimit()
void setCuttingRules(List< CuttingRule > cuttingRules)
Assigns the cutting rules loaded from the input.
ScaffoldingPolicy getScaffoldingPolicy()
List< CuttingRule > getCuttingRules()
ContractLevel getEmbeddedRingsContract()
boolean embedRingsInTemplate
Flag that enables the embedding of rings in templates upon conversion of molecules into DGraph.
Parameters controlling execution of GraphEditor.
double getLinearAngleLimit()
FragmentSpace getFragmentSpace()
void ensureFragSpareParams()
void ensureFragmenterParams()
IAtomContainer getInputMol(int i)
String outGraphsFile
File with output graphs.
ContractLevel getEmbeddedRingsContract()
List< CuttingRule > getCuttingRules()
String inFile
File with input graphs.
void interpretKeyword(String key, String value)
Processes a keyword/value pair and assign the related parameters.
FileFormat outGraphsFormat
Mol2GraphParameters()
Constructor.
FileFormat getOutFormat()
void processParameters()
Processes all parameters and initialize related objects.
void checkParameters()
Evaluate consistency of input parameters.
boolean embedRingsInTemplate()
List< IAtomContainer > inMols
Input molecular objects.
String getPrintedList()
Returns the list of parameters in a string with newline characters as delimiters.
ScaffoldingPolicy getScaffoldingPolicy()
Defines how to define the scaffold vertex of a graph.
Enum specifying to what extent the template's inner graph can be changed.
Identifier of the type of parameters.
M2G_PARAMS
Parameters controlling molecule-to-graph conversion.
FS_PARAMS
Parameters pertaining the definition of the fragment space.
FRG_PARAMS
Parameters controlling the fragmenter.