class_docstr: Haplotype-based variant labeler.
class_docstr_tok: ["Haplotype-based","variant","labeler","."]
code: def make_labeler_ref(self, candidates, true_variants, bufsize=20):
      all_variants = candidates + true_variants
      contig = all_variants[0].reference_name
      start = min(x.start for x in all_variants)
      end = max(x.end for x in all_variants)
      contig_nbp = self._ref_reader.contig(contig).n_bases
      region = ranges.make_range(
          contig, max(start - 1, 0), min(end + bufsize, contig_nbp)
      )
      ref_bases = self._ref_reader.query(region)
      return ReferenceRegion(ref_bases, start=region.start)
  
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 5 for calling the HaplotypeLabeler obj's underlying member method code with example usage: obj.make_labeler_ref(candidates, true_variants, bufsize) and returns: ReferenceRegion