code: def hgvs_to_vcf(self, var_g):
          
  
          if var_g.type != "g":
              raise RuntimeError("Expected g. variant, got {var_g}".format(var_g=var_g))
  
          vleft = self.hn.normalize(var_g)
  
          (start_i, end_i) = _as_interbase(vleft.posedit)
  
          chr = self.ac_to_chr_name_map[vleft.ac]
  
          typ = vleft.posedit.edit.type
  
          if typ == "dup":
              start_i -= 1
              alt = self.hdp.seqfetcher.fetch_seq(vleft.ac, start_i, end_i)
              ref = alt[0]
              end_i = start_i
              return (chr, start_i + 1, ref, alt, typ)
  
          if vleft.posedit.edit.ref == vleft.posedit.edit.alt:
              return None
  
          alt = vleft.posedit.edit.alt or ""
  
          if end_i - start_i == 1 and vleft.posedit.length_change == 0:
              # SNVs aren't left anchored
              ref = vleft.posedit.edit.ref
  
          else:
              # everything else is left-anchored
              start_i -= 1
              ref = self.hdp.seqfetcher.fetch_seq(vleft.ac, start_i, end_i)
              alt = ref[0] + alt
  
          return (chr, start_i + 1, ref, alt, typ)
docs: **EXPERIMENTAL**
  
          converts a single hgvs allele to (chr, pos, ref, alt) using
          the given assembly_name. The chr name uses official chromosome
          name (i.e., without a "chr" prefix).
  
          Returns None for non-variation (e.g., NC_000006.12:g.49949407=)