$darkmode
DENOPTIM
Fragmenter.java
Go to the documentation of this file.
1/*
2 * DENOPTIM
3 * Copyright (C) 2022 Marco Foscato <marco.foscato@uib.no>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package denoptim.programs.fragmenter;
20
21import java.io.File;
22import java.util.List;
23
24import denoptim.fragmenter.ConformerExtractorTask;
25import denoptim.fragmenter.ParallelFragmentationAlgorithm;
26import denoptim.graph.Vertex;
27import denoptim.graph.Vertex.BBType;
28import denoptim.io.DenoptimIO;
29import denoptim.task.ProgramTask;
30
31
38public class Fragmenter extends ProgramTask
39{
41
42//------------------------------------------------------------------------------
43
49 public Fragmenter(File configFile, File workDir)
50 {
51 super(configFile, workDir);
52 }
53
54//------------------------------------------------------------------------------
55
56 @Override
57 public void runProgram() throws Throwable
58 {
60 if (workDir != null)
61 {
62 settings.setWorkDirectory(workDir.getAbsolutePath());
63 }
64 settings.readParameterFile(configFilePathName.getAbsolutePath());
65 settings.checkParameters();
66 settings.processParameters();
68 settings.printParameters();
69
70 if (settings.isStandaloneFragmentClustering())
71 {
72 List<Vertex> fragments = DenoptimIO.readVertexes(
73 new File(settings.getStructuresFile()), BBType.UNDEFINED);
75 settings);
76 cet.call();
77 } else {
80 }
81
82 stopLogger();
83 }
84
85//------------------------------------------------------------------------------
86
87 protected void handleThrowable()
88 {
89 if (fragAlgorithm != null)
90 {
92 }
93 super.handleThrowable();
94 }
95
96//------------------------------------------------------------------------------
97
98}
Task that analyzes an isomorphic family of fragments to identify the most representative fragment (i....
Fragments a list of chemical systems by running parallel fragmentation tasks.
Utility methods for input/output.
static ArrayList< Vertex > readVertexes(File file, Vertex.BBType bbt)
Reads Vertexes from any file that can contain such items.
Logger startProgramSpecificLogger(String loggerIdentifier)
Starts a logger with the given name.
void readParameterFile(String infile)
Read the parameter TXT file line by line and interpret its content.
void printParameters()
Print all parameters.
void setWorkDirectory(String pathname)
Gets the pathname to the working directory.
Tool to create fragments by chopping 2D/3D chemical structures.
Definition: Fragmenter.java:39
void handleThrowable()
Method to handle any Throwable originated from the runProgram() method.
Definition: Fragmenter.java:87
Fragmenter(File configFile, File workDir)
Creates and configures the program task.
Definition: Fragmenter.java:49
ParallelFragmentationAlgorithm fragAlgorithm
Definition: Fragmenter.java:40
Parameters controlling execution of the fragmenter.
void checkParameters()
Evaluate consistency of input parameters.
boolean isStandaloneFragmentClustering
Flag requesting to run fragment clusterer in stand-alone fashion.
void processParameters()
Processes all parameters and initialize related objects.
void stopRun()
Stops all subtasks and shutdown executor.
Task structure for any of the main programs in the denoptim project, such as genetic algorithm and co...
String loggerIdentifier
Identifier of this program's logger.
void stopLogger()
Stops the program-specific logger and releases the lock file on the logfile.
File configFilePathName
File containing configuration parameters for the program task.
File workDir
The file system location where we want to be placed when doing the work.
Definition: Task.java:78
The type of building block.
Definition: Vertex.java:86