Package Mask
Class Mask
- java.lang.Object
-
- Mask.Mask
-
public class Mask extends java.lang.Object
Represents a mask for calculating imputation accuracy. Contains data on which genotypes should be masked.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
accuracy(byte[][] orig, byte[][] imputed)
Calculates imputation accuracyboolean[][]
getArray()
Returns an array of masked genotypes (true = masked, false = unmasked).java.util.Set<SampleSnp>
getSet()
Returns a list of masked genotypes.byte[][]
mask(byte[][] orig)
Creates a masked array using this maskvoid
saveToFile(java.io.File f)
Saves this mask to a file
-
-
-
Constructor Detail
-
Mask
public Mask(java.io.File f) throws java.io.IOException
Creates a mask from file.- Parameters:
f
- The file to read the mask from- Throws:
java.io.IOException
- If there are problems reading the file
-
Mask
public Mask(byte[][] orig, int number)
Creates a mask for a dataset- Parameters:
orig
- The original datasetnumber
- The number of genotypes to mask
-
-
Method Detail
-
getSet
public java.util.Set<SampleSnp> getSet()
Returns a list of masked genotypes. List is only created when this function is first called to save memory.- Returns:
- A list of masked genotypes
-
accuracy
public double accuracy(byte[][] orig, byte[][] imputed)
Calculates imputation accuracy- Parameters:
orig
- The original, unmasked datasetimputed
- The imputed dataset (imputed on masked data)- Returns:
- Imputation accuracy
-
getArray
public boolean[][] getArray()
Returns an array of masked genotypes (true = masked, false = unmasked).- Returns:
- An array of masked genotypes.
-
mask
public byte[][] mask(byte[][] orig)
Creates a masked array using this mask- Parameters:
orig
- Array to be masked- Returns:
- Masked array
-
saveToFile
public void saveToFile(java.io.File f) throws java.io.IOException
Saves this mask to a file- Parameters:
f
- File to save to- Throws:
java.io.IOException
- If there are problems writing the file
-
-