mkt.databases.app.schema.KLIFSRegionLabelConfig

class mkt.databases.app.schema.KLIFSRegionLabelConfig(seq_align: ~mkt.databases.app.sequences.SequenceAlignment, label_size: int = 14, label_connector: bool = True, highlight_cartoon_transparency: float = 0.0, *, str_attr: str = 'KLIFS', label_offset: float = 12.0, label_min_dist: float = 4.5, label_spring_strength: float = 0.3, list_stick_positions: list[int] = <factory>)[source]

Bases: KLIFSConfig

Configuration for KLIFS residues with region name labels and all-ribbon representation.

Uses KLIFS color scheme with cartoon-only styling (no sticks) and places a label at the midpoint of each KLIFS region (e.g., ‘g.l’, ‘αC’, ‘hinge’). Labels use the collision-avoidance offset logic from the PyMOL renderer.

__init__(seq_align: ~mkt.databases.app.sequences.SequenceAlignment, label_size: int = 14, label_connector: bool = True, highlight_cartoon_transparency: float = 0.0, *, str_attr: str = 'KLIFS', label_offset: float = 12.0, label_min_dist: float = 4.5, label_spring_strength: float = 0.3, list_stick_positions: list[int] = <factory>) None

Methods

__eq__(other)

Return self==value.

__init__(seq_align[, label_size, ...])

__post_init__()

_build_align_to_klifs_mapping()

Build mapping from alignment position to KLIFS pocket position (0-indexed).

_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 region name labels at the midpoint of each KLIFS region.

generate_list_idx()

Generate list of 0-indexed positions for KLIFS residues.

generate_style_color_lists(list_idx)

Generate all-cartoon style with KLIFS pocket colors.

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__

highlight_cartoon_transparency

Cartoon transparency applied to colored/highlighted residues (0 = opaque, 1 = invisible).

label_connector

Whether to draw leader/connector lines from each residue to its label.

label_min_dist

Tighter minimum distance between region labels (angstroms).

label_offset

Closer offset for region labels (angstroms).

label_size

Font size for residue labels.

label_spring_strength

Spring force pulling labels back toward ideal position.

str_attr

'KLIFS').

list_stick_positions

No stick positions — all ribbon representation.

seq_align

SequenceAlignment object providing kinase info and dict_align.

list_idx

List of 1-indexed residue positions to be highlighted, generated in __post_init__.

list_color

List of colors for the residues to be highlighted, generated in __post_init__.

list_style

List of styles for the residues to be highlighted, generated in __post_init__.

list_label

List of labels for the residues to be highlighted (None for no label).

__init__(seq_align: ~mkt.databases.app.sequences.SequenceAlignment, label_size: int = 14, label_connector: bool = True, highlight_cartoon_transparency: float = 0.0, *, str_attr: str = 'KLIFS', label_offset: float = 12.0, label_min_dist: float = 4.5, label_spring_strength: float = 0.3, list_stick_positions: list[int] = <factory>) None
_build_align_to_klifs_mapping() dict[int, int][source]

Build mapping from alignment position to KLIFS pocket position (0-indexed).

Accounts for gaps in the pocket sequence using the same logic as _index_stick_region.

Returns:

Mapping from alignment position (0-indexed) to KLIFS pocket position (0-84).

Return type:

dict[int, int]

generate_labels(list_idx: list[int]) list[str | None][source]

Generate region name labels at the midpoint of each KLIFS region.

For each KLIFS region defined in DICT_POCKET_KLIFS_REGIONS, places a label at the alignment position closest to the region midpoint.

Parameters:

list_idx (list[int]) – List of 0-indexed residue positions.

Returns:

Region name at midpoint positions, None for all others.

Return type:

list[str | None]

generate_style_color_lists(list_idx: list[int]) tuple[list[str], list[str]][source]

Generate all-cartoon style with KLIFS pocket colors.

Parameters:

list_idx (list[int]) – List of 0-indexed residue positions.

Returns:

All residues get ‘cartoon’ style, colors from KLIFS pocket colors.

Return type:

tuple[list[str], list[str]]

label_min_dist: float = 4.5

Tighter minimum distance between region labels (angstroms).

label_offset: float = 12.0

Closer offset for region labels (angstroms).

label_spring_strength: float = 0.3

Spring force pulling labels back toward ideal position.

list_color: list[str]

List of colors for the residues to be highlighted, generated in __post_init__.

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]

No stick positions — all ribbon representation.

list_style: list[str]

List of styles for the residues to be highlighted, generated in __post_init__.

seq_align: SequenceAlignment

SequenceAlignment object providing kinase info and dict_align.