mkt.databases.app.schema.KLIFSCustomConfig
- class mkt.databases.app.schema.KLIFSCustomConfig(seq_align: ~mkt.databases.app.sequences.SequenceAlignment, label_spring_strength: float = 0.0, *, str_attr: str = 'KLIFS', label_offset: float = 4.0, label_min_dist: float = 0.0, label_size: int = 24, label_connector: bool = False, highlight_cartoon_transparency: float = 0.3, list_stick_positions: list[int] = <factory>, list_uniprot_idx: list[int] = <factory>, list_custom_color: list[str] = <factory>)[source]
Bases:
KLIFSConfigConfiguration for KLIFS regions as semi-transparent cartoon with custom stick residues.
Renders all KLIFS pocket residues as pocket-colored, slightly transparent cartoon and overlays a user-supplied set of full-length UniProt positions as opaque sticks in user-supplied colors.
- __init__(seq_align: ~mkt.databases.app.sequences.SequenceAlignment, label_spring_strength: float = 0.0, *, str_attr: str = 'KLIFS', label_offset: float = 4.0, label_min_dist: float = 0.0, label_size: int = 24, label_connector: bool = False, highlight_cartoon_transparency: float = 0.3, list_stick_positions: list[int] = <factory>, list_uniprot_idx: list[int] = <factory>, list_custom_color: list[str] = <factory>) None
Methods
__eq__(other)Return self==value.
__init__(seq_align[, label_spring_strength, ...])__post_init__()_generate_list_idx_from_dict_align_with_attr()Generate list of 0-indexed attribute positions from dict_align.
_index_stick_region()Extract the indices of the residues in the KLIFS pocket region by removing gaps.
generate_labels(list_idx)Generate amino acid + UniProt position labels for the custom stick residues.
Generate 0-indexed positions for KLIFS pocket residues plus custom positions.
generate_style_color_lists(list_idx)Generate style and color lists for KLIFS regions and custom residues.
return_list_cif_idx()Return list of 0-indexed positions corresponding to the CIF sequence.
return_list_idx_intersect()Return list of 0-indexed positions at intersection of CIF and attribute sequences.
return_list_intersect_color_style()Generate the indices, styles, and colors for highlighting.
Attributes
__dataclass_fields____dataclass_params____match_args__Cartoon transparency for the colored KLIFS regions (0 = opaque, 1 = invisible).
No leader lines for the zoomed pocket view.
No collision repulsion between the few custom labels.
Small offset (angstroms) so the label sits next to its residue.
Larger font for the zoomed pocket view.
label_spring_strengthSpring force pulling labels back toward ideal position (0 = no spring).
str_attr'KLIFS').
List of 1-indexed full-length UniProt positions to highlight as sticks.
List of colors corresponding to list_uniprot_idx (must be the same length).
List of 0-indexed positions in KLIFS sequence for stick representation.
SequenceAlignment object providing kinase info and dict_align.
List of 1-indexed residue positions to be highlighted, generated in __post_init__.
List of colors for the residues to be highlighted, generated in __post_init__.
List of styles for the residues to be highlighted, generated in __post_init__.
List of labels for the residues to be highlighted (None for no label).
- __init__(seq_align: ~mkt.databases.app.sequences.SequenceAlignment, label_spring_strength: float = 0.0, *, str_attr: str = 'KLIFS', label_offset: float = 4.0, label_min_dist: float = 0.0, label_size: int = 24, label_connector: bool = False, highlight_cartoon_transparency: float = 0.3, list_stick_positions: list[int] = <factory>, list_uniprot_idx: list[int] = <factory>, list_custom_color: list[str] = <factory>) None
- generate_labels(list_idx: list[int]) list[str | None][source]
Generate amino acid + UniProt position labels for the custom stick residues.
- Parameters:
list_idx (list[int]) – List of 0-indexed residue positions.
- Returns:
Label ‘X###’ (e.g., ‘T790’, single-letter amino acid + 1-indexed UniProt position) for custom positions, None for KLIFS-only positions.
- Return type:
list[str | None]
- generate_list_idx() list[int][source]
Generate 0-indexed positions for KLIFS pocket residues plus custom positions.
- Returns:
Sorted union of 0-indexed KLIFS pocket residues (present in the CIF) and custom UniProt positions (1-indexed input converted to 0-indexed), filtered to those present in the KinCore CIF structure.
- Return type:
list[int]
- generate_style_color_lists(list_idx: list[int]) tuple[list[str], list[str]][source]
Generate style and color lists for KLIFS regions and custom residues.
- Parameters:
list_idx (list[int]) – List of 0-indexed residue positions.
- Returns:
Custom positions get ‘stick’ style and their supplied color; all other (KLIFS) positions get ‘cartoon’ style and their KLIFS pocket color.
- Return type:
tuple[list[str], list[str]]
- highlight_cartoon_transparency: float = 0.3
Cartoon transparency for the colored KLIFS regions (0 = opaque, 1 = invisible).
- label_connector: bool = False
No leader lines for the zoomed pocket view.
- label_min_dist: float = 0.0
No collision repulsion between the few custom labels.
- label_offset: float = 4.0
Small offset (angstroms) so the label sits next to its residue.
- label_size: int = 24
Larger font for the zoomed pocket view.
- list_color: list[str]
List of colors for the residues to be highlighted, generated in __post_init__.
- list_custom_color: list[str]
List of colors corresponding to list_uniprot_idx (must be the same length).
- list_idx: list[int]
List of 1-indexed residue positions to be highlighted, generated in __post_init__.
- list_label: list[str | None]
List of labels for the residues to be highlighted (None for no label).
- list_stick_positions: list[int]
List of 0-indexed positions in KLIFS sequence for stick representation.
- list_style: list[str]
List of styles for the residues to be highlighted, generated in __post_init__.
- list_uniprot_idx: list[int]
List of 1-indexed full-length UniProt positions to highlight as sticks.
- seq_align: SequenceAlignment
SequenceAlignment object providing kinase info and dict_align.