class_docstr: Dataclass containing information about a label assigned to a variant.
  
  Attributes:
    is_confident: bool. True if we could confidently assign a label to this
      variant, False otherwise.
    variant: nucleus.protos.Variant proto that we assigned a label for.
    genotype: tuple of ints. The labeled genotype (e.g., (0, 1) for a het) in
      the standard nucleus.proto.VariantCall style. Genotype can be None if the
      labeler doesn't have any genotype to assign. If Genotype is not None, the
      genotype of variant will be set to genotype.
class_docstr_tok: ["Dataclass","containing","information","about","a","label","assigned","to","a","variant",".","Attributes",":","is_confident",":","bool",".","True","if","we","could","confidently","assign","a","label","to","this","variant",",","False","otherwise",".","variant",":","nucleus.protos.Variant","proto","that","we","assigned","a","label","for",".","genotype",":","tuple","of","ints",".","The","labeled","genotype","(","e.g.",",","(","0",",","1",")","for","a","het",")","in","the","standard","nucleus.proto.VariantCall","style",".","Genotype","can","be","None","if","the","labeler","does","n't","have","any","genotype","to","assign",".","If","Genotype","is","not","None",",","the","genotype","of","variant","will","be","set","to","genotype","."]
docstr: Computes the label value for an example using alt_alleles_indices.
  
  This function computes the TensorFlow label value (0, 1, 2) we train
  DeepVariant to predict. The label value is an int >= which is the number of
  copies of the alt allele present, which is computed from the true genotypes
  (self.genotypes) and the alt_allele_indices ([0] for the first alt, [1] for
  the second, [0, 1] to combine the first and second). For example, suppose we
  have a variant with alts A and C, and a true genotype of (0, 1), indicating
  that we have 1 copy of the A allele. We'd expect:
  
    label_for_alt_alleles([0]) => 1 since there's 1 copy of the first alt.
    label_for_alt_alleles([1]) => 0 since there's 0 copies of the second alt.
    label_for_alt_alleles([0, 1]) => 1 since there's 1 copy of the first or
      second allele.
  
  Args:
    alt_alleles_indices: list[int]. A list of the alt_allele_indices used to
      compute the tf.Example for this candidate.
  
  Returns:
    int >= 0. The number of copies of alt_allele_indices we'd expect to be
    called for this example.
docstr_tok: ["Computes","the","label","value","for","an","example","using","alt_alleles_indices",".","This","function","computes","the","TensorFlow","label","value","(","0",",","1",",","2",")","we","train","DeepVariant","to","predict",".","The","label","value","is","an","int",">","=","which","is","the","number","of","copies","of","the","alt","allele","present",",","which","is","computed","from","the","true","genotypes","(","self.genotypes",")","and","the","alt_allele_indices","(","[","0","]","for","the","first","alt",",","[","1","]","for","the","second",",","[","0",",","1","]","to","combine","the","first","and","second",")",".","For","example",",","suppose","we","have","a","variant","with","alts","A","and","C",",","and","a","true","genotype","of","(","0",",","1",")",",","indicating","that","we","have","1","copy","of","the","A","allele",".","We","'d","expect",":","label_for_alt_alleles","(","[","0","]",")","=",">","1","since","there","'s","1","copy","of","the","first","alt",".","label_for_alt_alleles","(","[","1","]",")","=",">","0","since","there","'s","0","copies","of","the","second","alt",".","label_for_alt_alleles","(","[","0",",","1","]",")","=",">","1","since","there","'s","1","copy","of","the","first","or","second","allele",".","Args",":","alt_alleles_indices",":","list","[","int","]",".","A","list","of","the","alt_allele_indices","used","to","compute","the","tf.Example","for","this","candidate",".","Returns",":","int",">","=","0",".","The","number","of","copies","of","alt_allele_indices","we","'d","expect","to","be","called","for","this","example","."]
code: def label_for_alt_alleles(self, alt_alleles_indices):
      """Computes the label value for an example using alt_alleles_indices.
  
      This function computes the TensorFlow label value (0, 1, 2) we train
      DeepVariant to predict. The label value is an int >= which is the number of
      copies of the alt allele present, which is computed from the true genotypes
      (self.genotypes) and the alt_allele_indices ([0] for the first alt, [1] for
      the second, [0, 1] to combine the first and second). For example, suppose we
      have a variant with alts A and C, and a true genotype of (0, 1), indicating
      that we have 1 copy of the A allele. We'd expect:
  
        label_for_alt_alleles([0]) => 1 since there's 1 copy of the first alt.
        label_for_alt_alleles([1]) => 0 since there's 0 copies of the second alt.
        label_for_alt_alleles([0, 1]) => 1 since there's 1 copy of the first or
          second allele.
  
      Args:
        alt_alleles_indices: list[int]. A list of the alt_allele_indices used to
          compute the tf.Example for this candidate.
  
      Returns:
        int >= 0. The number of copies of alt_allele_indices we'd expect to be
        called for this example.
      """
      return sum(
          gt - 1 in alt_alleles_indices
          for gt in self.genotype
          if gt != 0
      )
  
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 2 for calling the VariantLabel obj's underlying member method code with example usage: obj.label_for_alt_alleles(alt_alleles_indices) and returns: sum