Package gorsat.gtgen

Class GPParser

java.lang.Object
gorsat.gtgen.GPParser

public class GPParser extends Object
Utility functions for parsing genotype probability triplets.
  • Method Details

    • plToGp

      public static double[] plToGp(CharSequence plTriplet, char sep)
    • glToGp

      public static double[] glToGp(CharSequence glTriplet, char sep)
    • glCcToGp

      public static double[] glCcToGp(int gl, char cc)
      Parameters:
      gl - An integer representing the difference of log of probability of most likely genotype and the log of second most likely genotype.
      cc - The called genotype, '0', '1', '2'.
      Returns:
      An estimated triplet.
    • parseDoubleTriplet

      public static double[] parseDoubleTriplet(CharSequence cs, char sep)
      The method does not do any validations so the the functionality is undefined if the input is bad.
      Parameters:
      cs - A triplet of doubles, separated by sep.
      sep - The separator.
      Returns:
      The triplet as double array.
    • parseDouble

      public static double parseDouble(CharSequence cs, int begin, int end)
      Parses a double from a subsequence of a character sequence. The method does not do any validations so the the functionality is undefined if the input is bad.
      Parameters:
      cs - The character sequence to parse from.
      begin - The beginning of the subsequence.
      end - The end of the subsequence (exclusive).
      Returns:
      The parsed double.
    • parseIntTriplet

      public static int[] parseIntTriplet(CharSequence cs, char sep)
      The method does not do any validations so the the functionality is undefined if the input is bad.
      Parameters:
      cs - A triplet of integers, separated by sep.
      sep - The separator.
      Returns:
      The triplet as int array.
    • parseInt

      public static int parseInt(CharSequence cs, int begin, int end)
      Parses an integer from a subsequence of a character sequence. The method does not do any validations so the the functionality is undefined if the input is bad.
      Parameters:
      cs - The sequence to parse from.
      begin - The beginning of the subsequence.
      end - The end of the subsequence (exclusive).
      Returns:
      The parsed integer.