The sequence iterator interface is the recommended way to parse sequence files.
The load function provides a standard, high-level interface to iterate over
sequence files regardless of file type or whether they are compressed. The
method accepts single or multiple file paths and employs the correct file
handlers, iterator objects, and parsers for the user.

The benefit of the sequence iterator interface is that the type of the file and
any file format details are abstracted away from the user. In this manner, the
user does not need to worry about whether they’re operating on FASTA or FASTQ
files or any differences in the returns from their respective parsers.

For the first set of sequence iterator examples, we’re going to use the
load function. The load function is intended to operate on file paths,
so let’s create two files for it to use. The first one will be a regular FASTA
file, and the second will be a gzip’d FASTQ file:

Lower-level parsing functions are also made available in addition to the
sequence iterator interface. These functions can be used to directly parse a
single sequence file. They accept file paths, file handles, or file-like
objects.