Bio.SeqIO.SwissIO module

Bio.SeqIO support for the “swiss” (aka SwissProt/UniProt) file format.

You are expected to use this module via the Bio.SeqIO functions. See also the Bio.SwissProt module which offers more than just accessing the sequences as SeqRecord objects.

See also Bio.SeqIO.UniprotIO.py which supports the “uniprot-xml” format.

class Bio.SeqIO.SwissIO.SwissIterator(source: IO[str] | PathLike | str | bytes)

Bases: SequenceIterator

Parser to break up a Swiss-Prot/UniProt file into SeqRecord objects.

modes = 't'
__init__(source: IO[str] | PathLike | str | bytes) None

Iterate over a Swiss-Prot file and return SeqRecord objects.

Arguments:
  • source - input stream opened in text mode, or a path to a file

Every section from the ID line to the terminating // becomes a single SeqRecord with associated annotation and features.

This parser is for the flat file “swiss” format as used by:
  • Swiss-Prot aka SwissProt

  • TrEMBL

  • UniProtKB aka UniProt Knowledgebase

For consistency with BioPerl and EMBOSS we call this the “swiss” format. See also the SeqIO support for “uniprot-xml” format.

Rather than calling it directly, you are expected to use this parser via Bio.SeqIO.parse(…, format=”swiss”) instead.

__next__()

Return the next SeqRecord.

This method must be implemented by the subclass.

__abstractmethods__ = frozenset({})
__parameters__ = ()