Package VCF.Filters
Class MAFCalculator
- java.lang.Object
-
- VCF.Filters.MAFCalculator
-
public class MAFCalculator extends java.lang.Object
Calculates minor allele frequency
-
-
Constructor Summary
Constructors Constructor Description MAFCalculator(double error, int minDepth, int maxDepth)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getError()
Gets the error 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(Position p)
Calculates the minor allele frequency for a position
-
-
-
Constructor Detail
-
MAFCalculator
public MAFCalculator(double error, int minDepth, int maxDepth)
Constructor- Parameters:
minDepth
- 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 calculationerror
- The error rate to be used when calling genotypes
-
-
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
-
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
-
getError
public double getError()
Gets the error used in the MAF calculation- Returns:
- The error
-
-