mkt.databases.app.schema
Structure-highlighting configuration classes for the Streamlit app.
Defines the StructureConfig hierarchy (default, phosphosites, KLIFS, and
mutation variants) that parameterizes how kinase structures are colored and annotated
in the app.
Classes
|
Default configuration rendering the whole protein as cartoon with spectrum coloring. |
|
Configuration for highlighting adaptive KLIFS residues in PyMOL. |
|
Configuration for highlighting KLIFS residues in PyMOL. |
|
Configuration for KLIFS regions as semi-transparent cartoon with custom stick residues. |
|
Configuration for highlighting important KLIFS residues in PyMOL. |
|
Configuration for highlighting KLIFS pathogenic residues in PyMOL. |
|
Configuration for KLIFS residues with region name labels and all-ribbon representation. |
|
Configuration for generating PyMOL files with mutation data. |
|
Default configuration for mutation visualization in PyMOL. |
|
Group-averaged configuration for mutation visualization in PyMOL. |
|
KLIFS-focused configuration for mutation visualization in PyMOL. |
|
Configuration for highlighting phosphosites in PyMOL. |
|
Enumeration of standard configurations for PyMOL visualization. |
|
String-based enum for CLI choices (dataclass not hashable). |
|
Configuration for generating PyMOL files. |
- class mkt.databases.app.schema.DefaultConfig(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 = 'KinCore, CIF')[source]
Bases:
StructureConfigDefault configuration rendering the whole protein as cartoon with spectrum coloring.
- __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 = 'KinCore, CIF') None
- generate_list_idx() list[int][source]
Generate list of 0-indexed positions for all CIF residues.
- Returns:
List of 0-indexed positions for all CIF residues.
- Return type:
list[int]
- generate_style_color_lists(list_idx: list[int]) tuple[list[str], list[str]][source]
Generate style and color lists for default spectrum coloring.
- Parameters:
list_idx (list[int]) – List of 0-indexed residue positions.
- Returns:
All residues get ‘cartoon’ style and ‘spectrum’ color.
- Return type:
tuple[list[str], list[str]]
- str_attr: str = 'KinCore, CIF'
‘KinCore, CIF’).
- Type:
Attribute to highlight in the structure (default
- class mkt.databases.app.schema.KLIFSAdaptiveConfig(seq_align: ~mkt.databases.app.sequences.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 = 'KLIFS', list_stick_positions: list[int] = <factory>)[source]
Bases:
KLIFSConfigConfiguration for highlighting adaptive KLIFS residues in PyMOL.
- __init__(seq_align: ~mkt.databases.app.sequences.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 = 'KLIFS', list_stick_positions: list[int] = <factory>) None
- list_stick_positions: list[int]
List of 0-indexed positions in KLIFS sequence for stick representation (adaptive positions).
- class mkt.databases.app.schema.KLIFSConfig(seq_align: ~mkt.databases.app.sequences.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 = 'KLIFS', list_stick_positions: list[int] = <factory>)[source]
Bases:
StructureConfigConfiguration for highlighting KLIFS residues in PyMOL.
- __init__(seq_align: ~mkt.databases.app.sequences.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 = 'KLIFS', list_stick_positions: list[int] = <factory>) None
- _index_stick_region() list[int][source]
Extract the indices of the residues in the KLIFS pocket region by removing gaps.
- Returns:
List of indices for the residues in the KLIFS pocket region.
- Return type:
list[int]
- generate_list_idx() list[int][source]
Generate list of 0-indexed positions for KLIFS residues.
- Returns:
List of 0-indexed positions for the residues to be highlighted.
- 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 residues.
- Parameters:
list_idx (list[int]) – List of 0-indexed residue positions.
- Returns:
Styles based on stick positions, colors from KLIFS pocket colors.
- Return type:
tuple[list[str], list[str]]
- list_stick_positions: list[int]
List of 0-indexed positions in KLIFS sequence for stick representation.
- str_attr: str = 'KLIFS'
‘KLIFS’).
- Type:
Attribute to highlight in the structure (default
- 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
- 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_custom_color: list[str]
List of colors corresponding to list_uniprot_idx (must be the same length).
- list_uniprot_idx: list[int]
List of 1-indexed full-length UniProt positions to highlight as sticks.
- class mkt.databases.app.schema.KLIFSImportantConfig(seq_align: ~mkt.databases.app.sequences.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 = 'KLIFS', list_stick_positions: list[int] = <factory>)[source]
Bases:
KLIFSConfigConfiguration for highlighting important KLIFS residues in PyMOL.
- __init__(seq_align: ~mkt.databases.app.sequences.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 = 'KLIFS', list_stick_positions: list[int] = <factory>) None
- list_stick_positions: list[int]
List of 0-indexed positions in KLIFS sequence for stick representation (important positions).
- class mkt.databases.app.schema.KLIFSPathogenicConfig(seq_align: ~mkt.databases.app.sequences.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 = 'KLIFS', list_stick_positions: list[int] = <factory>)[source]
Bases:
KLIFSConfigConfiguration for highlighting KLIFS pathogenic residues in PyMOL.
- __init__(seq_align: ~mkt.databases.app.sequences.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 = 'KLIFS', list_stick_positions: list[int] = <factory>) None
- list_stick_positions: list[int]
List of 0-indexed positions in KLIFS sequence for stick representation (pathogenic positions).
- 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:
KLIFSConfigConfiguration 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
- _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_stick_positions: list[int]
No stick positions — all ribbon representation.
- class mkt.databases.app.schema.MutationsConfig(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, bool_klifs_only: bool, bool_show_sticks: bool = True, str_filepath_json: str)[source]
Bases:
StructureConfigConfiguration for generating PyMOL files with mutation data.
- __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, bool_klifs_only: bool, bool_show_sticks: bool = True, str_filepath_json: str) None
- _filter_mutations_to_klifs() dict[int, float][source]
Filter dict_mutations to only include residues in the 85 KLIFS pocket positions.
- Returns:
Filtered dictionary with only KLIFS pocket mutations.
- Return type:
dict[int, float]
- _get_klifs_label(idx_0based: int) str | None[source]
Get KLIFS pocket label for a position (e.g., ‘GK:45’).
- Parameters:
idx_0based (int) – 0-indexed position in the alignment.
- Returns:
KLIFS pocket label or None if not in KLIFS pocket.
- Return type:
str | None
- static _get_klifs_uniprot_mapping(klifs_mapping: dict | None, bool_uniprot_to_klifs: bool = True) dict[int, int][source]
Create mapping between UniProt positions and KLIFS indices.
- Parameters:
klifs_mapping (dict | None) – KLIFS2UniProtIdx mapping from kinase object (ordered dict).
bool_uniprot_to_klifs (bool, optional) – If True, return UniProt position (1-indexed) -> KLIFS index (0-84). If False, return KLIFS index (0-84) -> UniProt position (1-indexed). Default is True.
- Returns:
Mapping between UniProt positions and KLIFS indices.
- Return type:
dict[int, int]
- static _get_klifs_uniprot_positions(klifs_mapping: dict | None) set[int][source]
Get the set of UniProt positions (1-indexed) in the KLIFS pocket.
- Parameters:
klifs_mapping (dict | None) – KLIFS2UniProtIdx mapping from kinase object.
- Returns:
Set of 1-indexed UniProt positions in the KLIFS pocket.
- Return type:
set[int]
- _get_uniprot_label(idx_0based: int) str[source]
Get amino acid + UniProt position label (e.g., ‘T790’).
- Parameters:
idx_0based (int) – 0-indexed position in the alignment.
- Returns:
Label in format ‘X###’ where X is single-letter amino acid code.
- Return type:
str
- _index_mutation_region() list[int][source]
Extract the indices of the top mutation residues for stick highlighting.
- Returns:
List of 0-indexed positions for the top mutation residues.
- Return type:
list[int]
- _map_group_klifs_to_uniprot(dict_group_data: dict[int, float]) dict[int, float][source]
Map group-averaged KLIFS-indexed data to target kinase’s UniProt positions.
- Parameters:
dict_group_data (dict[int, float]) – Group-averaged normalized counts keyed by KLIFS index (0-84).
- Returns:
Normalized counts mapped to target kinase’s UniProt positions (1-indexed).
- Return type:
dict[int, float]
- _preprocess_mutation_dict() dict[int, float][source]
Preprocess mutation dictionary from JSON file.
Handles two JSON formats: - New format:
{"kinases": {...}, "kinase_groups": {...}}- Legacy format:{gene_name: {pos: count, ...}, ...}For group-averaged mode, reads pre-computed group data (keyed by KLIFS index) and maps it to the target kinase’s UniProt positions.
- Returns:
Mutation dictionary with UniProt position keys (1-indexed) and normalized counts.
- Return type:
dict[int, float]
- bool_klifs_only: bool
Whether to only highlight KLIFS pocket residues.
- bool_mutations_by_group: bool
Whether to average mutation counts by kinase group.
- bool_show_sticks: bool = True
True).
- Type:
Whether to show top mutations as sticks (default
- dict_mutations: dict[int, float]
Dictionary of mutation positions (1-indexed) with corresponding normalized counts.
- abstract generate_labels(list_idx: list[int]) list[str | None][source]
Generate labels for top mutation residues.
Must be implemented by subclasses to provide config-specific label formats.
- Parameters:
list_idx (list[int]) – List of 0-indexed residue positions.
- Returns:
List of labels (None for residues that should not be labeled).
- Return type:
list[str | None]
- generate_list_idx() list[int][source]
Generate list of 0-indexed positions for mutation residues.
- Returns:
List of 0-indexed positions for the residues to be highlighted.
- Return type:
list[int]
- generate_style_color_lists(list_idx: list[int]) tuple[list[str], list[str]][source]
Generate style and color lists for mutation residues.
Uses piecewise red gradient coloring: - Zero counts get lightgray - Non-zero counts are scaled piecewise and interpolated from light red to red
- Parameters:
list_idx (list[int]) – List of 0-indexed residue positions.
- Returns:
Tuple of (list_style, list_color).
- Return type:
tuple[list[str], list[str]]
- str_attr: str = 'Mutations'
‘Mutations’).
- Type:
Attribute to highlight in the structure (default
- str_filepath_json: str
File path to the JSON file containing the mutation dictionary.
- class mkt.databases.app.schema.MutationsDefaultConfig(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 = False, bool_klifs_only: bool = False, bool_show_sticks: bool = True, str_filepath_json: str)[source]
Bases:
MutationsConfigDefault 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 = False, bool_klifs_only: bool = False, bool_show_sticks: bool = True, str_filepath_json: str) None
- bool_klifs_only: bool = False
False).
- Type:
Whether to only highlight KLIFS pocket residues (default
- bool_mutations_by_group: bool = False
False).
- Type:
Whether to average mutation counts by kinase group (default
- generate_labels(list_idx: list[int]) list[str | None][source]
Generate labels for top mutations: amino acid + UniProt position (e.g., ‘T790’).
- Parameters:
list_idx (list[int]) – List of 0-indexed residue positions.
- Returns:
Labels for top mutation positions, None for others.
- Return type:
list[str | None]
- 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
- 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
- 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]
- class mkt.databases.app.schema.MutationsKLIFSConfig(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 = False, bool_klifs_only: bool = True, bool_show_sticks: bool = True, str_filepath_json: str)[source]
Bases:
MutationsConfigKLIFS-focused 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 = False, bool_klifs_only: bool = True, bool_show_sticks: bool = True, 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 = False
False).
- Type:
Whether to average mutation counts by kinase group (default
- generate_labels(list_idx: list[int]) list[str | None][source]
Generate labels for top mutations: KLIFS label + amino acid + UniProt position.
Example: ‘GK:45 T790’
- Parameters:
list_idx (list[int]) – List of 0-indexed residue positions.
- Returns:
Combined KLIFS + UniProt labels for top mutation positions, None for others.
- Return type:
list[str | None]
- class mkt.databases.app.schema.PhosphositesConfig(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 = 'Phosphosites')[source]
Bases:
StructureConfigConfiguration for highlighting phosphosites 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 = 'Phosphosites') None
- generate_list_idx() list[int][source]
Generate list of 0-indexed positions for phosphosite residues.
- Returns:
List of 0-indexed positions for the residues to be highlighted.
- Return type:
list[int]
- generate_style_color_lists(list_idx: list[int]) tuple[list[str], list[str]][source]
Generate style and color lists for phosphosites.
- Parameters:
list_idx (list[int]) – List of 0-indexed residue positions.
- Returns:
All residues get ‘stick’ style and ‘red’ color.
- Return type:
tuple[list[str], list[str]]
- str_attr: str = 'Phosphosites'
‘Phosphosites’).
- Type:
Attribute to highlight in the structure (default
- class mkt.databases.app.schema.StandardConfig(value)[source]
Bases:
EnumEnumeration of standard configurations for PyMOL visualization.
- DEFAULT = <class 'mkt.databases.app.schema.DefaultConfig'>
- KLIFS_ADAPTIVE = <class 'mkt.databases.app.schema.KLIFSAdaptiveConfig'>
- KLIFS_CUSTOM = <class 'mkt.databases.app.schema.KLIFSCustomConfig'>
- KLIFS_IMPORTANT = <class 'mkt.databases.app.schema.KLIFSImportantConfig'>
- KLIFS_PATHOGENIC = <class 'mkt.databases.app.schema.KLIFSPathogenicConfig'>
- KLIFS_REGION_LABEL = <class 'mkt.databases.app.schema.KLIFSRegionLabelConfig'>
- MUTATIONS_DEFAULT = <class 'mkt.databases.app.schema.MutationsDefaultConfig'>
- MUTATIONS_GROUP = <class 'mkt.databases.app.schema.MutationsGroupConfig'>
- MUTATIONS_KLIFS = <class 'mkt.databases.app.schema.MutationsKLIFSConfig'>
- PHOSPHOSITES = <class 'mkt.databases.app.schema.PhosphositesConfig'>
- class mkt.databases.app.schema.StandardConfigChoice(value)[source]
Bases:
str,EnumString-based enum for CLI choices (dataclass not hashable).
- DEFAULT = 'DEFAULT'
- KLIFS_ADAPTIVE = 'KLIFS_ADAPTIVE'
- KLIFS_CUSTOM = 'KLIFS_CUSTOM'
- KLIFS_IMPORTANT = 'KLIFS_IMPORTANT'
- KLIFS_PATHOGENIC = 'KLIFS_PATHOGENIC'
- KLIFS_REGION_LABEL = 'KLIFS_REGION_LABEL'
- MUTATIONS_DEFAULT = 'MUTATIONS_DEFAULT'
- MUTATIONS_GROUP = 'MUTATIONS_GROUP'
- MUTATIONS_KLIFS = 'MUTATIONS_KLIFS'
- PHOSPHOSITES = 'PHOSPHOSITES'
- class mkt.databases.app.schema.StructureConfig(seq_align: SequenceAlignment, str_attr: str, 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)[source]
Bases:
ABCConfiguration for generating PyMOL files.
Uses dependency injection: receives a SequenceAlignment object which provides access to kinase info and aligned sequences.
- __init__(seq_align: SequenceAlignment, str_attr: str, 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) None
- _generate_list_idx_from_dict_align_with_attr() list[int] | None[source]
Generate list of 0-indexed attribute positions from dict_align.
- Returns:
List of 0-indexed positions where attribute sequence has residues, or None if attribute not found in dict_align.
- Return type:
list[int] | None
- generate_labels(list_idx: list[int]) list[str | None][source]
Generate labels for highlighted residues.
Override in subclasses to provide specific label formats.
- Parameters:
list_idx (list[int]) – List of 0-indexed residue positions.
- Returns:
List of labels (None for residues that should not be labeled).
- Return type:
list[str | None]
- abstract generate_list_idx() list[int][source]
Generate list of 0-indexed positions for the residues to be highlighted.
- Returns:
List of 0-indexed residue positions.
- Return type:
list[int]
- abstract generate_style_color_lists(list_idx: list[int]) tuple[list[str], list[str]][source]
Generate style and color lists for StructureVisualizer based on the configuration.
- Parameters:
list_idx (list[int]) – List of 0-indexed residue positions (before +1 conversion).
- Returns:
Tuple of (list_style, list_color).
- Return type:
tuple[list[str], list[str]]
- highlight_cartoon_transparency: float = 0.0
Cartoon transparency applied to colored/highlighted residues (0 = opaque, 1 = invisible).
- label_connector: bool = True
Whether to draw leader/connector lines from each residue to its label.
- label_min_dist: float = 6.0
Minimum distance (angstroms) between labels for collision avoidance.
- label_offset: float = 20.0
Angstroms offset from CA for label pseudoatom placement.
- label_size: int = 14
Font size for residue labels.
- label_spring_strength: float = 0.0
Spring force pulling labels back toward ideal position (0 = no spring).
- 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__.
- return_list_cif_idx() list[int][source]
Return list of 0-indexed positions corresponding to the CIF sequence.
- Returns:
List of 0-indexed positions where CIF sequence has residues (not gaps).
- Return type:
list[int]
- return_list_idx_intersect() list[int][source]
Return list of 0-indexed positions at intersection of CIF and attribute sequences.
- Returns:
Sorted list of 0-indexed positions present in both CIF and attribute sequences.
- Return type:
list[int]
- Raises:
ValueError – If attribute sequence cannot be generated from dict_align.
- return_list_intersect_color_style() tuple[list[int], list[str], list[str]][source]
Generate the indices, styles, and colors for highlighting.
- Returns:
Tuple of (list_idx, list_color, list_style) where list_idx is 1-indexed.
- Return type:
tuple[list[int], list[str], list[str]]
- seq_align: SequenceAlignment
SequenceAlignment object providing kinase info and dict_align.
- str_attr: str
Attribute to highlight in the structure.