code: def print_locus_quals(locus_tag, locus, quals_ftypes):
      
      prot_id = None
      for ftype in quals_ftypes:
          for i, quals in enumerate(locus[locus_tag][ftype]):
              for elem in quals:
                  elem_id = elem[0]
                  if len(locus[locus_tag]["protein_id"]) > 0 and ftype in ("mRNA", "CDS"):
                      elem_id = locus[locus_tag]["protein_id"][i]
                  if ftype == 'misc_RNA': ftype = 'ncRNA'
                  print("\t".join(str(x) for x in (elem_id, elem[1], elem[2], ftype)))
docs: Given a locus_tag and dict of feaures, print out 3-column output:
          locus_tag, qualifier, value
  
      Replace locus_tag with protein_id if processing an "mRNA" or "CDS"