mkt.databases.app.schema.MutationsGroupConfig
- class mkt.databases.app.schema.MutationsGroupConfig(seq_align: SequenceAlignment, label_offset: float = 20.0, label_min_dist: float = 6.0, label_spring_strength: float = 0.0, label_size: int = 14, label_connector: bool = True, highlight_cartoon_transparency: float = 0.0, *, str_attr: str = 'Mutations', bool_mutations_by_group: bool = True, bool_klifs_only: bool = True, bool_show_sticks: bool = False, str_filepath_json: str)[source]
Bases:
MutationsConfigGroup-averaged configuration for mutation visualization in PyMOL.
- __init__(seq_align: SequenceAlignment, label_offset: float = 20.0, label_min_dist: float = 6.0, label_spring_strength: float = 0.0, label_size: int = 14, label_connector: bool = True, highlight_cartoon_transparency: float = 0.0, *, str_attr: str = 'Mutations', bool_mutations_by_group: bool = True, bool_klifs_only: bool = True, bool_show_sticks: bool = False, str_filepath_json: str) None
Methods
__eq__(other)Return self==value.
__init__(seq_align[, label_offset, ...])__post_init__()_filter_mutations_to_klifs()Filter dict_mutations to only include residues in the 85 KLIFS pocket positions.
_generate_list_idx_from_dict_align_with_attr()Generate list of 0-indexed attribute positions from dict_align.
_get_klifs_label(idx_0based)Get KLIFS pocket label for a position (e.g., 'GK:45').
_get_klifs_uniprot_mapping(klifs_mapping[, ...])Create mapping between UniProt positions and KLIFS indices.
_get_klifs_uniprot_positions(klifs_mapping)Get the set of UniProt positions (1-indexed) in the KLIFS pocket.
_get_uniprot_label(idx_0based)Get amino acid + UniProt position label (e.g., 'T790').
_index_mutation_region()Extract the indices of the top mutation residues for stick highlighting.
_map_group_klifs_to_uniprot(dict_group_data)Map group-averaged KLIFS-indexed data to target kinase's UniProt positions.
_preprocess_mutation_dict()Preprocess mutation dictionary from JSON file.
generate_labels(list_idx)Generate labels for top mutations: KLIFS pocket label (e.g., 'GK:45').
generate_list_idx()Generate list of 0-indexed positions for mutation residues.
generate_style_color_lists(list_idx)Generate style and color lists for mutation 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__True).
True).
False for group-averaged).
highlight_cartoon_transparencyCartoon transparency applied to colored/highlighted residues (0 = opaque, 1 = invisible).
label_connectorWhether to draw leader/connector lines from each residue to its label.
label_min_distMinimum distance (angstroms) between labels for collision avoidance.
label_offsetAngstroms offset from CA for label pseudoatom placement.
label_sizeFont size for residue labels.
label_spring_strengthSpring force pulling labels back toward ideal position (0 = no spring).
str_attr'Mutations').
File path to the JSON file containing the mutation dictionary.
Dictionary of mutation positions (1-indexed) with corresponding normalized counts.
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: SequenceAlignment, label_offset: float = 20.0, label_min_dist: float = 6.0, label_spring_strength: float = 0.0, label_size: int = 14, label_connector: bool = True, highlight_cartoon_transparency: float = 0.0, *, str_attr: str = 'Mutations', bool_mutations_by_group: bool = True, bool_klifs_only: bool = True, bool_show_sticks: bool = False, str_filepath_json: str) None
- bool_klifs_only: bool = True
True).
- Type:
Whether to only highlight KLIFS pocket residues (default
- bool_mutations_by_group: bool = True
True).
- Type:
Whether to average mutation counts by kinase group (default
- bool_show_sticks: bool = False
False for group-averaged).
- Type:
Whether to show top mutations as sticks (default
- dict_mutations: dict[int, float]
Dictionary of mutation positions (1-indexed) with corresponding normalized counts.
- generate_labels(list_idx: list[int]) list[str | None][source]
Generate labels for top mutations: KLIFS pocket label (e.g., ‘GK:45’).
- Parameters:
list_idx (list[int]) – List of 0-indexed residue positions.
- Returns:
KLIFS labels for top mutation positions, None for others.
- Return type:
list[str | None]
- 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_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.
- str_filepath_json: str
File path to the JSON file containing the mutation dictionary.