Package gorsat.gtgen

Class GPParser

java.lang.Object
gorsat.gtgen.GPParser

public class GPParser
extends java.lang.Object
Utility functions for parsing genotype probability triplets.
  • Method Summary

    Modifier and Type Method Description
    static double[] glCcToGp​(int gl, char cc)  
    static double[] glToGp​(java.lang.CharSequence glTriplet, char sep)  
    static double parseDouble​(java.lang.CharSequence cs, int begin, int end)
    Parses a double from a subsequence of a character sequence.
    static double[] parseDoubleTriplet​(java.lang.CharSequence cs, char sep)
    The method does not do any validations so the the functionality is undefined if the input is bad.
    static int parseInt​(java.lang.CharSequence cs, int begin, int end)
    Parses an integer from a subsequence of a character sequence.
    static int[] parseIntTriplet​(java.lang.CharSequence cs, char sep)
    The method does not do any validations so the the functionality is undefined if the input is bad.
    static double[] plToGp​(java.lang.CharSequence plTriplet, char sep)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • plToGp

      public static double[] plToGp​(java.lang.CharSequence plTriplet, char sep)
    • glToGp

      public static double[] glToGp​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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.