docs: def load_mutations(gene_coords, mutation_to_drug_json, variants_txt, upstream_before=100):
      '''Load mutations from "mykrobe-style" files. mutation_to_drug_json is json file
      of mutation -> list of drugs. variants_txt is text file of variants used my mykrobe's
      make probes. gene_coords should be dict of gene coords made by the function
      genbank_to_gene_coords'''
      with open(mutation_to_drug_json) as f:
          drug_data = json.load(f)
  
      mutations = []
      genes_with_indels = set()
      genes_need_upstream = set()
      genes_non_upstream = set()
  
      with open(variants_txt) as f:
          for line in f:
              gene, variant, d_or_p = line.rstrip().split('\t')
              coding = 0 if gene == 'rrs' else 1
              d = {'gene': gene, 'var': variant, 'coding': coding, 'upstream': False}
              drug_data_key = d['gene'] + '_' + d['var']
              if drug_data_key not in drug_data:
                  print('KEY', drug_data_key, 'NOT FOUND', file=sys.stderr)
              else:
                  d['drugs'] = ','.join(sorted(drug_data[drug_data_key]))
  
              if d_or_p == 'DNA' and gene != 'rrs':
                  assert gene != 'rrs'
                  re_match = re.match('([ACGT]+)(-?[0-9]+)([ACGTX]+)', d['var'])
                  try:
                      ref, pos, alt = re_match.groups()
                  except:
                      print('regex error:', d['var'], file=sys.stderr)
                      continue
  
                  pos = int(pos)
                  if len(ref) != len(alt):
                      genes_with_indels.add(d['gene'])
                      continue
                  elif pos > 0:
                      #print('ignoring synonymous change (not implemented):', d['gene'], d['var'], d['drugs'], file=sys.stderr)
                      continue
                  elif pos < 0:
                      this_gene_coords = gene_coords[d['gene']]
                      d['upstream'] = True
                      if this_gene_coords['start'] < this_gene_coords['end']:
                          variant_pos_in_output_seq = upstream_before + pos + 1
                      else:
                          variant_pos_in_output_seq = upstream_before + pos + 1
                      assert variant_pos_in_output_seq > 0
                      d['var'] = ref + str(variant_pos_in_output_seq) + alt
                      d['original_mutation'] = variant
                      genes_need_upstream.add(d['gene'])
                  elif pos == 0:
                      print('Zero coord!', d, file=sys.stderr)
                      continue
                  else:
                      print('deal with?', d, file=sys.stderr)
                      continue
  
              mutations.append(d)
              if not d['upstream']:
                  genes_non_upstream.add(d['gene'])
  
      return mutations, genes_with_indels, genes_need_upstream, genes_non_upstream