Package ffx.algorithms.optimize.manybody
Class EnergyExpansion
java.lang.Object
ffx.algorithms.optimize.manybody.EnergyExpansion
-
Constructor Summary
ConstructorDescriptionEnergyExpansion
(RotamerOptimization rO, DistanceMatrix dM, EliminatedRotamers eR, MolecularAssembly molecularAssembly, Potential potential, AlgorithmListener algorithmListener, List<Residue> allResiduesList, int[][] resNeighbors, boolean threeBodyTerm, boolean decomposeOriginal, boolean usingBoxOptimization, boolean verbose, boolean pruneClashes, boolean prunePairClashes, boolean master) -
Method Summary
Modifier and TypeMethodDescriptionallocate2BodyJobMap
(Residue[] residues, int nResidues, boolean reverseMap) allocate3BodyJobMap
(Residue[] residues, int nResidues, boolean reverseMap) void
allocate4BodyJobMap
(Residue[] residues, int nResidues) allocateSelfJobMap
(Residue[] residues, int nResidues, boolean reverseMap) double
compute2BodyEnergy
(Residue[] residues, int i, int ri, int j, int rj) Computes a pair energy, defined as energy with all side-chains but two turned off, minus the sum of backbone and component self energies.double
compute3BodyEnergy
(Residue[] residues, int i, int ri, int j, int rj, int k, int rk) Computes a 3-body energy, defined as the energy with all sidechains but three turned off, minus the sum of backbone and component self/2-Body energies.double
compute4BodyEnergy
(Residue[] residues, int i, int ri, int j, int rj, int k, int rk, int l, int rl) Computes a 4-body energy, defined as the energy with all sidechains but four turned off, minus the sum of backbone and component self/2-Body/3-body energies.double
computeSelfEnergy
(Residue[] residues, int i, int ri) Computes a self energy, defined as energy with all side-chains but one turned off, minus the backbone energy.double
get2Body
(int i, int ri, int j, int rj) Return a previously computed 2-body energy.double
Return a previously computed 3-body energy.double
double
getSelf
(int i, int ri) Return a previously computed self-energy.double
Return a previously computed self-energy.double
getTotalRotamerPhBias
(List<Residue> residues, int[] rotamers, double pH, double KpH) Compute the total rotamer Ph bias for an array of residues.int
loadEnergyRestart
(File restartFile, Residue[] residues) int
loadEnergyRestart
(File restartFile, Residue[] residues, int boxIteration, int[] cellIndices) double
lowestPairEnergy
(Residue[] residues, int i, int ri, int j) Return the lowest pair-energy for residue (i,ri) with residue j.double
lowestSelfEnergy
(Residue[] residues, int i) Return the lowest self-energy for residue i.boolean
Calculates the minimum and maximum summations over additional residues for some pair ri-rj.boolean
minMaxPairEnergy
(Residue[] residues, double[] minMax, int i, int ri, int j) Computes the maximum and minimum energy i,ri might have with j, and optionally (if three-body energies in use) third residues k.void
set2Body
(int i, int ri, int j, int rj, double e) void
set2Body
(int i, int ri, int j, int rj, double e, boolean quiet) Store a pair energy in the pairs energy matrix.void
set3Body.void
Stores a triple energy in the triples energy matrix.void
setBackboneEnergy
(double backboneEnergy) void
setSelf
(int i, int ri, double e) void
setSelf
(int i, int ri, double e, boolean quiet) Stores a self energy in the self energy matrix.void
turnOffAllResidues
(Residue[] residues) void
turnOffResidue
(Residue residue) void
turnOnAllResidues
(Residue[] residues) void
turnOnResidue
(Residue residue, int ri)
-
Constructor Details
-
EnergyExpansion
public EnergyExpansion(RotamerOptimization rO, DistanceMatrix dM, EliminatedRotamers eR, MolecularAssembly molecularAssembly, Potential potential, AlgorithmListener algorithmListener, List<Residue> allResiduesList, int[][] resNeighbors, boolean threeBodyTerm, boolean decomposeOriginal, boolean usingBoxOptimization, boolean verbose, boolean pruneClashes, boolean prunePairClashes, boolean master)
-
-
Method Details
-
allocate2BodyJobMap
-
allocate3BodyJobMap
-
allocate4BodyJobMap
-
allocateSelfJobMap
-
compute2BodyEnergy
Computes a pair energy, defined as energy with all side-chains but two turned off, minus the sum of backbone and component self energies.- Parameters:
residues
- Residues under optimization.i
- A residue index.ri
- A rotamer index for residue i.j
- A residue index j!=i.rj
- A rotamer index for residue j.- Returns:
- Epair(ri, rj)=E2(ri,rj)-Eself(ri)-Eself(rj)-Eenv/bb.
-
compute3BodyEnergy
Computes a 3-body energy, defined as the energy with all sidechains but three turned off, minus the sum of backbone and component self/2-Body energies.- Parameters:
residues
- Residues under optimization.i
- A residue index.ri
- A rotamer index for residue i.j
- A residue index j!=i.rj
- A rotamer index for residue j.k
- A residue index k!=j k!=i.rk
- A rotamer index for residue k.- Returns:
- Etri(ri, rj)=E3(ri,rj,rk)-Epair(ri,rj)-Epair(ri,rk)-Epair(rj,rk)-Eself(ri)-Eself(rj)-Eself(rk)-Eenv/bb.
-
compute4BodyEnergy
public double compute4BodyEnergy(Residue[] residues, int i, int ri, int j, int rj, int k, int rk, int l, int rl) Computes a 4-body energy, defined as the energy with all sidechains but four turned off, minus the sum of backbone and component self/2-Body/3-body energies.- Parameters:
residues
- Residues under optimization.i
- A residue index.ri
- A rotamer index for residue i.j
- A residue index j!=i.rj
- A rotamer index for residue j.k
- A residue index k!=j k!=i.rk
- A rotamer index for residue k.l
- A residue index l!=i l!=j l!=k.rl
- A rotamer index for residue l.- Returns:
- The 4-body energy.
-
computeSelfEnergy
Computes a self energy, defined as energy with all side-chains but one turned off, minus the backbone energy.If a residue has multiple titration states represented by its set of rotamers, then a pH-dependent bias is included.
- Parameters:
residues
- Residues under optimization.i
- A residue index.ri
- A rotamer index for residue i.- Returns:
- Eself(ri)=E1(ri)-Eenv/bb.
-
getTotalRotamerPhBias
Compute the total rotamer Ph bias for an array of residues.- Parameters:
residues
- The array of residues.rotamers
- The array of rotamer indices for each residue.- Returns:
- The total Ph bias.
-
get2Body
public double get2Body(int i, int ri, int j, int rj) Return a previously computed 2-body energy.- Parameters:
i
- Residue i.ri
- Rotamer ri of residue i.j
- Residue j.rj
- Rotamer rj of residue j.- Returns:
- The 2-Body energy.
-
get3Body
Return a previously computed 3-body energy.- Parameters:
residues
- an array ofResidue
objects.i
- Residue i.ri
- Rotamer ri of residue i.j
- Residue j.rj
- Rotamer rj of residue j.k
- Residue k.rk
- Rotamer rk of residue k.- Returns:
- The 3-Body energy.
-
getBackboneEnergy
public double getBackboneEnergy() -
setBackboneEnergy
public void setBackboneEnergy(double backboneEnergy) -
getFourBodyEnergyMap
-
getSelf
public double getSelf(int i, int ri) Return a previously computed self-energy.- Parameters:
i
- Residue i.ri
- Rotamer ri of residue i.- Returns:
- The self-energy.
-
getSelf
Return a previously computed self-energy.- Parameters:
i
- Residue i.ri
- Rotamer ri of residue i.- Returns:
- The self-energy.
-
getSelfEnergyMap
-
getThreeBodyEnergyMap
-
getTwoBodyEnergyMap
-
loadEnergyRestart
-
loadEnergyRestart
-
lowestPairEnergy
Return the lowest pair-energy for residue (i,ri) with residue j.- Parameters:
residues
- Residue array.i
- Residue i index.ri
- Residue i rotamer index.j
- Residue j index.- Returns:
- Lowest pair energy.
-
lowestSelfEnergy
Return the lowest self-energy for residue i.- Parameters:
residues
- Array if residues.i
- Index of residue i.- Returns:
- Returns the lowest self-energy for residue i.
-
minMaxE2
public boolean minMaxE2(Residue[] residues, double[] minMax, int i, int ri, int j, int rj) throws IllegalArgumentException Calculates the minimum and maximum summations over additional residues for some pair ri-rj.- Parameters:
residues
- Residues under consideration.minMax
- Result array: 0 is min summation, 1 max summation.i
- Residue i.ri
- Rotamer for residue i.j
- Residue j!=i.rj
- Rotamer for residue j.- Returns:
- False if ri-rj always clashes with other residues.
- Throws:
IllegalArgumentException
- If ri, rj, or ri-rj eliminated.
-
minMaxPairEnergy
Computes the maximum and minimum energy i,ri might have with j, and optionally (if three-body energies in use) third residues k.The return value should be redundant with minMax[0] being NaN.
- Parameters:
residues
- Array of residues under consideration.minMax
- Index 0 to be filled by minimum energy, index 1 filled by maximum energy.i
- Some residue i under consideration.ri
- A rotamer for residue i.j
- Some arbitrary residue i!=j.- Returns:
- If a valid configuration between i,ri and j could be found.
-
set2Body
public void set2Body(int i, int ri, int j, int rj, double e) -
set2Body
public void set2Body(int i, int ri, int j, int rj, double e, boolean quiet) Store a pair energy in the pairs energy matrix.- Parameters:
i
- A residue index.ri
- A rotamer for residue i.j
- A residue index j != i.rj
- A rotamer for residue j.e
- Computed energy to store.quiet
- Silence warnings about exceptions.
-
set3Body
set3Body.- Parameters:
residues
- an array ofResidue
objects.i
- a int.ri
- a int.j
- a int.rj
- a int.k
- a int.rk
- a int.e
- a double.
-
set3Body
public void set3Body(Residue[] residues, int i, int ri, int j, int rj, int k, int rk, double e, boolean quiet) throws IllegalStateException Stores a triple energy in the triples energy matrix.- Parameters:
residues
- an array ofResidue
objects.i
- A residue index.ri
- A rotamer for residue i.j
- A residue index j != i.rj
- A rotamer for residue j.k
- A residue index k != j, k != i.rk
- A rotamer for residue k.e
- Computed energy to store.quiet
- Silence warnings about exceptions.- Throws:
IllegalStateException
- If threeBodyTerm is false.
-
setSelf
public void setSelf(int i, int ri, double e) -
setSelf
public void setSelf(int i, int ri, double e, boolean quiet) Stores a self energy in the self energy matrix.- Parameters:
i
- A residue index.ri
- A rotamer for residue i.e
- Computed energy to store.quiet
- Silence warnings about exceptions.
-
turnOffAllResidues
-
turnOffResidue
-
turnOnAllResidues
-
turnOnResidue
-