Package Utils

Class 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 value
      MAFCalculator​(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 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​(int[][] reads)
      Calculates the minor allele frequency for a set of read counts
      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​(Caller caller,
                             int minDepth,
                             int maxDepth)
        Constructor
        Parameters:
        caller - The caller to be used in calculating the MAF
        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
      • 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 MAF
        minDepth - 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