code: def _get_variant_stats(variant, vaf_available=False, vcf_reader=None):
      """Returns a VariantStats object corresponding to the input variant."""
      vtype = _get_variant_type(variant)
      is_transition, is_transversion = _tstv(variant, vtype)
      vaf = None
      if vaf_available:
          vaf = _get_vaf(variant, vcf_reader)
  
      return VariantStats(
          reference_name=variant.reference_name,
          position=(variant.start + 1),
          reference_bases=variant.reference_bases,
          alternate_bases=list(variant.alternate_bases),
          variant_type=vtype,
          is_transition=is_transition,
          is_transversion=is_transversion,
          is_variant=variant_utils.is_variant_call(variant),
          depth=variantcall_utils.get_format(
              variant_utils.only_call(variant), "DP"
          ),
          genotype_quality=variantcall_utils.get_gq(
              variant_utils.only_call(variant)
          ),
          genotype=str(
              sorted(
                  variantcall_utils.get_gt(
                      variant_utils.only_call(variant)
                  )
              )
          ),
          vaf=vaf,
          qual=variant.quality,
      )
  
imports: import collections
  import itertools
  import math
  import numpy
  from third_party.nucleus.util import variant_utils
  from third_party.nucleus.util import variantcall_utils
  from deepvariant import vcf_stats_vis
label_desc: Use image node_id 4 for calling a global function with example usage: _get_variant_stats(variant, vaf_available, vcf_reader) and returns: VariantStats