Class MACalculator

  • Direct Known Subclasses:
    Log10MACalculator, Log2MACalculator

    public class MACalculator
    extends Object
    Calculates M and A values for 2-channel data. For "normal" intensity values M and A are defined as follows: M = log2(ch1/ch2) A = log10(ch*ch2)/2 Channel intensity corrections are used to calculate new values for channel 1 and 2. For corrections that use M+A values the corrections are usually calculated in log2-space and the resulting equations are: log2(newCh1) = log2(oldCh1) - factor log2(newCh2) = log2(oldCh2) + factor Source data that has been transformed (eg. log2-transformed) must use different equations to get the correct results.
    Since:
    3.2.4
    Author:
    nicklas
    • Field Detail

      • INV_LN2

        static final double INV_LN2
      • INV_LN10x2

        static final double INV_LN10x2
    • Constructor Detail

      • MACalculator

        public MACalculator()
    • Method Detail

      • MA

        public double[] MA​(double ch1,
                           double ch2)
        Calculate the M and A values from the ch1 and ch2 intensity values. See class description for information about the definitions of M and A.
        Returns:
        An array with [0] = M, [1] = A
      • correct

        public double[] correct​(double ch1,
                                double ch2,
                                double factor)
        Apply a correction factor to the ch1 and ch2 intensity values.
        Returns:
        An array with [0] = newCh1, [1] = newCh2