docs: def get_variants(self, ref_sequence_name, allowed_ctg_coords, allowed_ref_coords, nucmer_matches=None):
          '''Nucmr coords = dict. Key=contig name. Value = list of intervals of ref coords that match the contig.
             Made by assembly_compare.AssemblyCompare.nucmer_hits_to_ref_coords
             Returns dictionary. Key=contig name. Value = list of variants. Each variant
             is a tuple: (
                 0 = position,
                 1 = type in ['n', 'p']
                 2 = Variant string, eg 'D2E',
                 3 = variant effect (as returned by _get_variant_effect)
                 4 = list of pymummer.variant.Variant that made up this variant (could be more than one because of
                     variants in the same codon)
                 5 = set {matching known variants from metadata (=sequence_metadata.SequenceMetadata)}
                 6 = set {known ref metadata (=sequence_metadata.SequenceMetadata)  at same position as SNP}, excluding those from 4
             )
          '''
          mummer_variants = self._get_mummer_variants(self.nucmer_snp_file)
          variants = {}
          seq_type, is_variant_only = self.refdata.sequence_type(ref_sequence_name)
          ref_sequence = self.refdata.sequence(ref_sequence_name)
  
          if ref_sequence_name in self.refdata.metadata:
              refdata_var_dict = self.refdata.metadata[ref_sequence_name]
          else:
              refdata_var_dict = None
  
          known_non_wild_variants_in_ref = self.refdata.all_non_wild_type_variants(ref_sequence_name)
  
          for contig in allowed_ctg_coords:
              if contig not in allowed_ref_coords:
                  continue
  
              used_known_variants = set()
              variants[contig] = []
  
              if contig in mummer_variants:
                  for mummer_variant_list in mummer_variants[contig]:
                      ref_start = min([x.ref_start for x in mummer_variant_list])
                      ref_end = max([x.ref_end for x in mummer_variant_list])
                      ctg_start = min([x.qry_start for x in mummer_variant_list])
                      ctg_end = min([x.qry_end for x in mummer_variant_list])
                      ref_interval = intervals.Interval(ref_start, ref_end)
                      ctg_interval = intervals.Interval(ctg_start, ctg_end)
                      ref_ok = True in {x.intersects(ref_interval) for x in allowed_ref_coords[contig]}
                      qry_ok = True in {x.intersects(ctg_interval) for x in allowed_ctg_coords[contig]}
  
                      if not (ref_ok and qry_ok):
                          continue
  
                      if seq_type == 'p':
                          new_variant, used_variants = self._get_one_variant_for_one_contig_coding(ref_sequence, refdata_var_dict, mummer_variant_list)
                      else:
                          for mummer_variant in mummer_variant_list:
                              new_variant, used_variants = self._get_one_variant_for_one_contig_non_coding(refdata_var_dict, mummer_variant)
  
                      if new_variant is not None:
                              variants[contig].append(new_variant)
                      used_known_variants.update(used_variants)
  
              # for this contig, need to know all the ref sequence and coords it maps to.
              # Then report just the unused known variants, as the contig also has these variants
              if seq_type == 'p':
                  new_variants = self._get_remaining_known_ref_variants(known_non_wild_variants_in_ref['p'], used_known_variants, allowed_ref_coords[contig])
  
              else:
                  new_variants = self._get_remaining_known_ref_variants(known_non_wild_variants_in_ref['n'], used_known_variants, allowed_ref_coords[contig])
  
              if is_variant_only:
                  new_variants = [x for x in new_variants if len(x[5]) > 0]
  
              variants[contig].extend(new_variants)
              if len(variants[contig]) == 0:
                  del variants[contig]
  
          return variants