Gapped Sequence#

class pyfamsa.GappedSequence#

A gapped sequence, storing a single row in an alignment.

Internally, gapped sequences are not stored in a single string in FAMSA, but using a gap counter for each position. This allows saving a lot of memory for alignments containing lots of gaps, but adds some overhead to decode the full sequence.

__init__(id, sequence)#

Create a new sequence.

Parameters:
  • id (bytes) – The sequence identifier.

  • sequence (bytes) – The sequence contents.

Raises:

ValueError – when initializing an empty sequence.

copy()#

Copy the sequence data, and return the copy.

gapped_size#

The number of symbols in the sequence, including gaps.

Type:

int

id#

The identifier of the gapped sequence.

Type:

bytes

sequence#

The symbols of the gapped sequence as an ASCII string.

Type:

bytes

size#

The number of symbols in the sequence, excluding gaps.

Type:

int