Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _load_fasta(db, id_regex):
prot_dict = dict()
for header, seq in fasta.read(db):
seq = seq.replace("I", "L").upper() # convert DB sequence I -> L
prot_id = header.split()[0]
if id_regex is not None:
find_id = re.findall(id_regex, header)
if len(find_id) > 0:
prot_id = find_id[0]
prot_dict[prot_id] = seq
return prot_dict