Class UIUtils
- All Implemented Interfaces:
AlgorithmFunctions
,PotentialsFunctions
- Author:
- Jacob M. Litman, Michael J. Schnieders
-
Field Summary
Fields inherited from interface ffx.potential.utils.PotentialsFunctions
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(MolecularAssembly assembly) Performs any necessary shutdown operations on a MolecularAssembly, primarily shutting down Parallel Java threads and closing any other open resources.void
closeAll
(MolecularAssembly[] assemblies) Performs any necessary shutdown operations on an array of MolecularAssembly, primarily shutting down Parallel Java threads and closing any other open resources.energy
(MolecularAssembly molecularAssembly) Evaluates the energy of a MolecularAssembly and returns its ForceFieldEnergy object.Returns either the active assembly from the overlying UI, or the "active" molecular assembly from the last used SystemFilter.If available, returns CLI arguments; default implementation does not have access to CLI arguments, and throws UnsupportedOperationException.Returns a default Listener if available (null by default).Returns the last SystemFilter created by this (can be null).boolean
isLocal()
True if using a local implementation (not in a user interfaces module).void
md
(MolecularAssembly assembly, int nStep, double timeStep, double printInterval, double saveInterval, double temperature, boolean initVelocities, File dyn) Runs molecular dynamics on an assembly.minimize
(MolecularAssembly assembly, double eps) Relax the coordinates of a MolecularAssembly and minimize its potential energyopen.Opens an array of files and returns all created MolecularAssembly objects, setting any underlying Potential to use a certain number of threads.Opens a file and returns all created MolecularAssembly objects.Opens an array of files and returns the created MolecularAssembly objects.Opens a file and returns all created MolecularAssembly objects, setting any underlying Potential to use a certain number of threads.openWithMutations
(File file, List<PDBFilter.Mutation> mutations) Mutates file on-the-fly as it is being opened.double
returnEnergy
(MolecularAssembly assembly) Returns the energy of a MolecularAssembly in kcal/mol (as a double) and prints the energy evaluationvoid
save
(MolecularAssembly assembly, File file) Saves the current state of a MolecularAssembly to an XYZ file.void
saveAsPDB
(MolecularAssembly[] assemblies, File file) Saves the current state of an array of MolecularAssembly instances to a PDB file.void
saveAsPDB
(MolecularAssembly assembly, File file) Saves the current state of a MolecularAssembly to a PDB file.void
saveAsPDB
(MolecularAssembly assembly, File file, boolean writeEnd, boolean append) void
saveAsPDBinP1
(MolecularAssembly assembly, File file) Saves the symmetry mates of a MolecularAssembly to PDB files.void
saveAsXYZ
(MolecularAssembly assembly, File file) Saves the current state of a MolecularAssembly to an XYZ file.void
saveAsXYZinP1
(MolecularAssembly assembly, File file) Saves the current state of a MolecularAssembly to an XYZ file as a P1 crystal.double
time()
Logs time elapsed since last call.Methods inherited from class ffx.potential.utils.PotentialsUtils
energy, open, openQuietly, saveAsPDBinP1, saveAsXYZasReplicates
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ffx.potential.utils.PotentialsFunctions
energy, saveAsXYZasReplicates, versionFile, versionFile
-
Constructor Details
-
UIUtils
-
-
Method Details
-
close
Description copied from class:PotentialsUtils
Performs any necessary shutdown operations on a MolecularAssembly, primarily shutting down Parallel Java threads and closing any other open resources.Shuts down parallel teams in the force field of the provided MolecularAssembly. Kaminsky's ParallelTeamThreads' run() methods are infinite loops, and because running threads are always GC roots, it is necessary to send them a signal to shut down to enable garbage collection.
- Specified by:
close
in interfacePotentialsFunctions
- Overrides:
close
in classPotentialsUtils
- Parameters:
assembly
- Assembly to close.
-
closeAll
Description copied from class:PotentialsUtils
Performs any necessary shutdown operations on an array of MolecularAssembly, primarily shutting down Parallel Java threads and closing any other open resources.Shuts down parallel teams in the force fields of the provided MolecularAssemblys.
- Specified by:
closeAll
in interfacePotentialsFunctions
- Overrides:
closeAll
in classPotentialsUtils
- Parameters:
assemblies
- Assemblies to close.
-
energy
Description copied from class:PotentialsUtils
Evaluates the energy of a MolecularAssembly and returns its ForceFieldEnergy object.Evaluates the energy of a MolecularAssembly and returns its ForceFieldEnergy object.
- Specified by:
energy
in interfacePotentialsFunctions
- Overrides:
energy
in classPotentialsUtils
- Parameters:
molecularAssembly
- To evaluate- Returns:
- assembly's ForceFieldEnergy.
-
getActiveAssembly
Description copied from interface:PotentialsFunctions
Returns either the active assembly from the overlying UI, or the "active" molecular assembly from the last used SystemFilter.- Specified by:
getActiveAssembly
in interfacePotentialsFunctions
- Returns:
- A MolecularAssembly or null
-
getArguments
Description copied from interface:PotentialsFunctions
If available, returns CLI arguments; default implementation does not have access to CLI arguments, and throws UnsupportedOperationException.- Specified by:
getArguments
in interfacePotentialsFunctions
- Returns:
- CLI arguments
-
getDefaultListener
Description copied from interface:AlgorithmFunctions
Returns a default Listener if available (null by default).- Specified by:
getDefaultListener
in interfaceAlgorithmFunctions
- Returns:
- An AlgorithmListener or null.
-
getFilter
Description copied from class:PotentialsUtils
Returns the last SystemFilter created by this (can be null).- Specified by:
getFilter
in interfacePotentialsFunctions
- Overrides:
getFilter
in classPotentialsUtils
- Returns:
- Last SystemFilter
-
isLocal
public boolean isLocal()Description copied from class:PotentialsUtils
True if using a local implementation (not in a user interfaces module).Returns true (this is the local implementation).
- Specified by:
isLocal
in interfacePotentialsFunctions
- Overrides:
isLocal
in classPotentialsUtils
- Returns:
- If a local implementation
-
md
public void md(MolecularAssembly assembly, int nStep, double timeStep, double printInterval, double saveInterval, double temperature, boolean initVelocities, File dyn) Description copied from class:AlgorithmUtils
Runs molecular dynamics on an assembly.Performs molecular dynamics on a MolecularAssembly.
- Specified by:
md
in interfaceAlgorithmFunctions
- Overrides:
md
in classAlgorithmUtils
- Parameters:
assembly
- aMolecularAssembly
object.nStep
- TimestepstimeStep
- Time per stepprintInterval
- a double.saveInterval
- a double.temperature
- a double.initVelocities
- Initialize velocities from Maxwell-Boltzmann distributiondyn
- Dynamics file
-
minimize
Description copied from class:AlgorithmUtils
Relax the coordinates of a MolecularAssembly and minimize its potential energyMinimizes a MolecularAssembly using AMOEBA potential energy.
- Specified by:
minimize
in interfaceAlgorithmFunctions
- Overrides:
minimize
in classAlgorithmUtils
- Parameters:
assembly
- aMolecularAssembly
object.eps
- RMS gradient convergence criteria- Returns:
- A
Potential
-
open
Description copied from class:PotentialsUtils
Opens an array of files and returns all created MolecularAssembly objects, setting any underlying Potential to use a certain number of threads. Default implementation simply ignores nThreads.Opens an array of files and returns all created MolecularAssembly objects, setting any underlying Potential to use a certain number of threads.
- Specified by:
open
in interfacePotentialsFunctions
- Overrides:
open
in classPotentialsUtils
- Parameters:
files
- an array ofString
objects.nThreads
- Use non-default num threads- Returns:
- Array of MolecularAssembly.
-
open
Description copied from class:PotentialsUtils
open.- Specified by:
open
in interfacePotentialsFunctions
- Overrides:
open
in classPotentialsUtils
- Parameters:
file
- aString
object.- Returns:
- a
MolecularAssembly
object.
-
openAll
Description copied from class:PotentialsUtils
Opens a file and returns all created MolecularAssembly objects.Opens a file and returns all created MolecularAssembly objects.
- Specified by:
openAll
in interfacePotentialsFunctions
- Overrides:
openAll
in classPotentialsUtils
- Parameters:
file
- Filename to open- Returns:
- Array of MolecularAssembly.
-
openAll
Description copied from class:PotentialsUtils
Opens an array of files and returns the created MolecularAssembly objects.Opens an array of files and returns the created MolecularAssembly objects.
- Specified by:
openAll
in interfacePotentialsFunctions
- Overrides:
openAll
in classPotentialsUtils
- Parameters:
files
- Filenames to open.- Returns:
- Array of MolecularAssembly.
-
openAll
Description copied from class:PotentialsUtils
Opens a file and returns all created MolecularAssembly objects, setting any underlying Potential to use a certain number of threads. Default implementation simply ignores nThreads.Opens a file and returns all created MolecularAssembly objects, setting any underlying Potential to use a certain number of threads.
- Specified by:
openAll
in interfacePotentialsFunctions
- Overrides:
openAll
in classPotentialsUtils
- Parameters:
file
- Filename to opennThreads
- Use non-default num threads- Returns:
- Array of MolecularAssembly.
-
openWithMutations
Mutates file on-the-fly as it is being opened. Used to open files for pHMD in fully-protonated form.- Overrides:
openWithMutations
in classPotentialsUtils
- Parameters:
file
- aFile
object.mutations
- aList
object.- Returns:
- a
MolecularAssembly
object.
-
returnEnergy
Description copied from class:PotentialsUtils
Returns the energy of a MolecularAssembly in kcal/mol (as a double) and prints the energy evaluationReturns the energy of a MolecularAssembly in kcal/mol (as a double) and prints the energy evaluation
- Specified by:
returnEnergy
in interfacePotentialsFunctions
- Overrides:
returnEnergy
in classPotentialsUtils
- Parameters:
assembly
- To evaluate energy of- Returns:
- Potential energy (kcal/mol)
-
save
Description copied from class:PotentialsUtils
Saves the current state of a MolecularAssembly to an XYZ file.Saves the current state of a MolecularAssembly to an XYZ file.
- Specified by:
save
in interfacePotentialsFunctions
- Overrides:
save
in classPotentialsUtils
- Parameters:
assembly
- MolecularAssembly to savefile
- Destination .xyz
-
saveAsXYZinP1
Description copied from class:PotentialsUtils
Saves the current state of a MolecularAssembly to an XYZ file as a P1 crystal.Saves the current state of a MolecularAssembly to an XYZ file as a P1 crystal.
- Specified by:
saveAsXYZinP1
in interfacePotentialsFunctions
- Overrides:
saveAsXYZinP1
in classPotentialsUtils
- Parameters:
assembly
- MolecularAssembly to savefile
- Destination .xyz
-
saveAsPDB
Description copied from class:PotentialsUtils
Saves the current state of a MolecularAssembly to a PDB file.Saves the current state of a MolecularAssembly to a PDB file.
- Specified by:
saveAsPDB
in interfacePotentialsFunctions
- Overrides:
saveAsPDB
in classPotentialsUtils
- Parameters:
assembly
- MolecularAssembly to savefile
- Destination .pdb
-
saveAsPDB
Description copied from class:PotentialsUtils
Saves the current state of a MolecularAssembly to a PDB file.
- Specified by:
saveAsPDB
in interfacePotentialsFunctions
- Overrides:
saveAsPDB
in classPotentialsUtils
-
saveAsPDB
Description copied from class:PotentialsUtils
Saves the current state of an array of MolecularAssembly instances to a PDB file.Saves the current state of an array of MolecularAssemblys to a PDB file.
- Specified by:
saveAsPDB
in interfacePotentialsFunctions
- Overrides:
saveAsPDB
in classPotentialsUtils
- Parameters:
assemblies
- MolecularAssembly array to savefile
- Destination .pdb
-
saveAsXYZ
Description copied from class:PotentialsUtils
Saves the current state of a MolecularAssembly to an XYZ file.Saves the current state of a MolecularAssembly to an XYZ file.
- Specified by:
saveAsXYZ
in interfacePotentialsFunctions
- Overrides:
saveAsXYZ
in classPotentialsUtils
- Parameters:
assembly
- MolecularAssembly to savefile
- Destination .xyz
-
saveAsPDBinP1
Description copied from class:PotentialsUtils
Saves the symmetry mates of a MolecularAssembly to PDB files.- Specified by:
saveAsPDBinP1
in interfacePotentialsFunctions
- Overrides:
saveAsPDBinP1
in classPotentialsUtils
- Parameters:
assembly
- To savefile
- Destination file
-
time
public double time()Description copied from class:AlgorithmUtils
Logs time elapsed since last call.Logs time since this interface was created and the last time this method was called.
Logs time since this interface was created and the last time this method was called. May be more elegant to replace this by using protected variables and simply inheriting the time() function.
- Specified by:
time
in interfacePotentialsFunctions
- Overrides:
time
in classAlgorithmUtils
- Returns:
- Time.
-