Package Correlation
Class Correlation
- java.lang.Object
-
- Correlation.Correlation
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description double[][]
calculate(byte[][] data)
Calculates all-against-all LDabstract double
calculate(byte[] d1, byte[] d2)
Calculates LD between two SNPsstatic void
setSilent(boolean s)
Contols progress output to screenjava.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>>
topn(byte[][] data, int n)
Calculates all-against-all LD and returns the top n sites most in LD with each site.java.util.List<java.lang.Integer>
topn(byte[][] data, int n, int p)
Calculates the top n sites most in LD with a single site.
-
-
-
Method Detail
-
calculate
public double[][] calculate(byte[][] data)
Calculates all-against-all LD- Parameters:
data
- The data to calculate LD for. SNPs are indexed by the first position of the array, samples by the second. For example data[1][2] would be SNP 1 and sample 2.- Returns:
- A LD matrix
-
topn
public java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> topn(byte[][] data, int n)
Calculates all-against-all LD and returns the top n sites most in LD with each site.- Parameters:
data
- The data to calculate LD for. SNPs are indexed by the first position of the array, samples by the second. For example data[1][2] would be SNP 1 and sample 2.n
- number of top hits to return per site- Returns:
- A map from site to ordered list of sites most in LD
-
topn
public java.util.List<java.lang.Integer> topn(byte[][] data, int n, int p)
Calculates the top n sites most in LD with a single site.- Parameters:
data
- The data to calculate LD for. SNPs are indexed by the first position of the array, samples by the second. For example data[1][2] would be SNP 1 and sample 2.n
- Number of top hits to returnp
- Index of site to calculate other sites most in LD with it- Returns:
- Ordered list of sites most in LD
-
calculate
public abstract double calculate(byte[] d1, byte[] d2)
Calculates LD between two SNPs- Parameters:
d1
- SNP 1 genotyped2
- SNP 2 genotype- Returns:
- LD between the two SNPs
-
setSilent
public static void setSilent(boolean s)
Contols progress output to screen- Parameters:
s
- Whether to output progress to screen
-
-