class_docstr: DataClass holding information about a matching of variants.
  
  The haplotype labeling algorithm, at its core, searches for an assignment of
  genotypes to the candidate variants and the truth variants that result in the
  same diploid haplotype sequences, which we call a match. All of the
  information in that previous sentence is captured here as class attributes:
  
  Attributes:
    haplotypes: list[str]. The sorted list of haplotypes produced by this match.
    candidates: list[nucleus.proto.Variant]: The list of candidate variants.
    truths: list[nucleus.proto.Variant]: The list of true variants.
    candidate_genotypes: list[tuple]: The genotypes that, when assigned to the
      candidate variants, give rise to haplotypes.
    truth_genotypes: list[tuple]: The genotypes that, when assigned to the known
      variants, give rise to haplotypes.
class_docstr_tok: ["DataClass","holding","information","about","a","matching","of","variants",".","The","haplotype","labeling","algorithm",",","at","its","core",",","searches","for","an","assignment","of","genotypes","to","the","candidate","variants","and","the","truth","variants","that","result","in","the","same","diploid","haplotype","sequences",",","which","we","call","a","match",".","All","of","the","information","in","that","previous","sentence","is","captured","here","as","class","attributes",":","Attributes",":","haplotypes",":","list","[","str","]",".","The","sorted","list","of","haplotypes","produced","by","this","match",".","candidates",":","list","[","nucleus.proto.Variant","]",":","The","list","of","candidate","variants",".","truths",":","list","[","nucleus.proto.Variant","]",":","The","list","of","true","variants",".","candidate_genotypes",":","list","[","tuple","]",":","The","genotypes","that",",","when","assigned","to","the","candidate","variants",",","give","rise","to","haplotypes",".","truth_genotypes",":","list","[","tuple","]",":","The","genotypes","that",",","when","assigned","to","the","known","variants",",","give","rise","to","haplotypes","."]
code: def __init__(
      self,
      haplotypes,
      candidates,
      candidate_genotypes,
      truths,
      truth_genotypes,
  ):
      if len(haplotypes) not in {1, 2}:
          raise ValueError(
              "Expected 1 or 2 haplotypes but got", haplotypes
          )
      if len(candidates) != len(candidate_genotypes):
          raise ValueError(
              "candidates and candidate_genotypes should have the same length"
          )
      if len(truths) != len(truth_genotypes):
          raise ValueError(
              "truths and truth_genotypes should have the same length"
          )
  
      self.haplotypes = sorted(haplotypes)
      self.candidates = candidates
      self.truths = truths
      self.candidate_genotypes = candidate_genotypes
      self.truth_genotypes = truth_genotypes
  
      # Computed on-demand.
      self._n_false_positives = None
      self._n_false_negatives = None
  
imports: import collections
  import copy
  import enum
  import heapq
  import itertools
  from absl import logging
  from deepvariant.labeler import variant_labeler
  from deepvariant.protos import deepvariant_pb2
  from third_party.nucleus.io import fasta
  from third_party.nucleus.util import ranges
  from third_party.nucleus.util import variant_utils
  from third_party.nucleus.util import variantcall_utils
label_desc: Use image node_id 1 to create a new HaplotypeMatch object from inherited base classes: object with example: obj = HaplotypeMatch(haplotypes, candidates, candidate_genotypes, truths, truth_genotypes)