docs: def create_searchspace(lookup, fastafn, proline_cut=False,
                         reverse_seqs=True, do_trypsinize=True):
      """Given a FASTA database, proteins are trypsinized and resulting peptides
      stored in a database or dict for lookups"""
      allpeps = []
      for record in SeqIO.parse(fastafn, 'fasta'):
          if do_trypsinize:
              pepseqs = trypsinize(record.seq, proline_cut)
          else:
              pepseqs = [record.seq]
          # Exchange all leucines to isoleucines because MS can't differ
          pepseqs = [(str(pep).replace('L', 'I'),) for pep in pepseqs]
          allpeps.extend(pepseqs)
          if len(allpeps) > 1000000:  # more than x peps, write to SQLite
              lookup.write_peps(allpeps, reverse_seqs)
              allpeps = []
      # write remaining peps to sqlite
      lookup.write_peps(allpeps, reverse_seqs)
      lookup.index_peps(reverse_seqs)
      lookup.close_connection()