def load_FASTA()

in lmgvp/deepfrier_utils.py [0:0]


def load_FASTA(filename):
    """
    Loads a FASTA file and returns the protein ids and their sequences.

    Args:
        filename: String representing the path to the FASTA file.
    Returns
        Tuple where the first elemnent is a list of protein ids and the second element is a list of protein sequences.
    """
    # Loads fasta file and returns a list of the Bio SeqIO records
    infile = open(filename, "rU")
    entries = []
    proteins = []
    for entry in SeqIO.parse(infile, "fasta"):
        entries.append(str(entry.seq))
        proteins.append(str(entry.id))
    return proteins, entries