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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(MolecularAssembly assembly) Performs any necessary shutdown operations on a MolecularAssembly, primarily shutting down Parallel Java threads and closing any other open resources.voidcloseAll(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; the 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).booleanisLocal()True if using a local implementation (not in a user interfaces module).voidmd(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.doublereturnEnergy(MolecularAssembly assembly) Returns the energy of a MolecularAssembly in kcal/mol (as a double) and prints the energy evaluationvoidsave(MolecularAssembly assembly, File file) Saves the current state of a MolecularAssembly to an XYZ file.voidsaveAsPDB(MolecularAssembly[] assemblies, File file) Saves the current state of an array of MolecularAssembly instances to a PDB file.voidsaveAsPDB(MolecularAssembly assembly, File file) Saves the current state of a MolecularAssembly to a PDB file.voidsaveAsPDB(MolecularAssembly assembly, File file, boolean writeEnd, boolean append) voidsaveAsPDBinP1(MolecularAssembly assembly, File file) Saves the symmetry mates of a MolecularAssembly to PDB files.voidsaveAsXYZ(MolecularAssembly assembly, File file) Saves the current state of a MolecularAssembly to an XYZ file.voidsaveAsXYZinP1(MolecularAssembly assembly, File file) Saves the current state of a MolecularAssembly to an XYZ file as a P1 crystal.doubletime()Logs time elapsed since last call.Methods inherited from class ffx.potential.utils.PotentialsUtils
energy, open, openQuietly, saveAsPDBinP1, saveAsXYZasReplicatesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ffx.potential.utils.PotentialsFunctions
energy, saveAsXYZasReplicates, versionFile, versionFile
-
Constructor Details
-
UIUtils
-
-
Method Details
-
close
Description copied from class:PotentialsUtilsPerforms 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:
closein interfacePotentialsFunctions- Overrides:
closein classPotentialsUtils- Parameters:
assembly- Assembly to close.
-
closeAll
Description copied from class:PotentialsUtilsPerforms 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:
closeAllin interfacePotentialsFunctions- Overrides:
closeAllin classPotentialsUtils- Parameters:
assemblies- Assemblies to close.
-
energy
Description copied from class:PotentialsUtilsEvaluates the energy of a MolecularAssembly and returns its ForceFieldEnergy object.Evaluates the energy of a MolecularAssembly and returns its ForceFieldEnergy object.
- Specified by:
energyin interfacePotentialsFunctions- Overrides:
energyin classPotentialsUtils- Parameters:
molecularAssembly- To evaluate- Returns:
- assembly's ForceFieldEnergy.
-
getActiveAssembly
Description copied from interface:PotentialsFunctionsReturns either the active assembly from the overlying UI, or the "active" molecular assembly from the last used SystemFilter.- Specified by:
getActiveAssemblyin interfacePotentialsFunctions- Returns:
- A MolecularAssembly or null
-
getArguments
Description copied from interface:PotentialsFunctionsIf available, returns CLI arguments; the default implementation does not have access to CLI arguments and throws UnsupportedOperationException.- Specified by:
getArgumentsin interfacePotentialsFunctions- Returns:
- CLI arguments
-
getDefaultListener
Description copied from interface:AlgorithmFunctionsReturns a default Listener if available (null by default).- Specified by:
getDefaultListenerin interfaceAlgorithmFunctions- Returns:
- An AlgorithmListener or null.
-
getFilter
Description copied from class:PotentialsUtilsReturns the last SystemFilter created by this (can be null).- Specified by:
getFilterin interfacePotentialsFunctions- Overrides:
getFilterin classPotentialsUtils- Returns:
- Last SystemFilter
-
isLocal
public boolean isLocal()Description copied from class:PotentialsUtilsTrue if using a local implementation (not in a user interfaces module).Returns true (this is the local implementation).
- Specified by:
isLocalin interfacePotentialsFunctions- Overrides:
isLocalin 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:AlgorithmUtilsRuns molecular dynamics on an assembly.Performs molecular dynamics on a MolecularAssembly.
- Specified by:
mdin interfaceAlgorithmFunctions- Overrides:
mdin classAlgorithmUtils- Parameters:
assembly- aMolecularAssemblyobject.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:AlgorithmUtilsRelax the coordinates of a MolecularAssembly and minimize its potential energyMinimizes a MolecularAssembly using AMOEBA potential energy.
- Specified by:
minimizein interfaceAlgorithmFunctions- Overrides:
minimizein classAlgorithmUtils- Parameters:
assembly- aMolecularAssemblyobject.eps- RMS gradient convergence criteria- Returns:
- A
Potential
-
open
Description copied from class:PotentialsUtilsOpens 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:
openin interfacePotentialsFunctions- Overrides:
openin classPotentialsUtils- Parameters:
files- an array ofStringobjects.nThreads- Use non-default num threads- Returns:
- Array of MolecularAssembly.
-
open
Description copied from class:PotentialsUtilsopen.- Specified by:
openin interfacePotentialsFunctions- Overrides:
openin classPotentialsUtils- Parameters:
file- aStringobject.- Returns:
- a
MolecularAssemblyobject.
-
openAll
Description copied from class:PotentialsUtilsOpens a file and returns all created MolecularAssembly objects.Opens a file and returns all created MolecularAssembly objects.
- Specified by:
openAllin interfacePotentialsFunctions- Overrides:
openAllin classPotentialsUtils- Parameters:
file- Filename to open- Returns:
- Array of MolecularAssembly.
-
openAll
Description copied from class:PotentialsUtilsOpens an array of files and returns the created MolecularAssembly objects.Opens an array of files and returns the created MolecularAssembly objects.
- Specified by:
openAllin interfacePotentialsFunctions- Overrides:
openAllin classPotentialsUtils- Parameters:
files- Filenames to open.- Returns:
- Array of MolecularAssembly.
-
openAll
Description copied from class:PotentialsUtilsOpens 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:
openAllin interfacePotentialsFunctions- Overrides:
openAllin 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:
openWithMutationsin classPotentialsUtils- Parameters:
file- aFileobject.mutations- aListobject.- Returns:
- a
MolecularAssemblyobject.
-
returnEnergy
Description copied from class:PotentialsUtilsReturns 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:
returnEnergyin interfacePotentialsFunctions- Overrides:
returnEnergyin classPotentialsUtils- Parameters:
assembly- To evaluate energy of- Returns:
- Potential energy (kcal/mol)
-
save
Description copied from class:PotentialsUtilsSaves the current state of a MolecularAssembly to an XYZ file.Saves the current state of a MolecularAssembly to an XYZ file.
- Specified by:
savein interfacePotentialsFunctions- Overrides:
savein classPotentialsUtils- Parameters:
assembly- MolecularAssembly to savefile- Destination .xyz
-
saveAsXYZinP1
Description copied from class:PotentialsUtilsSaves 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:
saveAsXYZinP1in interfacePotentialsFunctions- Overrides:
saveAsXYZinP1in classPotentialsUtils- Parameters:
assembly- MolecularAssembly to savefile- Destination .xyz
-
saveAsPDB
Description copied from class:PotentialsUtilsSaves the current state of a MolecularAssembly to a PDB file.Saves the current state of a MolecularAssembly to a PDB file.
- Specified by:
saveAsPDBin interfacePotentialsFunctions- Overrides:
saveAsPDBin classPotentialsUtils- Parameters:
assembly- MolecularAssembly to savefile- Destination .pdb
-
saveAsPDB
Description copied from class:PotentialsUtilsSaves the current state of a MolecularAssembly to a PDB file.
- Specified by:
saveAsPDBin interfacePotentialsFunctions- Overrides:
saveAsPDBin classPotentialsUtils
-
saveAsPDB
Description copied from class:PotentialsUtilsSaves 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:
saveAsPDBin interfacePotentialsFunctions- Overrides:
saveAsPDBin classPotentialsUtils- Parameters:
assemblies- MolecularAssembly array to savefile- Destination .pdb
-
saveAsXYZ
Description copied from class:PotentialsUtilsSaves the current state of a MolecularAssembly to an XYZ file.Saves the current state of a MolecularAssembly to an XYZ file.
- Specified by:
saveAsXYZin interfacePotentialsFunctions- Overrides:
saveAsXYZin classPotentialsUtils- Parameters:
assembly- MolecularAssembly to savefile- Destination .xyz
-
saveAsPDBinP1
Description copied from class:PotentialsUtilsSaves the symmetry mates of a MolecularAssembly to PDB files.- Specified by:
saveAsPDBinP1in interfacePotentialsFunctions- Overrides:
saveAsPDBinP1in classPotentialsUtils- Parameters:
assembly- To savefile- Destination file
-
time
public double time()Description copied from class:AlgorithmUtilsLogs 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:
timein interfacePotentialsFunctions- Overrides:
timein classAlgorithmUtils- Returns:
- Time.
-