$darkmode
DENOPTIM
denoptim.integration.tinker.TinkerUtils Class Reference

Toolbox of utilities for Tinker style molecular representation. More...

Static Public Member Functions

static TinkerMolecule readTinkerIC (String filename) throws DENOPTIMException
 Reads a Tinker INT file. More...
 
static ArrayList< double[]> readTinkerXYZ (String filename) throws DENOPTIMException
 Read the tinker XYZ coordinate representation. More...
 
static void writeIC (String filename, TinkerMolecule tmol) throws DENOPTIMException
 Write Tinker INT file. More...
 
static ArrayList< Double > readPSSROTOutput (String filename) throws DENOPTIMException
 Read the PSSROT output file. More...
 
static void readPSSROTParams (String filename, ArrayList< String > initPars, ArrayList< String > restPars) throws DENOPTIMException
 Read the parameter settings to be used by PSSROT. More...
 
static HashMap< String, Integer > readTinkerAtomTypes (String filename) throws DENOPTIMException
 Read the Tinker atom mapping from Tinker Force Field. More...
 
static TinkerMolecule getICFromIAC (IAtomContainer mol, HashMap< String, Integer > tMap) throws DENOPTIMException
 Convert IAtomContainer to TinkerMolecule. More...
 
static void setTinkerTypes (TinkerMolecule tmol, HashMap< String, Integer > tMap) throws DENOPTIMException
 Conversion to tinker IC may not always have the necessary atom types. More...
 
static void ensureOutputExistsOrRelayError (String outputPathName, String logPathName, String taskName) throws TinkerException
 Check for the existence of an output file for a Tinker job and, if the output file is not found, this method throws an exception that contains the error message from Tinker job log. More...
 
static String getNameLastCycleFile (String workDir, String fname, String tinkerLog, String pattern) throws DENOPTIMException
 Identifies how many iteration Tinker has done by looking into the log file, searching for a given pattern. More...
 

Static Private Member Functions

static int getFirstRefAtomId (int i1, IAtomContainer mol)
 
static int getSecondRefAtomId (int i1, int i2, IAtomContainer mol)
 
static ObjectPair getThirdRefAtomId (int i1, int i2, int i3, IAtomContainer mol, TinkerMolecule tm) throws DENOPTIMException
 
static int countPredefinedNeighbours (int i, IAtom a, IAtomContainer mol)
 

Static Private Attributes

static final String NL = System.getProperty("line.separator")
 
static boolean debug = false
 

Detailed Description

Toolbox of utilities for Tinker style molecular representation.

Author
Vishwesh Venkatraman
Marco Foscato

Definition at line 54 of file TinkerUtils.java.

Member Function Documentation

◆ countPredefinedNeighbours()

static int denoptim.integration.tinker.TinkerUtils.countPredefinedNeighbours ( int  i,
IAtom  a,
IAtomContainer  mol 
)
staticprivate

Definition at line 990 of file TinkerUtils.java.

Referenced by denoptim.integration.tinker.TinkerUtils.getThirdRefAtomId().

Here is the caller graph for this function:

◆ ensureOutputExistsOrRelayError()

static void denoptim.integration.tinker.TinkerUtils.ensureOutputExistsOrRelayError ( String  outputPathName,
String  logPathName,
String  taskName 
) throws TinkerException
static

Check for the existence of an output file for a Tinker job and, if the output file is not found, this method throws an exception that contains the error message from Tinker job log.

Parameters
outputPathNamepathname of the Tinker output file that we expect to exist.
logPathNamepathname to the log of the Tinker job that was supposed to generate the output.
taskNamea string identifying the task that Tinker was supposed to perform.
Exceptions
TinkerExceptionif the output file is not found. This exception will contain the error from Tinker's log.

Definition at line 1063 of file TinkerUtils.java.

References denoptim.integration.tinker.TinkerUtils.NL.

Referenced by denoptim.integration.tinker.ConformationalSearchPSSROT.performPSSROT().

Here is the caller graph for this function:

◆ getFirstRefAtomId()

static int denoptim.integration.tinker.TinkerUtils.getFirstRefAtomId ( int  i1,
IAtomContainer  mol 
)
staticprivate

Definition at line 868 of file TinkerUtils.java.

Referenced by denoptim.integration.tinker.TinkerUtils.getICFromIAC().

Here is the caller graph for this function:

◆ getICFromIAC()

static TinkerMolecule denoptim.integration.tinker.TinkerUtils.getICFromIAC ( IAtomContainer  mol,
HashMap< String, Integer >  tMap 
) throws DENOPTIMException
static

Convert IAtomContainer to TinkerMolecule.

Supports only containers where all atoms are reachable following the connectivity and starting from any other atom in the container.

Parameters
molthe CDK molecule to convert
tMapthe atom type map
Returns
the molecule represented by internal coordinates

Definition at line 730 of file TinkerUtils.java.

