class_docstr: BaseClass for systems that want to provide training labels for examples.
  
  A VariantLabeler provides methods to assign a genotype label to each of a
  series of candidate variants using data from a truth set of variants
  accessible with vcf_reader and an optional RangeSet of confident regions.
  
  The basic logic of this class is something like:
  
  candidates = [third_party.nucleus.protos.Variant(...), ...]
  labeler = ConcreteSubclassOfVariantLabeler(vcf_reader, confident_regions)
  for label in labeler.label_variants(candidates):
    if label.is_confident:
      for i in range(len(label.variant.alternate_bases)
        genotype_label_value = label.label_for_alt_alleles([i])
  
  See the docs on each individual function to get a better understanding of what
  each function does and the meaning of the return values.
class_docstr_tok: ["BaseClass","for","systems","that","want","to","provide","training","labels","for","examples",".","A","VariantLabeler","provides","methods","to","assign","a","genotype","label","to","each","of","a","series","of","candidate","variants","using","data","from","a","truth","set","of","variants","accessible","with","vcf_reader","and","an","optional","RangeSet","of","confident","regions",".","The","basic","logic","of","this","class","is","something","like",":","candidates","=","[","third_party.nucleus.protos.Variant","(","...",")",",","...","]","labeler","=","ConcreteSubclassOfVariantLabeler","(","vcf_reader",",","confident_regions",")","for","label","in","labeler.label_variants","(","candidates",")",":","if","label.is_confident",":","for","i","in","range","(","len","(","label.variant.alternate_bases",")","genotype_label_value","=","label.label_for_alt_alleles","(","[","i","]",")","See","the","docs","on","each","individual","function","to","get","a","better","understanding","of","what","each","function","does","and","the","meaning","of","the","return","values","."]
docstr: Gets truth variants within region to use in labeling calculations.
  
  This function queries _truth_vcf_reader in region to get a complete list of
  truth variants that overlap region, and then filters them down by removing
  filtered truth variants and ones that aren't contained in the truth
  intervals.
  
  Args:
    region: nucleus.Range proto describing the region on the genome where we
      want to get our truth variants.
  
  Yields:
    nucleus.Variant proto.
docstr_tok: ["Gets","truth","variants","within","region","to","use","in","labeling","calculations",".","This","function","queries","_truth_vcf_reader","in","region","to","get","a","complete","list","of","truth","variants","that","overlap","region",",","and","then","filters","them","down","by","removing","filtered","truth","variants","and","ones","that","are","n't","contained","in","the","truth","intervals",".","Args",":","region",":","nucleus.Range","proto","describing","the","region","on","the","genome","where","we","want","to","get","our","truth","variants",".","Yields",":","nucleus.Variant","proto","."]
code: def _get_truth_variants(self, region):
      """Gets truth variants within region to use in labeling calculations.
  
      This function queries _truth_vcf_reader in region to get a complete list of
      truth variants that overlap region, and then filters them down by removing
      filtered truth variants and ones that aren't contained in the truth
      intervals.
  
      Args:
        region: nucleus.Range proto describing the region on the genome where we
          want to get our truth variants.
  
      Yields:
        nucleus.Variant proto.
      """
      for variant in self._truth_vcf_reader.query(region):
          if not variant_utils.is_filtered(variant) and (
              self._confident_regions is None
              or self._confident_regions.variant_overlaps(
                  variant, empty_set_return_value=False
              )
          ):
              yield variant
  
file_path: deepvariant/deepvariant/labeler/variant_labeler.py
imports: import abc
  from absl import logging
  from third_party.nucleus.util import variant_utils
  from third_party.nucleus.util import variantcall_utils
  from deepvariant import dv_utils
label_desc: Use image node_id 4 for calling the VariantLabeler obj's underlying member method code with example usage: obj._get_truth_variants(region) without return types