mkt.schema.kinase_schema
Core Pydantic models representing a kinase at the kinase-domain level.
Defines KinaseInfo and its component models (UniProt,
KinHub, KLIFS, Pfam, KinCore) along with the
Group/Family enumerations. KinaseInfo exposes adjudication
helpers for kinase-domain sequence and group assignment.
Module Attributes
Regex pattern for SwissProt ID. |
|
Regex pattern for TrEBML ID. |
|
Regex pattern for SwissProt ID with optional '_1' or '_2' for multi-KD. |
|
Regex pattern for TrEBML ID with optional '_1' or '_2' for multi-KD. |
Classes
|
Enum class for kinase families (>=5 in KinHub). |
|
Enum class for kinase groups. |
|
Pydantic model for KLIFS information. |
|
Pydantic model for KinCore information. |
|
Pydantic model for KinCore CIF information. |
|
Pydantic model for KinCore FASTA information. |
|
Pydantic model for KinHub information. |
|
An enumeration. |
|
Pydantic model for kinase information at the level of the kinase domain. |
|
Pydantic model for kinase information at the level of the kinase domain. |
|
Pydantic model for kinase information at the level of the UniProt ID. |
|
Enum class for MSA source. |
|
Pydantic model for Pfam information. |
|
Enum class for template source. |
|
Pydantic model for UniProt information. |
- class mkt.schema.kinase_schema.Family(value)[source]
Bases:
EnumEnum class for kinase families (>=5 in KinHub).
- ABC1 = 'ABC1'
- Alpha = 'Alpha'
- CAMK1 = 'CAMK1'
- CAMKL = 'CAMKL'
- CDK = 'CDK'
- CDKL = 'CDKL'
- CK1 = 'CK1'
- DAPK = 'DAPK'
- DMPK = 'DMPK'
- DYRK = 'DYRK'
- Eph = 'Eph'
- GRK = 'GRK'
- JakA = ('Jak', 'JakA')
- JakB = ('Jakb', 'JakB')
- MAPK = 'MAPK'
- MAPKAPK = 'MAPKAPK'
- MAST = 'MAST'
- MLCK = 'MLCK'
- MLK = 'MLK'
- NEK = 'NEK'
- Null = None
- Other = 'Other'
- PDGFR = 'PDGFR'
- PDHK = 'PDHK'
- PIK = 'PIK'
- PIKK = 'PIKK'
- PIPK = 'PIPK'
- PKA = 'PKA'
- PKC = 'PKC'
- PLK = 'PLK'
- RAF = 'RAF'
- RGC = 'RGC'
- RIPK = 'RIPK'
- RSK = 'RSK'
- RSKb = 'RSKb'
- STE11 = 'STE11'
- STE20 = 'STE20'
- STE7 = 'STE7'
- STKR = 'STKR'
- Src = 'Src'
- TSSK = 'TSSK'
- Tec = 'Tec'
- ULK = 'ULK'
- class mkt.schema.kinase_schema.Group(value)[source]
Bases:
StrEnumEnum class for kinase groups.
- AGC = 'AGC'
- Atypical = 'Atypical'
- CAMK = 'CAMK'
- CK1 = 'CK1'
- CMGC = 'CMGC'
- NEK = 'NEK'
- Other = 'Other'
- RGC = 'RGC'
- STE = 'STE'
- TK = 'TK'
- TKL = 'TKL'
- class mkt.schema.kinase_schema.KLIFS(*, gene_name: str, name: str, full_name: str, group: ~mkt.schema.kinase_schema.Group, family: ~mkt.schema.kinase_schema.Family, iuphar: int, kinase_id: int, pocket_seq: ~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[ACDEFGHIKLMNPQRSTVWY\-]{85}$)] | None = None)[source]
Bases:
BaseModelPydantic model for KLIFS information.
- full_name: str
- gene_name: str
- iuphar: int
- kinase_id: int
- name: str
- pocket_seq: StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[ACDEFGHIKLMNPQRSTVWY\-]{85}$)] | None
- class mkt.schema.kinase_schema.KinCore(*, fasta: KinCoreFASTA, cif: KinCoreCIF | None = None, start: int | None = None, end: int | None = None, mismatch: list[int] | None = None)[source]
Bases:
BaseModelPydantic model for KinCore information.
- cif: KinCoreCIF | None
- end: int | None
- fasta: KinCoreFASTA
- mismatch: list[int] | None
- start: int | None
- class mkt.schema.kinase_schema.KinCoreCIF(*, cif: dict[str, str | list[str]], group: Group, hgnc: str, min_aloop_pLDDT: float, template_source: TemplateSource, msa_size: int, msa_source: MSASource, model_no: Annotated[int, Ge(ge=1), Lt(lt=6)], start: int | None = None, end: int | None = None, mismatch: list[int] | None = None)[source]
Bases:
BaseModelPydantic model for KinCore CIF information.
- cif: dict[str, str | list[str]]
- end: int | None
- hgnc: str
- min_aloop_pLDDT: float
- mismatch: list[int] | None
- model_no: int
- msa_size: int
- start: int | None
- template_source: TemplateSource
- class mkt.schema.kinase_schema.KinCoreFASTA(*, seq: ~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[ACDEFGHIKLMNPQRSTVWXY]+$)], group: ~mkt.schema.kinase_schema.Group, hgnc: set[str], swissprot: str, uniprot: ~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z][0-9][A-Z0-9]{3}[0-9](_[12])?$)] | ~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z][0-9][A-Z][A-Z0-9]{2}[0-9][A-Z][A-Z0-9]{2}[0-9](_[12])?$)], start_md: int, end_md: int, length_md: int | None = None, start_af2: int | None = None, end_af2: int | None = None, length_af2: int | None = None, length_uniprot: int | None = None, source_file: str, start: int | None = None, end: int | None = None, mismatch: list[int] | None = None)[source]
Bases:
BaseModelPydantic model for KinCore FASTA information.
- end: int | None
- end_af2: int | None
- end_md: int
- hgnc: set[str]
- length_af2: int | None
- length_md: int | None
- length_uniprot: int | None
- mismatch: list[int] | None
- seq: StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[ACDEFGHIKLMNPQRSTVWXY]+$)]
- source_file: str
- start: int | None
- start_af2: int | None
- start_md: int
- swissprot: str
- uniprot: StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z][0-9][A-Z][A-Z0-9]{2}[0-9][A-Z][A-Z0-9]{2}[0-9](_[12])?$)]
- class mkt.schema.kinase_schema.KinHub(*, hgnc_name: str | None = None, kinase_name: str | None = None, manning_name: str, xname: str, group: Group, family: Family)[source]
Bases:
BaseModelPydantic model for KinHub information.
- hgnc_name: str | None
- kinase_name: str | None
- manning_name: str
- xname: str
- class mkt.schema.kinase_schema.KinaseDomainName(value)
Bases:
StrEnumAn enumeration.
- KD1 = 'Protein kinase domain'
- KD2 = 'Protein tyrosine and serine/threonine kinase'
- KD3 = 'Serine/threonine-protein kinase mTOR domain'
- class mkt.schema.kinase_schema.KinaseInfo(*, hgnc_name: str, uniprot_id: ~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z][0-9][A-Z0-9]{3}[0-9](_[12])?(_[12])?$)] | ~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z][0-9][A-Z][A-Z0-9]{2}[0-9][A-Z][A-Z0-9]{2}[0-9](_[12])?(_[12])?$)], uniprot: ~mkt.schema.kinase_schema.UniProt, kinhub: ~mkt.schema.kinase_schema.KinHub | None = None, klifs: ~mkt.schema.kinase_schema.KLIFS | None = None, pfam: ~mkt.schema.kinase_schema.Pfam | None = None, kincore: ~mkt.schema.kinase_schema.KinCore | None = None, KLIFS2UniProtIdx: dict[str, int | None] | None = None, KLIFS2UniProtSeq: dict[str, str | None] | None = None)[source]
Bases:
BaseModelPydantic model for kinase information at the level of the kinase domain.
- KLIFS2UniProtIdx: dict[str, int | None] | None
- KLIFS2UniProtSeq: dict[str, str | None] | None
- _klifs_uniprot_idx_bounds() tuple[int, int] | None[source]
Return the min and max non-None UniProt indices in KLIFS2UniProtIdx.
- Returns:
The (min, max) UniProt indices spanned by the KLIFS pocket if any are available, otherwise None.
- Return type:
tuple[int, int] | None
- _reconcile_kd_bound_with_klifs(bound: int, klifs_bound: int, is_start: bool, int_max_gap: int, bool_verbose: bool) int | None[source]
Reconcile an adjudicated kinase domain bound with the KLIFS pocket.
The KLIFS pocket should fall within the kinase domain, i.e. the minimum KLIFS index should be >= the kinase domain start and the maximum KLIFS index should be <= the kinase domain end. When this is violated, the gap is compared against
int_max_gap: small gaps expand the bound to the KLIFS index, larger gaps return None since the mapping is unreliable.- Parameters:
bound (int) – The adjudicated kinase domain bound (start or end).
klifs_bound (int) – The corresponding KLIFS pocket bound (min for start, max for end).
is_start (bool) – Whether
boundis the kinase domain start (True) or end (False).int_max_gap (int) – Maximum allowed gap between the kinase domain bound and the KLIFS bound before the bound is treated as unreliable and None is returned.
bool_verbose (bool) – Whether to log verbose messages.
- Returns:
The reconciled bound, expanded to the KLIFS index when the gap is within
int_max_gap, otherwise None.- Return type:
int | None
- adjudicate_group(bool_verbose: bool = False) str | None[source]
Adjudicate group based on available data.
- Parameters:
bool_verbose (bool, optional) – Whether to log verbose messages, by default False.
- Returns:
The group of the kinase if available, otherwise None.
- Return type:
str | None
- adjudicate_kd_end(int_max_gap: int = 15, bool_verbose: bool = False) int | None[source]
Adjudicate kinase domain end based on available data.
- Parameters:
int_max_gap (int, optional) – Maximum allowed gap between the kinase domain end and the maximum KLIFS pocket index before the end is treated as unreliable and None is returned, by default 15.
bool_verbose (bool, optional) – Whether to log verbose messages, by default False.
- Returns:
The end of the kinase domain if available, otherwise None.
- Return type:
int | None
- adjudicate_kd_sequence(bool_verbose: bool = False) str | None[source]
Adjudicate kinase domain sequence based on available data.
- Parameters:
bool_verbose (bool, optional) – Whether to log verbose messages, by default False.
- Returns:
The kinase domain sequence if available, otherwise None.
- Return type:
str | None
- adjudicate_kd_start(int_max_gap: int = 15, bool_verbose: bool = False) int | None[source]
Adjudicate kinase domain start based on available data.
- Parameters:
int_max_gap (int, optional) – Maximum allowed gap between the kinase domain start and the minimum KLIFS pocket index before the start is treated as unreliable and None is returned, by default 15.
bool_verbose (bool, optional) – Whether to log verbose messages, by default False.
- Returns:
The start of the kinase domain if available, otherwise None.
- Return type:
int | None
- check_molecular_brake_against_canonical() tuple[bool, bool, bool] | None[source]
Check this kinase’s molecular brake residues against the canonical identities.
Compares the residue at each molecular brake position (see
return_molecular_brake_residues) against the conserved canonical residue inDICT_MOLECULAR_BRAKE. An unmapped position (None) is treated as not matching.- Returns:
One boolean per molecular brake position – in
DICT_MOLECULAR_BRAKEorder – indicating whether this kinase’s residue matches the canonical identity. Returns None when no KLIFS pocket mapping is available.- Return type:
tuple[bool, bool, bool] | None
- extract_sequence_from_cif(bool_verbose: bool = False) str | None[source]
Extract sequence from CIF if available.
- Parameters:
bool_verbose (bool, optional) – Whether to log verbose messages, by default False.
- Returns:
The sequence from the CIF if available, otherwise None.
- Return type:
str | None
- hgnc_name: str
- is_lipid_kinase() bool[source]
Return boolean if a lipid kinase.
- Returns:
Whether or not is a lipid kinase
- Return type:
bool
- is_pseudogene() bool[source]
Return boolean if a pseudogene.
- Returns:
Whether or not is a pseudogene
- Return type:
bool
- is_pseudokinase() bool[source]
Return boolean if a (predicted) pseudokinase.
Predicts catalytic deficiency from the KLIFS pocket by testing the three canonical catalytic residues – the VAIK beta3 lysine (III:17), the HRD catalytic aspartate (c.l:70) and the DFG aspartate (xDFG:81); a kinase missing any one is called a pseudokinase. The catalytic lysine may instead sit in beta2 (II:13) in the WNK family, which is accepted as present. Two hand-curated overrides correct the known failure modes of the heuristic (see
LIST_PSEUDOKINASE_TRIAD_INTACTandLIST_PSEUDOKINASE_HEURISTIC_FALSE_POSITIVEinmkt.schema.constantsfor membership and citations). Returns False when no KLIFS pocket is available.- Returns:
Whether or not is a predicted pseudokinase
- Return type:
bool
- return_molecular_brake_residues() dict[str, str | None] | None[source]
Return this kinase’s residues at the molecular brake KLIFS positions.
The molecular brake is a network of conserved residues in the KLIFS pocket (see
DICT_MOLECULAR_BRAKEinmkt.schema.constantsfor the region:idx labels and their canonical identities). This reads the residue at each of those positions from the KLIFS-to-UniProt index mapping, i.e.canonical_seq[KLIFS2UniProtIdx[label] - 1 + offset], where the per-position offset comes fromDICT_MOLECULAR_BRAKE_OFFSET(the brake lysine sits one residue N-terminal to its VIII:79 KLIFS-aligned position).- Returns:
Dictionary mapping each molecular brake KLIFS region:idx label to the residue found at that position in this kinase, or None where the position is unmapped. Returns None entirely when no KLIFS pocket mapping is available (
KLIFS2UniProtIdxis None).- Return type:
dict[str, str | None] | None
- uniprot_id: StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z][0-9][A-Z][A-Z0-9]{2}[0-9][A-Z][A-Z0-9]{2}[0-9](_[12])?(_[12])?$)]
- classmethod validate_klifs2uniprotidx(value: dict[str, int | None] | None) dict[str, int | None] | None[source]
Validate KLIFS2UniProtIdx dictionary to include all regions since TOML doesn’t save None.
- Parameters:
value (dict[str, int | None]) – Dictionary mapping KLIFS residue to UniProt indices.
- Returns:
Dictionary mapping KLIFS residue to UniProt indices.
- Return type:
dict[str, int | None]
- classmethod validate_klifs2uniprotseq(value: dict[str, str | None] | None) dict[str, str | None] | None[source]
Validate KLIFS2UniProtSeq dictionary to include all regions since TOML doesn’t save None.
- Parameters:
value (dict[str, str | None]) – Dictionary mapping KLIFS residue to UniProt residue.
- Returns:
Dictionary mapping KLIFS residue to UniProt residue.
- Return type:
dict[str, str | None]
- class mkt.schema.kinase_schema.KinaseInfoKinaseDomain(*, uniprot_id: ~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z][0-9][A-Z0-9]{3}[0-9](_[12])?(_[12])?$)] | ~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z][0-9][A-Z][A-Z0-9]{2}[0-9][A-Z][A-Z0-9]{2}[0-9](_[12])?(_[12])?$)], kinhub: ~mkt.schema.kinase_schema.KinHub | None = None, klifs: ~mkt.schema.kinase_schema.KLIFS | None = None, kincore: ~mkt.schema.kinase_schema.KinCore | None = None)[source]
Bases:
BaseModelPydantic model for kinase information at the level of the kinase domain.
- uniprot_id: StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z][0-9][A-Z][A-Z0-9]{2}[0-9][A-Z][A-Z0-9]{2}[0-9](_[12])?(_[12])?$)]
- class mkt.schema.kinase_schema.KinaseInfoUniProt(*, hgnc_name: str, uniprot_id: ~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z][0-9][A-Z0-9]{3}[0-9](_[12])?$)] | ~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z][0-9][A-Z][A-Z0-9]{2}[0-9][A-Z][A-Z0-9]{2}[0-9](_[12])?$)], uniprot: ~mkt.schema.kinase_schema.UniProt, pfam: ~mkt.schema.kinase_schema.Pfam | None = None)[source]
Bases:
BaseModelPydantic model for kinase information at the level of the UniProt ID.
- hgnc_name: str
- uniprot_id: StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z][0-9][A-Z][A-Z0-9]{2}[0-9][A-Z][A-Z0-9]{2}[0-9](_[12])?$)]
- class mkt.schema.kinase_schema.MSASource(value)[source]
Bases:
StrEnumEnum class for MSA source.
- family = 'family'
- ortholog = 'ortholog'
- uniref90 = 'uniref90'
- class mkt.schema.kinase_schema.Pfam(*, domain_name: KinaseDomainName, start: int, end: int, protein_length: int, pfam_accession: str, in_alphafold: bool)[source]
Bases:
BaseModelPydantic model for Pfam information.
- domain_name: KinaseDomainName
- end: int
- in_alphafold: bool
- pfam_accession: str
- protein_length: int
- start: int
- mkt.schema.kinase_schema.SwissProtPattern = '^[A-Z][0-9][A-Z0-9]{3}[0-9](_[12])?$'
Regex pattern for SwissProt ID.
- mkt.schema.kinase_schema.SwissProtPatternSuffix = '^[A-Z][0-9][A-Z0-9]{3}[0-9](_[12])?(_[12])?$'
Regex pattern for SwissProt ID with optional ‘_1’ or ‘_2’ for multi-KD.
- class mkt.schema.kinase_schema.TemplateSource(value)[source]
Bases:
StrEnumEnum class for template source.
- PDB70 = 'PDB70'
- activeAF2 = 'activeAF2'
- activePDB = 'activePDB'
- none = 'notemp'
- mkt.schema.kinase_schema.TrEMBLPattern = '^[A-Z][0-9][A-Z][A-Z0-9]{2}[0-9][A-Z][A-Z0-9]{2}[0-9](_[12])?$'
Regex pattern for TrEBML ID.
- mkt.schema.kinase_schema.TrEMBLPatternSuffix = '^[A-Z][0-9][A-Z][A-Z0-9]{2}[0-9][A-Z][A-Z0-9]{2}[0-9](_[12])?(_[12])?$'
Regex pattern for TrEBML ID with optional ‘_1’ or ‘_2’ for multi-KD.
- class mkt.schema.kinase_schema.UniProt(*, header: str, canonical_seq: ~typing.Annotated[str, ~pydantic.types.StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[ACDEFGHIKLMNPQRSTVWXY]+$)], phospho_sites: list[int] | None = None, phospho_evidence: list[set[str]] | None = None, phospho_description: list[str] | None = None)[source]
Bases:
BaseModelPydantic model for UniProt information.
- canonical_seq: StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[ACDEFGHIKLMNPQRSTVWXY]+$)]
- header: str
- phospho_description: list[str] | None
- phospho_evidence: list[set[str]] | None
- phospho_sites: list[int] | None