seqme.read_fasta

Contents

seqme.read_fasta#

seqme.read_fasta(path, *, return_headers=False)[source]#

Retrieve sequences from a FASTA file.

Parameters:
  • path (str | Path) – Path to FASTA file.

  • return_headers (bool) – Whether to return sequence headers alongside the sequences.

Return type:

list[str] | tuple[list[str], list[str]]

Returns:

The list of sequences.

If return_headers is True, returns a tuple (headers, sequences), where headers is a list of header strings (without the leading >) and sequences is the corresponding list of sequence strings.