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.io.DenoptimIO;
37import denoptim.programs.RunTimeParameters;
38import denoptim.programs.fragmenter.CuttingRule;
39import denoptim.programs.fragmenter.FragmenterParameters;
177 switch (key.toUpperCase())
185 case "OUTPUTGRAPHS=":
188 case "OUTPUTGRAPHSFORMAT=":
189 switch (value.toUpperCase())
211 msg =
"Unable to understand value " + key +
"'" + value +
"'";
216 msg =
"Keyword " + key +
" is not a known GraphEditor-"
217 +
"related keyword. Check input files.";
232 StringBuilder sb =
new StringBuilder(1024);
234 for (Field f : this.getClass().getDeclaredFields())
238 sb.append(f.getName()).append(
" = ").append(
239 f.get(
this)).append(
NL);
244 +
" parameters. Cause: " + t);
250 sb.append(otherCollector.getPrintedList());
252 return sb.toString();
267 msg =
"Directory " +
workDir +
" not found. Please specify an "
268 +
"existing directory.";
274 msg =
"Input file not defined. Check you input.";
279 msg =
"File with input molecules not found. Check " +
inFile;
303 }
catch (Exception e) {
319 List<CuttingRule> defaultCutRules =
new ArrayList<CuttingRule>();
321 BufferedReader reader =
null;
323 reader =
new BufferedReader(
new InputStreamReader(
this
324 .getClass().getClassLoader().getResourceAsStream(
325 "data/cutting_rules")));
333 }
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()
Parameters controlling execution of GraphEditor.
double getLinearAngleLimit()
FragmentSpace getFragmentSpace()
void ensureFragSpareParams()
void ensureFragmenterParams()
IAtomContainer getInputMol(int i)
String outGraphsFile
File with output graphs.
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.
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.
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.