References denoptim.integration.tinker.TinkerMolecule.addAtom(), denoptim.integration.tinker.TinkerMolecule.addBond(), denoptim.utils.MathUtils.angle(), denoptim.constants.DENOPTIMConstants.ATMPROPVERTEXID, denoptim.integration.tinker.TinkerUtils.debug, denoptim.utils.ObjectPair.getFirst(), denoptim.integration.tinker.TinkerUtils.getFirstRefAtomId(), denoptim.utils.ObjectPair.getSecond(), denoptim.integration.tinker.TinkerUtils.getSecondRefAtomId(), denoptim.utils.MoleculeUtils.getSymbolOrLabel(), denoptim.integration.tinker.TinkerUtils.getThirdRefAtomId(), denoptim.integration.tinker.TinkerMolecule.printIC(), denoptim.integration.tinker.TinkerUtils.setTinkerTypes(), denoptim.integration.tinker.TinkerAtom.setVertexId(), denoptim.utils.MathUtils.torsion(), and denoptim.integration.tinker.TinkerAtom.toString().

Referenced by denoptim.molecularmodeling.MultiMolecularModelBuilder.build3DTree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNameLastCycleFile()

static String denoptim.integration.tinker.TinkerUtils.getNameLastCycleFile ( String  workDir,
String  fname,
String  tinkerLog,
String  pattern 
) throws DENOPTIMException
static

Identifies how many iteration Tinker has done by looking into the log file, searching for a given pattern.

The resulting number of iterations is translated in the pathname of the last iteration file. The iteration files have names like
filename.000, filename.001, filename.002. So, if Tinker took 56 iteration, this method will return filename.055.

Parameters
workDirthe directory expected to contain the iteration files.
fnamethe basename of the iteration file.
tinkerLogthe log file where we count the iterations by searching the patters.
patternthe pattern to search in the log file
Returns
the pathname of the last cycle-file.
Exceptions
DENOPTIMException

Definition at line 1121 of file TinkerUtils.java.

References denoptim.molecularmodeling.MMBuilderUtils.countLinesWKeywordInFile(), and denoptim.utils.GeneralUtils.getPaddedString().

Referenced by denoptim.integration.tinker.ConformationalSearchPSSROT.performPSSROT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSecondRefAtomId()

static int denoptim.integration.tinker.TinkerUtils.getSecondRefAtomId ( int  i1,
int  i2,
IAtomContainer  mol 
)
staticprivate

Definition at line 886 of file TinkerUtils.java.

Referenced by denoptim.integration.tinker.TinkerUtils.getICFromIAC().

Here is the caller graph for this function:

◆ getThirdRefAtomId()

static ObjectPair denoptim.integration.tinker.TinkerUtils.getThirdRefAtomId ( int  i1,
int  i2,
int  i3,
IAtomContainer  mol,
TinkerMolecule  tm 
) throws DENOPTIMException
staticprivate

Definition at line 904 of file TinkerUtils.java.

References denoptim.utils.MathUtils.angle(), denoptim.integration.tinker.TinkerUtils.countPredefinedNeighbours(), denoptim.integration.tinker.TinkerUtils.debug, and denoptim.utils.MoleculeUtils.getSymbolOrLabel().

Referenced by denoptim.integration.tinker.TinkerUtils.getICFromIAC().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readPSSROTOutput()

static ArrayList< Double > denoptim.integration.tinker.TinkerUtils.readPSSROTOutput ( String  filename) throws DENOPTIMException
static

Read the PSSROT output file.

Parameters
filename
Returns
the list of energies
Exceptions
DENOPTIMException

Definition at line 505 of file TinkerUtils.java.

◆ readPSSROTParams()

static void denoptim.integration.tinker.TinkerUtils.readPSSROTParams ( String  filename,
ArrayList< String >  initPars,
ArrayList< String >  restPars 
) throws DENOPTIMException
static

Read the parameter settings to be used by PSSROT.

Parameters
filename
Returns
list of data
Exceptions
DENOPTIMException

Definition at line 564 of file TinkerUtils.java.

Referenced by denoptim.programs.moldecularmodelbuilder.MMBuilderParameters.processParameters().

Here is the caller graph for this function:

◆ readTinkerAtomTypes()

static HashMap< String, Integer > denoptim.integration.tinker.TinkerUtils.readTinkerAtomTypes ( String  filename) throws DENOPTIMException
static

Read the Tinker atom mapping from Tinker Force Field.

Parameters
filename
Returns
map of atom symbol and Tinker type
Exceptions
DENOPTIMException

Definition at line 637 of file TinkerUtils.java.

References denoptim.integration.tinker.TinkerUtils.NL.

Referenced by denoptim.programs.moldecularmodelbuilder.MMBuilderParameters.processParameters().

Here is the caller graph for this function:

◆ readTinkerIC()

static TinkerMolecule denoptim.integration.tinker.TinkerUtils.readTinkerIC ( String  filename) throws DENOPTIMException
static

Reads a Tinker INT file.

