Class GenotypeQualityFilter

java.lang.Object
htsjdk.variant.variantcontext.filter.GenotypeQualityFilter
All Implemented Interfaces:
VariantContextFilter, Predicate<VariantContext>

public class GenotypeQualityFilter extends Object implements VariantContextFilter
A Predicate on VariantContexts that returns true at sites that are either unfiltered, or passing (as variants).
  • Constructor Details

    • GenotypeQualityFilter

      public GenotypeQualityFilter(int gqThreshold, String sample)
      Constructor for a filter that will keep VC for which the genotype quality (GQ) of sample passes a threshold. If sample is null, the first genotype in the variant context will be used.
      Parameters:
      gqThreshold - the smallest value of GQ that this filter will pass
      sample - the name of the sample in the variant context whose genotype should be examined.
    • GenotypeQualityFilter

      public GenotypeQualityFilter(int gqThreshold)
      Constructor as above that doesn't take a sample, instead it will look at the first genotype of the variant context.
      Parameters:
      gqThreshold - the smallest value of GQ that this filter will pass
  • Method Details

    • test

      public boolean test(VariantContext variantContext)
      Specified by:
      test in interface Predicate<VariantContext>
      Parameters:
      variantContext - the record to examine for GQ
      Returns:
      true if variantContext is to be kept, otherwise false Assumes that this.sample is a sample in the variantContext, if not null, otherwise looks for the first genotype (and assumes it exists).