MultiSequence

class MultiSequence(sequences, name=None, mode=None, metadata=None, aligned=False, **kwargs)[source]

Class responsible for handling multiple sequences.

Constructor for MultiSequence

Parameters
  • sequences (Any) – Anything that can be parsed as multiple sequences.

  • name (Optional[str]) – Name of the multi-sequence instance

  • mode (Optional[str]) – Mode of the sequences. All sequences must have same mode/type. Otherwise error will be raised

  • metadata (Optional[dict]) – Metadata of the multi-sequence instance

  • aligned (bool) – True if sequences are aligned. Default is False

  • kwargs (Any) – Compatibility

Attributes

count

Total number of sequences.

index

Indices of the internals sequences.

is_alignment

Is mutli-sequence is aligned or not.

is_buckled

Is mulit-sequence instance is buckled or not.

metadata

Instance metadata.

mode

Mode/type of the sequences.

name

Name of the instance.

sequences

List of individual sequence instances.

skbio_mode

The skbio mode of the sequence.

Methods

buckle_for_alignment()

Buckle individual sequences for alignment.

copy()

Copy current instance.

from_buckled(sequences, buckled_pack, **kwargs)

Factory method to create MultiSequence using packed metadata from buckling.

get_consensus([indices])

If sequence are aligned, estimate consensus sequence from the MSA

get_iter([method])

Get generator for the idividual sequences.

get_string_as(**kwargs)

Get string of all sequences.

get_subset([indices])

Get subset of the mutli-sequence instance.

restore_buckle(buckled_pack)

Restore the buckled MultiSequence instance.

to_skbio_msa([indices])

Convert to skbio TabularMSA instance.

write(file[, mode])

Write the sequence data into the file.