20package denoptim.molecularmodeling;
22import java.util.ArrayList;
23import java.util.logging.Level;
24import java.util.logging.Logger;
26import org.openscience.cdk.interfaces.IAtom;
27import org.openscience.cdk.interfaces.IAtomContainer;
29import denoptim.constants.DENOPTIMConstants;
30import denoptim.exception.DENOPTIMException;
31import denoptim.fragspace.FragmentSpaceParameters;
32import denoptim.graph.DGraph;
33import denoptim.graph.rings.RingClosureParameters;
34import denoptim.integration.rcoserver.RCOSocketServerClient;
35import denoptim.integration.tinker.ConformationalSearchPSSROT;
36import denoptim.integration.tinker.TinkerException;
37import denoptim.io.DenoptimIO;
38import denoptim.molecularmodeling.zmatrix.ZMatrix;
39import denoptim.programs.RunTimeParameters.ParametersType;
40import denoptim.programs.moldecularmodelbuilder.MMBuilderParameters;
41import denoptim.utils.AtomOrganizer;
42import denoptim.utils.DummyAtomHandler;
43import denoptim.utils.ObjectPair;
44import denoptim.utils.RotationalSpaceUtils;
90 logger.log(Level.INFO,
"Building Multiple 3D representations for "
94 long startTime = System.nanoTime();
96 long endTime = System.nanoTime();
97 long time = (endTime - startTime);
99 logger.log(Level.FINE,
"TIME (build 3D model): " + time/1000000 +
" ms"
114 ArrayList<ChemicalObjectModel> structures =
new ArrayList<ChemicalObjectModel>();
115 boolean skipConfSearch =
false;
118 startTime = System.nanoTime();
120 endTime = System.nanoTime();
121 time = (endTime - startTime);
122 int numAllClosedCombs = 0;
125 Object o = rcMol.getIAtomContainer().getProperty(
130 logger.log(Level.FINE,
"TIME (close ring): "+time/1000000+
" ms"
134 +
" #allClosedRCSCombs: " + numAllClosedCombs);
137 logger.log(Level.INFO,
"No fully closed RCA combinaton. "
138 +
"Nothing to send to conformational search.");
139 skipConfSearch =
true;
148 skipConfSearch =
true;
153 structures =
new ArrayList<ChemicalObjectModel>();
154 structures.add(nMol);
164 startTime = System.nanoTime();
176 time = (endTime - startTime);
179 String msg =
"ERROR! Tinker failed on task '"
180 + te.taskName +
"'!";
183 msg = msg + settings.NL + te.
solution;
185 logger.log(Level.SEVERE, msg);
196 }
catch (Exception e) {
198 String msg =
"ERROR! RCOSocketServer failed!";
199 logger.log(Level.SEVERE, msg);
205 logger.log(Level.FINE,
"TIME (conf. search): "+time/1000000+
" ms"
212 ArrayList<IAtomContainer> results =
new ArrayList<IAtomContainer>();
217 IAtomContainer iac = mol3db.getIAtomContainer();
220 iac, mol3db.getOldToNewOrder(), mol3db.getNewToOldOrder());
221 iac = originalOrderMol;
234 StringBuilder sbMolProp =
new StringBuilder();
235 for (IAtom atm : iac.atoms())
237 sbMolProp.append(
" ").append(atm.getProperty(
241 sbMolProp.toString().trim());
278 logger.log(Level.FINEST,
"oldToNewMap: "+oldToNewMap);
292 logger.log(Level.FINE,
"Rotatable bonds: "+rotBonds);
293 if (
logger.isLoggable(Level.FINEST))
295 logger.log(Level.FINEST,
"Reordered IAtomContainer: 'iacToIC.sdf'");
General set of constants used in DENOPTIM.
static final String ATMPROPVERTEXID
String tag of Atom property used to store the unique ID of the Vertex corresponding to the molecular ...
static final String MOLERRORTAG
SDF tag containing errors during execution of molecule specific tasks.
static final String DUMMYATMSYMBOL
Symbol of dummy atom.
Parameters defining the fragment space.
Container for the list of vertices and the edges that connect them.
List< Vertex > getVertexList()
boolean hasOrEmbedsRings()
Check for rings in this graph and in any graph that is embedded at any level in any vertex of this gr...
Parameters and setting related to handling ring closures.
boolean requireCompleteRingclosure
Flag requesting complete ring closure of all pairs of RCAs in at least one combination of RCAs to con...
void allowRingClosures(boolean value)
Sends the request to produce a socket server running the RingClosingMM service.
static synchronized RCOSocketServerClient getInstance(String hostname, Integer port)
Gets the singleton instance of RCOSocketServerClient.
void runConformationalOptimization(ChemicalObjectModel chemObj, Logger logger)
Runs a conformational optimization using the services provided by the socket server configured for th...
Exceptions resulting from a failure of Tinker.
String solution
Proposed solution to the failure, or empty string.
Utility methods for input/output.
static void writeSDFFile(String fileName, IAtomContainer mol)
Writes IAtomContainer to SDF file.
Collector of molecular information, related to a single chemical object, that is deployed within the ...
ChemicalObjectModel deepcopy()
Return a new Molecule3DBuilder having exactly the same features of this Molecule3DBuilder.
DGraph getGraph()
Returns the graph representation of this molecule as it was originally generated by DEOPTIM.
List< ObjectPair > getRotatableBonds()
Returns the list of rotatable bonds.
List< Set< ObjectPair > > getRCACombinations()
Returns the list of combinations of RingClosingAttractor.
IAtomContainer getIAtomContainer()
Returns the CDK representation of the molecular system.
MultiMolecularModelBuilder(String molName, DGraph molGraph, MMBuilderParameters settings)
ChemicalObjectModel build3DTree()
Generate 3D structure by assembling 3D fragments according to attachment point vector and following t...
ArrayList< IAtomContainer > buildMulti3DStructure()
Given the graph representation of the molecular constitution, along with the 3D coordinates of the fr...
Logger logger
Program-specific logger.
MMBuilderParameters settings
Tool to build build three-dimensional (3D) tree-like molecular structures from DGraph.
IAtomContainer convertGraphTo3DAtomContainer(DGraph graph)
Created a three-dimensional molecular representation from a given DGraph.
Representation of an atom container's geometry with internal coordinates.
static ZMatrix getZMatrixFromIAC(IAtomContainer mol)
Convert IAtomContainer to ZMatrix.
boolean containsParameters(ParametersType type)
RunTimeParameters getParameters(ParametersType type)
Logger getLogger()
Get the name of the program specific logger.
Randomizer getRandomizer()
Returns the current program-specific randomizer.
Parameters for the conformer generator (3D builder).
ArrayList< String > getKeyFileParams()
ArrayList< String > getInitPSSROTParams()
Integer getRCOServerPort()
boolean getKeepDummyFlag()
String getWorkingDirectory()
ArrayList< String > getRestPSSROTParams()
HashMap< String, Integer > getTinkerMap()
String getRCOServerHostname()
int getAtomOrderingScheme()
Tool for re-organizing the list of atoms of an IAtomContainer
void setScheme(int scheme)
ArrayList< Integer > getNewToOldOrder(int seed)
Returns the list of indexes that allow to map the new atom position with the old one.
static IAtomContainer makeReorderedCopy(IAtomContainer original, List< Integer > newToOldOrder, List< Integer > oldToNewOrder)
Produces a new container that looks very similar to the original one, but has a different atom order.
IAtomContainer reorderStartingFrom(int seed, IAtomContainer mol)
Reorder the atoms in mol starting with atom seed
ArrayList< Integer > getOldToNewOrder(int seed)
Returns the list of indexes that allow to map the old atom position with the new one.
Toll to add/remove dummy atoms from linearities or multi-hapto sites.
IAtomContainer removeDummy(IAtomContainer mol)
Removes all dummy atoms and the bonds connecting them to other atoms.
IAtomContainer removeDummyInHapto(IAtomContainer mol)
Tool box for definition and management of the rotational space, which is given by the list of rotatab...
static void processConstrainedRotatableBonds(IAtomContainer mol, ArrayList< ObjectPair > rotatableBonds, String defRotBndContrFile, Logger logger)
Process the constrained rotatable bonds.
static ArrayList< ObjectPair > defineRotatableBonds(IAtomContainer mol, String defRotBndsFile, boolean addIterfragBonds, boolean excludeRings, Logger logger)
Define the rotational space (a.k.a.
Identifier of the type of parameters.
FS_PARAMS
Parameters pertaining the definition of the fragment space.
RC_PARAMS
Parameters pertaining to ring closures in graphs.