pgb_liv\php_ms\Core\Tolerance

Class to encapsulate tolerance values with their unit type.

Synopsis

class Tolerance {
  • // constants
  • const DA = 'Da';
  • const PPM = 'ppm';
  • const PSI_PPM_ACCESSION = 'UO:0000169';
  • const PSI_DA_ACCESSION = 'UO:0000221';
}

Coverage

Methods 100% 8 / 8
Lines 100% 36 / 36

Violations

Checkstyle

Line Column Severity Message
52 1 error Multi-line function call not indented correctly; expected 12 spaces but found 16
52 107 error Closing parenthesis of a multi-line function call must be on a line by itself
68 1 error Multi-line function call not indented correctly; expected 16 spaces but found 20
68 92 error Closing parenthesis of a multi-line function call must be on a line by itself

Constants

Name Value
DA 'Da'
PPM 'ppm'
PSI_PPM_ACCESSION 'UO:0000169'
PSI_DA_ACCESSION 'UO:0000221'

Members

private

  • $tolerance
  • $unit

Methods

public

  • __construct() — Creates a new instance of this object with a specified tolerance value and unit type
  • getDaltonDelta() — Calculates the Dalton tolerance value of this mass using the set tolerance value
  • getDifference() — Gets the difference between the observed and expected, and returns it depending on the instance unit
  • getDifferencePpm() — Gets the ppm difference for the observed and expected value
  • getPpmDelta() — Calculates the ppm tolerance value of this mass using the set tolerance value
  • getTolerance() — Gets the numeric tolerance value.
  • getUnit() — Gets the tolerance unit type, Tolerance::PPM or Tolerance::DA
  • isTolerable() — Test if the observed and expected values are within the accepted tolerance

History