Package Utils
Class MAFCalculator
- java.lang.Object
-
- Utils.MAFCalculator
-
public class MAFCalculator extends java.lang.Object
Calculates minor allele frequency
-
-
Constructor Summary
Constructors Constructor Description MAFCalculator(Caller caller, int minDepth)
Constructor with maxdepth is set to maximum integer valueMAFCalculator(Caller caller, int minDepth, int maxDepth)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Caller
getCaller()
Gets the caller used in the MAF calculationint
getMaxDepth()
Gets the maximum depth used in the MAF calculationint
getMinDepth()
Gets the minimum depth used in the MAF calculationdouble
maf(int[][] reads)
Calculates the minor allele frequency for a set of read countsdouble
maf(Position p)
Calculates the minor allele frequency for a position
-
-
-
Constructor Detail
-
MAFCalculator
public MAFCalculator(Caller caller, int minDepth, int maxDepth)
Constructor- Parameters:
caller
- The caller to be used in calculating the MAFminDepth
- A genotype must have at least this number of reads to be used in the MAF calculationmaxDepth
- A genotype must have less than (or equal) this number of reads to be used in the MAF calculation
-
MAFCalculator
public MAFCalculator(Caller caller, int minDepth)
Constructor with maxdepth is set to maximum integer value- Parameters:
caller
- The caller to be used in calculating the MAFminDepth
- A genotype must have at least this number of reads to be used in the MAF calculation
-
-
Method Detail
-
maf
public double maf(Position p) throws VCFDataException
Calculates the minor allele frequency for a position- Parameters:
p
- The position- Returns:
- The minor allele frequency
- Throws:
VCFDataException
- Thrown if the "AD" data field is not present
-
maf
public double maf(int[][] reads)
Calculates the minor allele frequency for a set of read counts- Parameters:
reads
- Set of read counts (second dimension of size two to represent the two allele read counts)- Returns:
- The minor allele frequency
-
getMinDepth
public int getMinDepth()
Gets the minimum depth used in the MAF calculation- Returns:
- The minimum depth
-
getMaxDepth
public int getMaxDepth()
Gets the maximum depth used in the MAF calculation- Returns:
- The maximum depth
-
getCaller
public Caller getCaller()
Gets the caller used in the MAF calculation- Returns:
- The caller
-
-