19package denoptim.fragmenter;
22import java.io.IOException;
23import java.util.logging.FileHandler;
24import java.util.logging.Handler;
25import java.util.logging.Level;
26import java.util.logging.Logger;
27import java.util.logging.SimpleFormatter;
29import denoptim.io.DenoptimIO;
30import denoptim.programs.fragmenter.FragmenterParameters;
31import denoptim.task.Task;
32import denoptim.utils.TaskUtils;
92 int id)
throws SecurityException, IOException
98 this.logger = Logger.
getLogger(
"FragmenterTask-"+
id);
101 int n =
logger.getHandlers().length;
102 for (
int i=0; i<n; i++)
109 SimpleFormatter formatterTxt =
new SimpleFormatter();
110 fileHdlr.setFormatter(formatterTxt);
111 logger.setUseParentHandlers(
false);
112 logger.addHandler(fileHdlr);
114 String header =
"Started logging for FragmenterTask-"+
id ;
115 logger.log(Level.INFO,header);
130 +
"structuresBatch-" + i +
".sdf";
166 +
"structuresNoMissingAtoms-" + i +
".sdf";
181 +
"structuresPreFiltered-" + i +
".sdf";
196 +
"Fragments-" + i +
".sdf";
238 +
"FragmenterTask-" + i +
".log";
248 public Object
call() throws Exception
253 logger.log(Level.INFO,
"Starting elemental analysis");
266 logger.log(Level.INFO,
"Pre-filtering structures");
276 logger.log(Level.INFO,
"Fragmentation of structures");
280 if (!producedSomething)
290 logger.log(Level.INFO,
"Filtering fragments");
301 logger.log(Level.INFO,
"Fragmenter task " +
id +
" completed.");
307 for (Handler h :
logger.getHandlers())
309 if (h instanceof FileHandler) {
Task that performs the various steps in the process that prepares chemical structured to be chopped,...
FragmenterParameters settings
Settings for the calculation of the fitness.
File preliminaryResults
File containing the latest results, though not the final results.
String logFilePathname
Pathname to thread-specific log.
static String getLogFileName(FragmenterParameters settings, int i)
Builds the pathname of the log file for this task.
String results
The data structure holding the results of this task.
static String getFragmentsFileName(FragmenterParameters settings, int i)
Builds the pathname of the structure file meant to hold fragments resulting from this task.
static String getPreFilteredFileName(FragmenterParameters settings, int i)
Builds the pathname of the structure file meant to hold structures that survive the pre-filtering ste...
static String getInputFileName(FragmenterParameters settings, int i)
Builds the pathname of the structure file meant to be the input for this task.
static String getFragmentsFileName(FragmenterParameters settings)
Builds the pathname of the structure file meant to hold fragments resulting from all tasks.
Logger logger
Logger for this task.
String getLogFilePathname()
Object call()
Performs the whatever work has to be done by this task.
FragmenterTask(File inputFile, FragmenterParameters settings, int id)
Create a task by giving the input file (i.e., containing structures to work with) and the configurati...
static String getConfirmedFormulaFileName(FragmenterParameters settings, int i)
Builds the pathname of the structure file meant to hold structures that survive the comparison of str...
static String getResultsFileName(FragmenterParameters settings)
Builds the pathname of the structure file meant to hold results that are not necessarily fragments.
File inputFile
File containing the input for this task (i.e., a structure file)
String getWorkDirectory()
Gets the pathname to the working directory.
Logger getLogger()
Get the name of the program specific logger.
Parameters controlling execution of the fragmenter.
boolean doFiltering
Flag requesting to do post-fragmentation processing of fragments, i.e., application of all filtration...
boolean doFragmentation
Fag requesting the fragmentation of the structures.
Set< String > getPreFiltrationSMARTS()
A task that can throw exceptions.
int id
A user-assigned id for this task.
boolean completed
Flag about completion.
static synchronized int getUniqueTaskIndex()
Unique counter for tasks.