ngs_tools.fasta.FastaEntry

Module Contents

Classes

FastaEntry

Represents a single FASTA entry, which consists of a header and a sequence.

exception ngs_tools.fasta.FastaEntry.FastaEntryError

Bases: Exception

Common base class for all non-exit exceptions.

class ngs_tools.fasta.FastaEntry.FastaEntry(header: str, sequence: str)

Represents a single FASTA entry, which consists of a header and a sequence.

ATTRIBUTE_PARSER

Static attribute that is a compiled regex. Used to parse attributes.

_header

Header string; for internal use only. Use header instead.

_sequence

Sequence string; for internal use only. Use sequence instead.

property header: str

Header string, including the > character

property sequence: str

Sequence string

property name: str

Name of the sequence, which comes immedately after > in the header

property attributes: Dict[str, str]

Dictionary of entry attributes, parsed from the substring of the header after the first space character.

ATTRIBUTE_PARSER
static make_header(name: str, attributes: Dict[str, str]) str

Static method to construct a header string from a name and attributes.

Parameters:
  • name – entry name

  • attributes – dictionary containing entry attributes