mkt.databases.app.sequences.SequenceAlignment
- class mkt.databases.app.sequences.SequenceAlignment(str_kinase: str, dict_color: dict[str, str], bool_mismatch: bool = True, bool_klifs: bool = True, bool_reverse: bool = True, obj_kinase: KinaseInfo | None = None)[source]
Bases:
objectClass to generate sequence alignments for kinase sequences.
- __init__(*args: Any, **kwargs: Any) None
Methods
__eq__(other)Return self==value.
__post_init__()_map_single_alignment(idx_start, idx_end, ...)Map the indices of the alignment to the original sequence.
_parse_start_end_values(start_or_end, str_seq)Parse the start and end keys for the alignment.
Iterate through the KinaseInfo object and generate a list of sequences and a list of colors.
Attributes
__dataclass_fields____dataclass_params____match_args____pydantic_config__If True, shade KLIFS pocket residues using KLIFS pocket colors, by default True.
If True, show mismatches with UniProt seq in crimson, by default True.
Whether or not to reverse order of inputs
KinaseInfo object from which to extract sequences (loaded from str_kinase if not provided).
Gene name of the kinase for which to generate the sequence alignment.
Color dictionary for sequence viewer.
- static _map_single_alignment(idx_start: int, idx_end: int, str_uniprot: str, seq_obj: str | None = None)[source]
Map the indices of the alignment to the original sequence.
- Parameters:
idx_start (int) – Start index of the alignment.
idx_end (int) – End index of the alignment.
str_uniprot (str) – Full canonical UniProt sequence.
seq_obj (str | None) – Seq obj provided by user or database. If None, use UniProt sequence. This is the case for Pfam, which only provides start and end indices.
- Returns:
Output string with the alignment mapped to the original sequence.
- Return type:
str
- _parse_start_end_values(start_or_end: Any, str_seq: str) int | None[source]
Parse the start and end keys for the alignment.
- Parameters:
start_or_end (Any) – The start or end key to parse.
str_seq (str) – The sequence to parse - only used if start_or_end callable.
- Returns:
The parsed start or end index, or None if not found.
- Return type:
int | None
- bool_klifs: bool = True
If True, shade KLIFS pocket residues using KLIFS pocket colors, by default True.
- bool_mismatch: bool = True
If True, show mismatches with UniProt seq in crimson, by default True.
- bool_reverse: bool = True
Whether or not to reverse order of inputs
- dict_color: dict[str, str]
Color dictionary for sequence viewer.
- generate_alignments() dict[str, str | list[str]][source]
Iterate through the KinaseInfo object and generate a list of sequences and a list of colors.
- Returns:
A dictionary with keys DICT_ALIGNMENT containing the sequences and a list of colors per residue.
- Return type:
dict[str, str | list[str]]
- obj_kinase: KinaseInfo | None = None
KinaseInfo object from which to extract sequences (loaded from str_kinase if not provided).
- str_kinase: str
Gene name of the kinase for which to generate the sequence alignment.