code: def _compute_variant_stats_for_charts(variants, vcf_reader=None):
      """Computes variant statistics of each variant.
  
      Args:
        variants: iterable(Variant).
        vcf_reader: VcfReader.
  
      Returns:
        A dict with summarized data prepared for charts.
      """
      vaf_available = False
      if vcf_reader:
          vcf_columns = [col.id for col in vcf_reader.header.formats]
          vaf_available = "VAF" in vcf_columns
  
      single_var_stats = _single_variant_stats(
          variants, vaf_available=vaf_available, vcf_reader=vcf_reader
      )
  
      titv_counts = _count_titv(single_var_stats)
      variant_type_counts = _count_variant_types(single_var_stats)
  
      base_changes, indel_sizes = _count_base_changes_and_indel_sizes(
          single_var_stats
      )
  
      histograms = _vaf_histograms_by_genotype(
          single_var_stats, number_of_bins=50
      )
  
      qual_histogram = _compute_qual_histogram(single_var_stats)
      gq_hist = _compute_gq_histogram(single_var_stats)
      depth_histogram = _compute_depth_histogram(single_var_stats)
  
      vis_data = {
          "vaf_histograms_by_genotype": histograms,
          "indel_sizes": indel_sizes,
          "base_changes": base_changes,
          "qual_histogram": qual_histogram,
          "gq_histogram": gq_hist,
          "variant_type_counts": variant_type_counts,
          "depth_histogram": depth_histogram,
          "titv_counts": titv_counts,
      }
  
      return vis_data
  
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 18 for calling a global function with example usage: _compute_variant_stats_for_charts(variants, vcf_reader) and returns: vis_data