Package Methods

Class KnniLD


  • public class KnniLD
    extends java.lang.Object
    Class to perform standard LD-kNNi imputation
    • Constructor Summary

      Constructors 
      Constructor Description
      KnniLD​(Similar sim, int k, int l)
      Constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[][] compute​(byte[][] original)
      Impute missing data
      double fastAccuracy​(byte[][] original, Mask mask)
      Performs a fast accuracy calculation - only imputes those genotypes that were masked rather than all missing genotypes.
      static void setAddConstant​(double constant)
      Sets the constant to add to avoid a distance of zero (since this causes problems later).
      static void setSilent​(boolean s)
      Contols progress output to screen
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KnniLD

        public KnniLD​(Similar sim,
                      int k,
                      int l)
        Constructor
        Parameters:
        sim - Similarity object to use to get similarity between snps
        k - The number of nearest neighbours to use
        l - The number of most similar snps to use to calulate nearest neighbours
    • Method Detail

      • fastAccuracy

        public double fastAccuracy​(byte[][] original,
                                   Mask mask)
        Performs a fast accuracy calculation - only imputes those genotypes that were masked rather than all missing genotypes.
        Parameters:
        original - The original genotype values
        mask - A mask
        Returns:
        The percentage of genotypes imputed correctly
      • setAddConstant

        public static void setAddConstant​(double constant)
        Sets the constant to add to avoid a distance of zero (since this causes problems later). Default value is 1.0 if this function is not called
        Parameters:
        constant - Constant to use
      • setSilent

        public static void setSilent​(boolean s)
        Contols progress output to screen
        Parameters:
        s - Whether to output progress to screen