Class RefinedBFactor

java.lang.Object
ffx.xray.refine.RefinedParameter
ffx.xray.refine.RefinedBFactor

public class RefinedBFactor extends RefinedParameter
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
    Constructor
    Description
    Constructor for the RefinableBfactor class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds the specified atom to the list of constrained atoms while applying specific constraints.
    void
    Adds the given atom to the list of constrained atoms that scatter in structural models.
    void
    getAcceleration(double[] acceleration)
    Populates the provided array with acceleration values for the associated atom.
    void
    getGradient(double[] gradient)
    Adds the gradient contributions for the associated atom and all constrained atoms to the provided gradient array.
    void
    getMass(double[] mass, double defaultMass)
    Populates the provided array with mass values based on the anisotropic or isotropic nature of the associated atom.
    int
    Retrieves the number of parameters associated with this instance, based on whether the atom contains anisotropic B-factor data.
    void
    getParameters(double[] parameters)
    Loads the parameters for the atom based on whether it has anisotropic data (ANISOU) or isotropic temperature factor (B-factor).
    void
    getPreviousAcceleration(double[] previousAcceleration)
    Populates the provided array with previous acceleration values for the associated atom.
    void
    getVelocity(double[] velocity)
    Populates the provided array with velocity values for the associated atom.
    boolean
    Determines whether the atom associated with this RefinableBfactor instance contains anisotropic B-factor data.
    void
    setAcceleration(double[] acceleration)
    Sets the acceleration for the atom based on the input array.
    void
    setAnisou(double[] anisou)
    Sets the anisotropic displacement parameters (ANISOU) for the associated atom.
    void
    setBFactor(double bFactor)
    Sets the B-factor value for the associated atom and all constrained atoms.
    void
    setOptimizationScaling(double[] optimizationScaling)
    Sets the scaling factors for optimization parameters based on whether the atom contains anisotropic B-factor data.
    void
    setParameters(double[] parameters)
    Stores parameter values for the associated atom, determining whether to store anisotropic displacement parameters (ANISOU) or isotropic B-factor values.
    void
    setPreviousAcceleration(double[] previousAcceleration)
    Sets the previous acceleration for the atom based on the input array.
    void
    setVelocity(double[] velocity)
    Stores parameter values for the associated atom, determining whether to store anisotropic displacement parameters (ANISOU) or isotropic B-factor values.
     
    void
    The zero the B-factor gradient.

    Methods inherited from class ffx.xray.refine.RefinedParameter

    getIndex, setIndex

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RefinedBFactor

      public RefinedBFactor(Atom atom)
      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

      public void addConstrainedAtom(Atom atom)
      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:
      addConstrainedAtom in class RefinedParameter
      Parameters:
      atom - the atom to be constrained and updated with relevant parameters such as the temperature factor and anisotropic displacement data (if available).
    • addConstrainedAtomThatScatters

      public void addConstrainedAtomThatScatters(Atom atom)
      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:
      addConstrainedAtomThatScatters in class RefinedParameter
      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:
      getNumberOfParameters in class RefinedParameter
      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:
      getParameters in class RefinedParameter
      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:
      setParameters in class RefinedParameter
      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:
      getVelocity in class RefinedParameter
      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:
      setVelocity in class RefinedParameter
      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:
      getAcceleration in class RefinedParameter
      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:
      setAcceleration in class RefinedParameter
      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:
      getPreviousAcceleration in class RefinedParameter
      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:
      setPreviousAcceleration in class RefinedParameter
      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:
      setOptimizationScaling in class RefinedParameter
      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:
      zeroGradient in class RefinedParameter
    • 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:
      getGradient in class RefinedParameter
      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:
      getMass in class RefinedParameter
      Parameters:
      mass - an array of double values where the mass information will be stored.
      defaultMass - The default mass to use for this parameter.
    • toString

      public String toString()
      Overrides:
      toString in class Object