Package ffx.xray.refine
Class RefinementModel
java.lang.Object
ffx.xray.refine.RefinementModel
RefinementModel class.
- Since:
- 1.0
- Author:
- Timothy D. Fenn
-
Constructor Summary
ConstructorsConstructorDescriptionRefinementModel(MolecularAssembly[] molecularAssemblies) Constructor for RefinementModel.RefinementModel(RefinementMode refinementMode, MolecularAssembly[] molecularAssemblies) Constructor for RefinementModel. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAssemblyGradient(int assembly, double[] gradient) Adds the coordinate gradient from an alternate conformer to the overall coordinate gradient.voidgetAcceleration(double[] x) Retrieves acceleration values for all refined parameters in the list using the provided array.Atom[]Getter for the fieldactiveAtomArray.Getter for the fieldaltMolecules.Getter for the fieldaltResidues.List of Atom pairs that define B-factor restraints.voidgetGradient(double[] gradient) Loads the gradient values into the respective refined parameters based on the current refinement mode.voidgetMass(double[] mass) Populates the provided array with mass values retrieved from all refined parameters.Retrieves the array of MolecularAssembly objects.intCounts and returns the total number of ANISOU records present.intCalculates the total number of B-factor parameters based on the specified refinement mode.intCalculates the number of coordinate parameters to be refined based on the specified refinement mode.intCalculates the number of occupancy parameters based on the provided refinement mode.intCalculates the total number of parameters to be refined based on the specified refinement mode.voidgetParameters(double[] x) Get parameter values and store them into the provided array based on the refinement mode.voidgetPreviousAcceleration(double[] x) Retrieves previous acceleration values for all refined parameters in the list using the provided array.Retrieves a list of refined parameters.Retrieves the current refinement mode set in the object.Atom[]Getter for the fieldtotalAtomArray.voidgetVelocity(double[] x) Get parameter velocities and store them into the provided array based on the refinement mode.voidloadOptimizationScaling(double[] optimizationScaling) Loads the optimization scale factors into all refined parameters.voidsetAcceleration(double[] x) Sets the acceleration values for all parameters in the parameters list.voidsetParameters(double[] x) Set parameter values into the refinement model based on the provided refinement mode.voidsetPreviousAcceleration(double[] x) Sets the previous acceleration values for all parameters in the parameters list.voidSets the refinement mode and adjusts the refined parameters based on the provided mode.voidsetVelocity(double[] x) Set parameter velocities into the refinement model based on the provided refinement mode.toString()Provides a string representation of the refinement model, including details about the number of atoms, active atoms, atoms in use, and the refinement variables.voidZero out the gradient for all atoms being refined.
-
Constructor Details
-
RefinementModel
Constructor for RefinementModel.- Parameters:
molecularAssemblies- an array ofMolecularAssemblyobjects.
-
RefinementModel
Constructor for RefinementModel.- Parameters:
refinementMode- The refinement mode in use.molecularAssemblies- an array ofMolecularAssemblyobjects.
-
-
Method Details
-
setRefinementMode
Sets the refinement mode and adjusts the refined parameters based on the provided mode. Clears the current list of refined parameters and populates it with the relevant parameters (coordinates, B-factors, or occupancies) if they are included in the specified refinement mode. Finally, updates the parameter indices.- Parameters:
mode- the refinement mode to set, which determines the types of parameters to include (e.g., coordinates, B-factors, occupancies)
-
getScatteringAtoms
Getter for the fieldtotalAtomArray.- Returns:
- the totalAtomArray
-
getActiveAtoms
Getter for the fieldactiveAtomArray.- Returns:
- the activeAtomArray
-
getAltMolecules
Getter for the fieldaltMolecules.- Returns:
- the altMolecules
-
getAltResidues
Getter for the fieldaltResidues.- Returns:
- the altResidues
-
getMolecularAssemblies
Retrieves the array of MolecularAssembly objects.- Returns:
- An array of MolecularAssembly objects.
-
getBFactorRestraints
List of Atom pairs that define B-factor restraints. There is a covalent bond between each pair.- Returns:
- The bond list.
-
addAssemblyGradient
public void addAssemblyGradient(int assembly, double[] gradient) Adds the coordinate gradient from an alternate conformer to the overall coordinate gradient. Each active atom from the alternate conformer stores its XYZ gradient and its index into the overall refinement gradient array.- Parameters:
assembly- The index of the molecular assembly to retrieve active atoms from.gradient- The overall gradient array where the computed gradient data is aggregated.
-
toString
Provides a string representation of the refinement model, including details about the number of atoms, active atoms, atoms in use, and the refinement variables. -
getRefinementMode
Retrieves the current refinement mode set in the object.- Returns:
- the refinement mode of the object as a RefinementMode enum.
-
getRefinedParameters
Retrieves a list of refined parameters.- Returns:
- a list containing the refined parameters.
-
getNumParameters
public int getNumParameters()Calculates the total number of parameters to be refined based on the specified refinement mode. The parameters may include atomic coordinates, B-factors, and occupancies depending on the mode.- Returns:
- The total number of parameters that need to be refined based on the specified mode.
-
getNumCoordParameters
public int getNumCoordParameters()Calculates the number of coordinate parameters to be refined based on the specified refinement mode. If the mode includes coordinates, the number of parameters is determined by the size of the coordinate atom list.- Returns:
- The number of coordinate parameters that need to be refined. Returns 0 if the mode does not include coordinates.
-
getNumBFactorParameters
public int getNumBFactorParameters()Calculates the total number of B-factor parameters based on the specified refinement mode.- Returns:
- the total number of B-factor parameters, considering whether they are anisotropic or isotropic.
-
getNumOccupancyParameters
public int getNumOccupancyParameters()Calculates the number of occupancy parameters based on the provided refinement mode.- Returns:
- the number of occupancy parameters if occupancies are included; otherwise, returns 0
-
getNumANISOU
public int getNumANISOU()Counts and returns the total number of ANISOU records present.- Returns:
- the number of ANISOU records as an integer
-
getParameters
public void getParameters(double[] x) Get parameter values and store them into the provided array based on the refinement mode. This method extracts and sets coordinates, B-factors, and occupancies for the atoms depending on the specified refinement mode.- Parameters:
x- The array into which the parameter values are loaded. The array should be large enough to accommodate all required parameters based on the refinement mode.
-
setParameters
public void setParameters(double[] x) Set parameter values into the refinement model based on the provided refinement mode. The method updates coordinates, B-factors, and occupancies for atoms, depending on what is specified by the refinement mode.- Parameters:
x- An array of doubles containing the new parameter values. The values should be ordered as required by the refinement mode: first coordinates, then B-factors, and finally occupancies, if applicable.
-
getVelocity
public void getVelocity(double[] x) Get parameter velocities and store them into the provided array based on the refinement mode. This method extracts and sets coordinates, B-factors, and occupancies for the atoms depending on the specified refinement mode.- Parameters:
x- The array into which the parameter velocities are loaded. The array should be large enough to accommodate all required parameter velocities based on the refinement mode.
-
setVelocity
public void setVelocity(double[] x) Set parameter velocities into the refinement model based on the provided refinement mode. The method updates coordinates, B-factors, and occupancies for atoms, depending on what is specified by the refinement mode.- Parameters:
x- An array of doubles containing the new parameter velocities. The values should be ordered as required by the refinement mode: first coordinates, then B-factors, and finally occupancies, if applicable.
-
getAcceleration
public void getAcceleration(double[] x) Retrieves acceleration values for all refined parameters in the list using the provided array.- Parameters:
x- an array of doubles to store acceleration values for each parameter
-
setAcceleration
public void setAcceleration(double[] x) Sets the acceleration values for all parameters in the parameters list.- Parameters:
x- an array of double values representing the acceleration to be set for each parameter
-
getPreviousAcceleration
public void getPreviousAcceleration(double[] x) Retrieves previous acceleration values for all refined parameters in the list using the provided array.- Parameters:
x- an array of doubles to store previous acceleration values for each parameter
-
setPreviousAcceleration
public void setPreviousAcceleration(double[] x) Sets the previous acceleration values for all parameters in the parameters list.- Parameters:
x- an array of double values representing the previous acceleration to be set for each parameter
-
getMass
public void getMass(double[] mass) Populates the provided array with mass values retrieved from all refined parameters.- Parameters:
mass- an array where the mass values will be stored.
-
loadOptimizationScaling
public void loadOptimizationScaling(double[] optimizationScaling) Loads the optimization scale factors into all refined parameters.- Parameters:
optimizationScaling- an array of scale factors to be applied to each refined parameter
-
zeroGradient
public void zeroGradient()Zero out the gradient for all atoms being refined. -
getGradient
public void getGradient(double[] gradient) Loads the gradient values into the respective refined parameters based on the current refinement mode.- Parameters:
gradient- an array of double values representing the gradient to be loaded.
-