Package ffx.potential.cli
Class TopologyOptions
java.lang.Object
ffx.potential.cli.TopologyOptions
Represents command line options for scripts that utilize multiple physical topologies.
- Since:
- 1.0
- Author:
- Michael J. Schnieders, Jacob M. Litman
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassemblePotential(MolecularAssembly[] assemblies, StringBuilder sb) Performs the bulk of the work of setting up a multi-topology system.--ac2 or --alchemicalAtoms2 Specify alchemical atoms [ALL, NONE, Range(s): 1-3,6-N].--acRes2 or --alchemicalResidues2 Specify alchemical residues by chain and residue number [e.g.-sf or --switchingFunctionintgetNumberOfTopologies(List<String> topologyFilenames) Validate the number of topologies.Return the switching function between topology energies.intgetThreadsPerTopology(int nTopologies) The number of threads per topology.int--np or --nParallel sets the number of topologies to evaluate in parallel; currently 1, 2, or 4.intgetTopologiesInParallel(int nTopologies) The number of topologies to run in parallel.getTopology(MolecularAssembly[] topologies, UnivariateSwitchingFunction sf, List<Integer> uniqueA, List<Integer> uniqueB, int numParallel, StringBuilder sb) Configure a Dual-, Quad- or Oct- Topology.--uc2 or --unchargedAtoms2 Specify atoms without electrostatics [ALL, NONE, Range(s): 1-3,6-N].getUniqueAtoms(MolecularAssembly assembly, String label, String unshared) Collect unique atoms for a dual-topology.getUniqueAtomsA(MolecularAssembly topology) Collect unique atoms for the A dual-topology.getUniqueAtomsB(MolecularAssembly topology) Collect unique atoms for the B dual-topology.--uaA or --unsharedA sets atoms unique to the A dual-topology, as period-separated hyphenated ranges or singletons.--uaB or --unsharedB sets atoms unique to the A dual-topology, as period-separated hyphenated ranges or singletons.booleanIf any softcore Atoms have been detected.voidsetAlchemicalProperties(int numberOfTopologies) Relative free energies via the DualTopologyEnergy class require different default OST parameters than absolute free energies.voidsetSecondSystemAlchemistry(MolecularAssembly topology) Set the alchemical atoms for this topology.voidSet uncharged atoms for this topology.
-
Field Details
-
logger
The logger for this class.
-
-
Constructor Details
-
TopologyOptions
public TopologyOptions()
-
-
Method Details
-
getAlchemicalAtoms2
--ac2 or --alchemicalAtoms2 Specify alchemical atoms [ALL, NONE, Range(s): 1-3,6-N].- Returns:
- Returns alchemical atoms for the 2nd topology.
-
getAlchemicalResidues2
--acRes2 or --alchemicalResidues2 Specify alchemical residues by chain and residue number [e.g. A4,B21].- Returns:
- Returns alchemical residues for the 2nd topology.
-
getUnchargedAtoms2
--uc2 or --unchargedAtoms2 Specify atoms without electrostatics [ALL, NONE, Range(s): 1-3,6-N].- Returns:
- Returns atoms without electrostatics for the 2nd topology.
-
getTopologiesInParallel
public int getTopologiesInParallel()--np or --nParallel sets the number of topologies to evaluate in parallel; currently 1, 2, or 4.- Returns:
- Returns Number of topologies to evaluate in parallel.
-
getLambdaFunction
-sf or --switchingFunctionSets the switching function to be used by dual topologies.
- TRIG produces the function sin^2(pi/2*lambda)*E1(lambda) + cos^2(pi/2*lambda)*E2(1-lambda)
- MULT uses a 5th-order polynomial switching function with zero first and second derivatives at the end (same function as used for van der Waals switch)
- A number uses the original function, of l^beta*E1(lambda) + (1-lambda)^beta*E2(1-lambda).
All of these are generalizations of
Udt = f(l)*E1(l) + f(1-l)*E2(1-lambda), where f(l) is a continuous switching function such that f(0) = 0, f(1) = 1, and 0 <= f(l) <= 1 for lambda 0-1. The trigonometric switch can be restated thusly, since cos^2(pi/2*lambda) is identical to sin^2(pi/2*(1-lambda)), f(1-l).- Returns:
- Returns the lambda function.
-
getTopologiesInParallel
public int getTopologiesInParallel(int nTopologies) The number of topologies to run in parallel.- Parameters:
nTopologies- The number of topologies.- Returns:
- Number of topologies to run in parallel.
-
getThreadsPerTopology
public int getThreadsPerTopology(int nTopologies) The number of threads per topology.- Parameters:
nTopologies- The number of topologies.- Returns:
- Number of threads per topology.
-
getNumberOfTopologies
Validate the number of topologies.- Parameters:
topologyFilenames- List of topology filenames.- Returns:
- The number of topologies.
-
assemblePotential
Performs the bulk of the work of setting up a multi-topology system.The sb StringBuilder is often something like "Timing energy and gradients for". The method will append the exact type of Potential being assembled.
- Parameters:
assemblies- Opened MolecularAssembly(s).sb- A StringBuilder describing what is to be done.- Returns:
- a
Potentialobject.
-
getSwitchingFunction
Return the switching function between topology energies.- Returns:
- the switching function.
-
getUniqueAtomsA
Collect unique atoms for the A dual-topology.- Parameters:
topology- A MolecularAssembly from dual-topology A.- Returns:
- A List of Integers.
-
getTopology
public Potential getTopology(MolecularAssembly[] topologies, UnivariateSwitchingFunction sf, List<Integer> uniqueA, List<Integer> uniqueB, int numParallel, StringBuilder sb) Configure a Dual-, Quad- or Oct- Topology.- Parameters:
topologies- The topologies.sf- The Potential switching function.uniqueA- The unique atoms of topology A.uniqueB- The unique atoms of topology B.numParallel- The number of energies to evaluate in parallel.sb- A StringBuilder for logging.- Returns:
- The Potential for the Topology.
-
getUniqueAtoms
public static List<Integer> getUniqueAtoms(MolecularAssembly assembly, String label, String unshared) Collect unique atoms for a dual-topology. List MUST be sorted at the end.- Parameters:
assembly- A MolecularAssembly from the dual topology.label- Either 'A' or 'B'.unshared- Atoms this dual topology isn't sharing.- Returns:
- A sorted List of Integers.
-
getUniqueAtomsB
Collect unique atoms for the B dual-topology.- Parameters:
topology- A MolecularAssembly from dual-topology B.- Returns:
- A List of Integers.
-
hasSoftcore
public boolean hasSoftcore()If any softcore Atoms have been detected.- Returns:
- Presence of softcore Atoms.
-
setSecondSystemAlchemistry
Set the alchemical atoms for this topology.- Parameters:
topology- aMolecularAssemblyobject.
-
setSecondSystemUnchargedAtoms
Set uncharged atoms for this topology.- Parameters:
topology- aMolecularAssemblyobject.
-
setAlchemicalProperties
public void setAlchemicalProperties(int numberOfTopologies) Relative free energies via the DualTopologyEnergy class require different default OST parameters than absolute free energies.- Parameters:
numberOfTopologies- The number of topologies.
-