code: def parse_fasta_annotations(fastas, annot_tables, trans_table):
      
      if annot_tables is not False:
          annots = {}
          for table in annot_tables:
              for cds in open(table):
                  ID, start, end, strand = cds.strip().split()
                  annots[ID] = [start, end, int(strand)]
      for fasta in fastas:
          for seq in parse_fasta(fasta):
              if ('# ;gc_cont' not in seq[0] and '# ID=' not in seq[0]) and annot_tables is False:
                  print('# specify fasta from Prodigal or annotations table (-t)', file=sys.stderr)
                  exit()
              if 'ID=' in seq[0]:
                  ID = seq[0].rsplit('ID=', 1)[1].split(';', 1)[0]
                  contig = seq[0].split()[0].split('>')[1].rsplit('_%s' % (ID), 1)[0]
              else:
                  contig = seq[0].split()[0].split('>')[1].rsplit('_', 1)[0]
              locus = seq[0].split()[0].split('>')[1]
              # annotation info from Prodigal
              if ('# ;gc_cont' in seq[0] or '# ID=' in seq[0]):
                  info = seq[0].split(' # ')
                  start, end, strand = int(info[1]), int(info[2]), info[3]
                  if strand == '1':
                      strand = 1
                  else:
                      strand = -1
                  product = [''.join(info[4].split()[1:])]
              # annotation info from table
              else:
                  start, end, strand = annots[locus]
                  product = seq[0].split(' ', 1)[1]
              info = {'transl_table':[trans_table], \
                      'translation':[seq[1]], \
                      'product':product}
              yield contig, [locus, [start, end, strand], info]
docs: parse gene call information from Prodigal fasta output