conkit.core.sequence module

Sequence container used throughout ConKit

class Sequence(id, seq)[source]

Bases: conkit.core.entity.Entity

A sequence template to store all associated information

Examples

>>> from conkit.core import Sequence
>>> sequence_entry = Sequence("example", "ABCDEF")
>>> print(sequence_entry)
Sequence(id="example" seq="ABCDEF" seqlen=6)
id

A unique identifier

Type:str
remark

The Sequence-specific remarks

Type:list
seq

The protein sequence as str

Type:str
seq_len

The protein sequence length

Type:int
align_global(other, id_chars=2, nonid_chars=1, gap_open_pen=-0.5, gap_ext_pen=-0.1, inplace=False)[source]

Generate a global alignment between two Sequence instances

Parameters:
  • other (Sequence) –
  • id_chars (int, optional) –
  • nonid_chars (int, optional) –
  • gap_open_pen (float, optional) –
  • gap_ext_pen (float, optional) –
  • inplace (bool, optional) – Replace the saved order of residues [default: False]
Returns:

Tuple containing two Sequence instances, regardless of inplace

Return type:

tuple

align_local(other, id_chars=2, nonid_chars=1, gap_open_pen=-0.5, gap_ext_pen=-0.1, inplace=False)[source]

Generate a local alignment between two Sequence instances

Parameters:
  • other (Sequence) –
  • id_chars (int, optional) –
  • nonid_chars (int, optional) –
  • gap_open_pen (float, optional) –
  • gap_ext_pen (float, optional) –
  • inplace (bool, optional) – Replace the saved order of residues [default: False]
Returns:

Tuple containing two Sequence instances, regardless of inplace

Return type:

tuple

remark

The Sequence-specific remarks

seq

The protein sequence as str

seq_ascii

The protein sequence as ASCII-encoded str

seq_encoded

The protein sequence encoded by numbers

seq_len

The protein sequence length