Class FrequencyCalculator

java.lang.Object
_global.tri.oxidationstates.calculator.OxidationStateCalculator
_global.tri.oxidationstates.calculator.frequency.FrequencyCalculator

public class FrequencyCalculator extends OxidationStateCalculator
Calculates the frequency score for possible sets of oxidation states
  • Constructor Details

    • FrequencyCalculator

      public FrequencyCalculator(OxidationStateData data)
      Initialize the frequency score calculator, generating frequencies per ion from the user-provided data
      Parameters:
      data - The frequency of each ion will be determined based on the number of entries in this data set that contain the ion.
  • Method Details

    • getLikelyOxidationStates

      public OxidationStateSet getLikelyOxidationStates(String[] ionTypeIDs, double[] weights)
      Description copied from class: OxidationStateCalculator
      Calculate the most likely oxidation states for the given ion types with the given composition.
      Specified by:
      getLikelyOxidationStates in class OxidationStateCalculator
      Parameters:
      ionTypeIDs - The IDS of the ion types.
      weights - The composition of each ion type, ordered in the way that corresponds to the ordering of ionTypeIDs.
      Returns:
      the most likely oxidation states for the given ion types with the given composition.
    • getFrequency

      public double getFrequency(IonFactory.Ion ion)
      Returns the frequency for a particular ion, where all frequencies for an ion type sum to 1.
      Parameters:
      ion - The ion for which we want the frequency
      Returns:
      The frequency for the ion, where all frequencies for an ion type sum to 1.
    • getFrequencyScore

      public double getFrequencyScore(IonFactory.Ion[] ions)
      Calculates the frequency for a set of ions by multiplying the frequencies for all ionsin the set
      Parameters:
      ions - The set of ions for which we want the frequency
      Returns:
      The frequency score for the set of ions