Package ffx.xray.refine
Class RefinedBFactor
java.lang.Object
ffx.xray.refine.RefinedParameter
ffx.xray.refine.RefinedBFactor
The RefinedBfactor class defines an object for handling the refinement
of B-factors (either isotropic or anisotropic) for a specific atom.
It allows the setting and retrieval of atomic B-factors and anisotropic
U-matrix values. Additionally, it supports grouping atoms to maintain
constrained B-factor refinements across the group.
-
Field Summary
Fields inherited from class ffx.xray.refine.RefinedParameter
atom, constrainedAtoms, constrainedAtomsThatScatter, index -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConstrainedAtom(Atom atom) Adds the specified atom to the list of constrained atoms while applying specific constraints.voidAdds the given atom to the list of constrained atoms that scatter in structural models.voidgetAcceleration(double[] acceleration) Populates the provided array with acceleration values for the associated atom.voidgetGradient(double[] gradient) Adds the gradient contributions for the associated atom and all constrained atoms to the provided gradient array.voidgetMass(double[] mass, double defaultMass) Populates the provided array with mass values based on the anisotropic or isotropic nature of the associated atom.intRetrieves the number of parameters associated with this instance, based on whether the atom contains anisotropic B-factor data.voidgetParameters(double[] parameters) Loads the parameters for the atom based on whether it has anisotropic data (ANISOU) or isotropic temperature factor (B-factor).voidgetPreviousAcceleration(double[] previousAcceleration) Populates the provided array with previous acceleration values for the associated atom.voidgetVelocity(double[] velocity) Populates the provided array with velocity values for the associated atom.booleanisAnisou()Determines whether the atom associated with this RefinableBfactor instance contains anisotropic B-factor data.voidsetAcceleration(double[] acceleration) Sets the acceleration for the atom based on the input array.voidsetAnisou(double[] anisou) Sets the anisotropic displacement parameters (ANISOU) for the associated atom.voidsetBFactor(double bFactor) Sets the B-factor value for the associated atom and all constrained atoms.voidsetOptimizationScaling(double[] optimizationScaling) Sets the scaling factors for optimization parameters based on whether the atom contains anisotropic B-factor data.voidsetParameters(double[] parameters) Stores parameter values for the associated atom, determining whether to store anisotropic displacement parameters (ANISOU) or isotropic B-factor values.voidsetPreviousAcceleration(double[] previousAcceleration) Sets the previous acceleration for the atom based on the input array.voidsetVelocity(double[] velocity) Stores parameter values for the associated atom, determining whether to store anisotropic displacement parameters (ANISOU) or isotropic B-factor values.toString()voidThe zero the B-factor gradient.Methods inherited from class ffx.xray.refine.RefinedParameter
getIndex, setIndex
-
Constructor Details
-
RefinedBFactor
Constructor for the RefinableBfactor class. Initializes the RefinableBfactor instance by associating it with the given atom and determining if the atom contains anisotropic B-factor data.- Parameters:
atom- the atom associated with the RefinableBfactor instance. This atom is checked for anisotropic B-factor data during initialization.
-
-
Method Details
-
addConstrainedAtom
Adds the specified atom to the list of constrained atoms while applying specific constraints. This method sets the atom to active, assigns its temperature factor based on the associated atom, and, if applicable, copies its anisotropic displacement parameters (ANISOU).- Specified by:
addConstrainedAtomin classRefinedParameter- Parameters:
atom- the atom to be constrained and updated with relevant parameters such as the temperature factor and anisotropic displacement data (if available).
-
addConstrainedAtomThatScatters
Adds the given atom to the list of constrained atoms that scatter in structural models. Sets the atom as active, assigns its temperature factor based on the associated atom, and if applicable, propagates its anisotropic B-factor data (ANISOU).- Specified by:
addConstrainedAtomThatScattersin classRefinedParameter- Parameters:
atom- the atom to be constrained and included in the scattering group.
-
getNumberOfParameters
public int getNumberOfParameters()Retrieves the number of parameters associated with this instance, based on whether the atom contains anisotropic B-factor data.- Specified by:
getNumberOfParametersin classRefinedParameter- Returns:
- 6 if anisotropic B-factor data is present; otherwise, 1.
-
isAnisou
public boolean isAnisou()Determines whether the atom associated with this RefinableBfactor instance contains anisotropic B-factor data.- Returns:
- true if the atom contains anisotropic B-factor data, false otherwise.
-
setBFactor
public void setBFactor(double bFactor) Sets the B-factor value for the associated atom and all constrained atoms. The B-factor, also referred to as the temperature factor, is a value associated with the atomic displacement or mobility in structural models.- Parameters:
bFactor- the B-factor value to be assigned to the associated atom and all constrained atoms
-
setAnisou
public void setAnisou(double[] anisou) Sets the anisotropic displacement parameters (ANISOU) for the associated atom. This method adjusts the temperature factor and ANISOU parameters based on the input values, while ensuring that the determinant of the ANISOU matrix is appropriately handled. If the determinant is negative, default values are used. Additionally, sets the temperature factor and ANISOU for constrained atoms.- Parameters:
anisou- an array of six double values representing the ANISOU matrix parameters. These values define anisotropic atomic displacement.
-
getParameters
public void getParameters(double[] parameters) Loads the parameters for the atom based on whether it has anisotropic data (ANISOU) or isotropic temperature factor (B-factor). ANISOU data consists of six parameters, while isotropic data is represented by a single parameter.- Specified by:
getParametersin classRefinedParameter- Parameters:
parameters- an array of doubles to populate with the relevant parameters.
-
setParameters
public void setParameters(double[] parameters) Stores parameter values for the associated atom, determining whether to store anisotropic displacement parameters (ANISOU) or isotropic B-factor values. If the atom contains anisotropic data, six ANISOU parameters are stored; otherwise, a single B-factor value is set.- Specified by:
setParametersin classRefinedParameter- Parameters:
parameters- an array of doubles containing all refined parameters.
-
getVelocity
public void getVelocity(double[] velocity) Populates the provided array with velocity values for the associated atom. Depending on whether the atom has anisotropic B-factor data, either six ANISOU velocity components or a single isotropic B-factor velocity will be stored.- Specified by:
getVelocityin classRefinedParameter- Parameters:
velocity- an array of double values to be updated with velocities. If the associated atom has anisotropic B-factor data, six velocity values (ANISOU components) are stored. Otherwise, a single velocity value (isotropic B-factor velocity) is stored.
-
setVelocity
public void setVelocity(double[] velocity) Stores parameter values for the associated atom, determining whether to store anisotropic displacement parameters (ANISOU) or isotropic B-factor values. If the atom contains anisotropic data, six ANISOU parameters are stored; otherwise, a single B-factor value is set.- Specified by:
setVelocityin classRefinedParameter- Parameters:
velocity- an array of doubles containing all refined parameters.
-
getAcceleration
public void getAcceleration(double[] acceleration) Populates the provided array with acceleration values for the associated atom. If the atom contains anisotropic B-factor data (ANISOU), six acceleration components are stored. Otherwise, a single isotropic acceleration value is stored.- Specified by:
getAccelerationin classRefinedParameter- Parameters:
acceleration- an array of double values to be updated with acceleration data. If the associated atom has anisotropic B-factor data, six values (ANISOU components) are stored. Otherwise, a single isotropic acceleration value is stored.
-
setAcceleration
public void setAcceleration(double[] acceleration) Sets the acceleration for the atom based on the input array. The behavior changes depending on whether the atom is anisotropic or not.- Specified by:
setAccelerationin classRefinedParameter- Parameters:
acceleration- an array of doubles representing acceleration values. If the atom is anisotropic, six values are extracted to set anisotropic acceleration. Otherwise, a single value is used to set the isotropic acceleration.
-
getPreviousAcceleration
public void getPreviousAcceleration(double[] previousAcceleration) Populates the provided array with previous acceleration values for the associated atom. If the atom contains anisotropic B-factor data (ANISOU), six acceleration components are stored. Otherwise, a single isotropic acceleration value is stored.- Specified by:
getPreviousAccelerationin classRefinedParameter- Parameters:
previousAcceleration- an array of double values to be updated with previous acceleration data. If the associated atom has anisotropic B-factor data, six values (ANISOU components) are stored. Otherwise, a single isotropic acceleration value is stored.
-
setPreviousAcceleration
public void setPreviousAcceleration(double[] previousAcceleration) Sets the previous acceleration for the atom based on the input array. The behavior changes depending on whether the atom is anisotropic or not.- Specified by:
setPreviousAccelerationin classRefinedParameter- Parameters:
previousAcceleration- an array of doubles representing previous acceleration values. If the atom is anisotropic, six values are extracted to set anisotropic acceleration. Otherwise, a single value is used to set the isotropic acceleration.
-
setOptimizationScaling
public void setOptimizationScaling(double[] optimizationScaling) Sets the scaling factors for optimization parameters based on whether the atom contains anisotropic B-factor data. If the atom is identified as having anisotropic displacement data, six scaling factors are set. Otherwise, a single scaling factor is applied.- Specified by:
setOptimizationScalingin classRefinedParameter- Parameters:
optimizationScaling- an array of doubles representing the scaling factors for optimization parameters. This array will be updated with the appropriate scaling values based on the isotropic or anisotropic B-factor data.
-
zeroGradient
public void zeroGradient()The zero the B-factor gradient.- Specified by:
zeroGradientin classRefinedParameter
-
getGradient
public void getGradient(double[] gradient) Adds the gradient contributions for the associated atom and all constrained atoms to the provided gradient array. This method accounts for isotropic or anisotropic B-factor (temperature factor) data depending on the current state of the `isAnisou` field. If the atom has anisotropic B-factor data, the gradient is updated using the corresponding ANISOU components. Otherwise, isotropic B-factor gradients are used.- Specified by:
getGradientin classRefinedParameter- Parameters:
gradient- an array of doubles representing the gradient values to be updated.
-
getMass
public void getMass(double[] mass, double defaultMass) Populates the provided array with mass values based on the anisotropic or isotropic nature of the associated atom. If the atom contains anisotropic B-factor data, values are assigned in six positions. Otherwise, only one value is assigned.- Specified by:
getMassin classRefinedParameter- Parameters:
mass- an array of double values where the mass information will be stored.defaultMass- The default mass to use for this parameter.
-
toString
-