def parseFASTA(fastaFNH):
recs = []<EOL>seq = []<EOL>seqID = "<STR_LIT>"<EOL>descr = "<STR_LIT>"<EOL>for line in file_handle(fastaFNH):<EOL><INDENT>line = line.strip()<EOL>if line[<NUM_LIT:0>] == "<STR_LIT:;>":<EOL><INDENT>continue<EOL><DEDENT>if line[<NUM_LIT:0>] == "<STR_LIT:>>":<EOL><INDENT>if seq:<EOL><INDENT>recs.append(FASTARecord(seqID, descr, "<STR_LIT>".join(seq)))<EOL>seq = []<EOL><DEDENT>line = line[<NUM_LIT:1>:].split(None, <NUM_LIT:1>)<EOL>seqID, descr = line[<NUM_LIT:0>], line[<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>seq.append(line)<EOL><DEDENT><DEDENT>if seq:<EOL><INDENT>recs.append(FASTARecord(seqID, descr, "<STR_LIT>".join(seq)))<EOL><DEDENT>return recs<EOL>
Parse the records in a FASTA-format file keeping the file open, and reading through
one line at a time.

:type source: path to FAST file or open file handle
:param source: The data source from which to parse the FASTA records.
               Expects the input to resolve to a collection that can be iterated
               through, such as an open file handle.

:rtype: tuple
:return: FASTA records containing entries for id, description and data.