Package VCF.Filters

Class 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 calculation
      int getMaxDepth()
      Gets the maximum depth used in the MAF calculation
      int getMinDepth()
      Gets the minimum depth used in the MAF calculation
      double maf​(Position p)
      Calculates the minor allele frequency for a position
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 calculation
        maxDepth - A genotype must have less than (or equal) this number of reads to be used in the MAF calculation
        error - 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