Package phase
Class SwapRate
java.lang.Object
phase.SwapRate
Class SwapRate
stores the proportion of unphased heterozygotes
whose phase with respect to the previous heteroygote has been reversed.
Instances of class SwapRate
are thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
Returns the proportion of unphased heterozygotes whose phase relative to the previous heterozygote has been reversed.static void
increment
(int nUnphHets, int nSwaps) Increments the number of unphased heterozygotes and the number of unphased heterozygotes whose phase with respect to the preceding heterozygote has been reversed.
-
Method Details
-
getAndResetSwapRate
public static double getAndResetSwapRate()Returns the proportion of unphased heterozygotes whose phase relative to the previous heterozygote has been reversed. The counters for the number of heterozygotes whose phase has been reversed and for the total number of unphased heterozygotes are then set to 0.- Returns:
- the proportion of unphased heterozygotes whose phase has been changed
-
increment
public static void increment(int nUnphHets, int nSwaps) Increments the number of unphased heterozygotes and the number of unphased heterozygotes whose phase with respect to the preceding heterozygote has been reversed.- Parameters:
nUnphHets
- the value that will be added to number of unphased heterozygotesnSwaps
- the value that will be added to number of unphased heterozygotes whose phase has been reversed
-