Package gorsat.gtgen
Class GPParser
java.lang.Object
gorsat.gtgen.GPParser
Utility functions for parsing genotype probability triplets.
-
Method Summary
Modifier and TypeMethodDescriptionstatic double[]glCcToGp(int gl, char cc) static double[]glToGp(CharSequence glTriplet, char sep) static doubleparseDouble(CharSequence cs, int begin, int end) Parses a double from a subsequence of a character sequence.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.static intparseInt(CharSequence cs, int begin, int end) Parses an integer from a subsequence of a character sequence.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.static double[]plToGp(CharSequence plTriplet, char sep)
-
Method Details
-
plToGp
-
glToGp
-
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
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
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
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
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.
-