def read_fasta(inputfile):
    """Method for loading sequences from a FASTA formatted file into :py:attr:`sequences` & :py:attr:`names`.
    This method is used by the base class :class:`modlamp.pydpi_py3.PeptideDescriptor` if the input is a FASTA file.

    :param inputfile: .fasta file with sequences and headers to read
    :return: list of sequences in the attribute :py:attr:`sequences` with corresponding sequence names in
        :py:attr:`names`.
    """
    names = list()
    sequences = list()
    seq = str()
    with open(inputfile) as f:
        all = f.readlines()
        last = all[-1]
        for line in all:
            if line.startswith('>'):
                names.append(line.split(' ')[0][1:].strip())
                sequences.append(seq.strip())
                seq = str()
            elif line == last:
                seq += line.strip()
                sequences.append(seq.strip())
            else:
                seq += line.strip()
    return sequences[1:], names
