How to use the pyteomics.fasta.read function in pyteomics

To help you get started, we’ve selected a few pyteomics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github statisticalbiotechnology / diffacto / diffacto / diffacto.py View on Github external
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