Example of Tinker INT file (i.e., internal coordinates)
8 Ethane
1 C 1
2 C 1 1 1.60000
3 H 5 1 1.10000 2 109.4700
4 H 5 1 1.10000 2 109.4700 3 109.4700 1
5 H 5 1 1.10000 2 109.4700 3 109.4700 -1
6 H 5 2 1.10000 1 109.4700 3 10.0000 0
7 H 5 2 1.10000 1 109.4700 6 109.4700 1
8 H 5 2 1.10000 1 109.4700 6 109.4700 -1

The first line, says that there are eight atoms in the system, and that the name of the molecule is Ethane Second line set the origin of the system, i.e., from which atom start to build the molecule: first atom is atom 1, which is a carbon atom, C, and its atom type for the force field is 1 Third line says that the second atom in the molecule is a carbon atom, C, having atom type 1, bonded to atom 1 placed at a distance of 1.6 Angstroms from the atom 1 Fourth line says that the third atom in the structure is an hydrogen atoms, H, having atom type 5, bonded to atom 1, placed at a distance of 1.1 Angstroms from atom 1 and forming an angle of 109.47 degrees with atom 2 Fifth line says that the fourth atom in the structure is an hydrogen atoms, H, having atom type 5, bonded to atom 1, placed at a distance of 1.1 Angstroms from atom 1, and forming an angle of 109.47 degrees with atom 2 Also, the dihedral angles between the planes defined by atoms 1 2 3 and 2 3 4 is 109.47 degrees The last column indicates the chirality flag The structure of this line is then repeated for all the remain atoms. Atom 1 has no internal coordinates at all. The coordinates of atom 1 are, by definition, Cartesian. Normally, the coordinates of atom 1 are (0,0,0), but can be set to any value desired. Atom 2 must be connected to atom 1 by an interatomic distance only. If atom 1 is not at the origin, then the care must be taken in defining atom 2: if internal coordinates are used, then the connectivity must be given. If the connectivity is not specified, then the coordinate of atom 2 is, by definition, Cartesian. Atom 3 can be connected to atom 1 or 2, and must make an angle with atom 2 or 1 (thus 3-2-1 or 3-1-2); no dihedral is possible for atom 3. For any one atom (i) this consists of an interatomic distance in Angstroms from an already-defined atom (j), an interatomic angle in degrees between atoms i and j and an already defined k, (k and j must be different atoms), and finally a torsional angle in degrees between atoms i, j, k, and an already defined atom l (l cannot be the same as k or j).

Parameters
filename

Definition at line 110 of file TinkerUtils.java.

References denoptim.integration.tinker.TinkerMolecule.setAtoms(), denoptim.integration.tinker.TinkerMolecule.setBondPairs(), and denoptim.integration.tinker.TinkerMolecule.setName().

Referenced by denoptim.integration.tinker.ConformationalSearchPSSROT.performPSSROT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readTinkerXYZ()

static ArrayList< double[]> denoptim.integration.tinker.TinkerUtils.readTinkerXYZ ( String  filename) throws DENOPTIMException
static

Read the tinker XYZ coordinate representation.

Parameters
filename
Returns
the 3d coordinates
Exceptions
DENOPTIMException

Definition at line 296 of file TinkerUtils.java.

◆ setTinkerTypes()

static void denoptim.integration.tinker.TinkerUtils.setTinkerTypes ( TinkerMolecule  tmol,
HashMap< String, Integer >  tMap 
) throws DENOPTIMException
static

Conversion to tinker IC may not always have the necessary atom types.

In order to fix this, we add user defined atom types.

Parameters
tmolThe tinker IC representation
Exceptions
DENOPTIMException

Definition at line 1011 of file TinkerUtils.java.

References denoptim.integration.tinker.TinkerUtils.debug, denoptim.integration.tinker.TinkerAtom.getAtomString(), and denoptim.integration.tinker.TinkerAtom.setAtomType().

Referenced by denoptim.molecularmodeling.MultiMolecularModelBuilder.build3DTree(), and denoptim.integration.tinker.TinkerUtils.getICFromIAC().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeIC()

static void denoptim.integration.tinker.TinkerUtils.writeIC ( String  filename,
TinkerMolecule  tmol 
) throws DENOPTIMException
static

Write Tinker INT file.

Parameters
filename
tmol
Exceptions
DENOPTIMException

Definition at line 380 of file TinkerUtils.java.

References denoptim.integration.tinker.TinkerAtom.getAtomNeighbours(), denoptim.integration.tinker.TinkerAtom.getAtomString(), denoptim.integration.tinker.TinkerAtom.getAtomType(), denoptim.integration.tinker.TinkerAtom.getDistAngle(), denoptim.integration.tinker.TinkerAtom.getXYZIndex(), and denoptim.integration.tinker.TinkerUtils.NL.

Referenced by denoptim.integration.tinker.ConformationalSearchPSSROT.performPSSROT().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ debug

boolean denoptim.integration.tinker.TinkerUtils.debug = false
staticprivate

◆ NL

final String denoptim.integration.tinker.TinkerUtils.NL = System.getProperty("line.separator")
staticprivate

The documentation for this class was generated from the following file: