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

SwissProtPattern

Regex pattern for SwissProt ID.

TrEMBLPattern

Regex pattern for TrEBML ID.

SwissProtPatternSuffix

Regex pattern for SwissProt ID with optional '_1' or '_2' for multi-KD.

TrEMBLPatternSuffix

Regex pattern for TrEBML ID with optional '_1' or '_2' for multi-KD.

Classes

Family(value)

Enum class for kinase families (>=5 in KinHub).

Group(value)

Enum class for kinase groups.

KLIFS(*, gene_name, name, full_name, group, ...)

Pydantic model for KLIFS information.

KinCore(*, fasta[, cif, start, end, mismatch])

Pydantic model for KinCore information.

KinCoreCIF(*, cif, group, hgnc, ...[, ...])

Pydantic model for KinCore CIF information.

KinCoreFASTA(*, seq, ...)

Pydantic model for KinCore FASTA information.

KinHub(*[, hgnc_name, kinase_name])

Pydantic model for KinHub information.

KinaseDomainName(value)

An enumeration.

KinaseInfo(*, hgnc_name, uniprot_id, ...)

Pydantic model for kinase information at the level of the kinase domain.

KinaseInfoKinaseDomain(*, uniprot_id, ...)

Pydantic model for kinase information at the level of the kinase domain.

KinaseInfoUniProt(*, hgnc_name, uniprot_id, ...)

Pydantic model for kinase information at the level of the UniProt ID.

MSASource(value)

Enum class for MSA source.

Pfam(*, domain_name, start, end, ...)

Pydantic model for Pfam information.

TemplateSource(value)

Enum class for template source.

UniProt(*, header, canonical_seq, ...)

Pydantic model for UniProt information.

class mkt.schema.kinase_schema.Family(value)[source]

Bases: Enum

Enum 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: StrEnum

Enum 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: BaseModel

Pydantic model for KLIFS information.

family: Family
full_name: str
gene_name: str
group: Group
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: BaseModel

Pydantic 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: BaseModel

Pydantic model for KinCore CIF information.

cif: dict[str, str | list[str]]
end: int | None
group: Group
hgnc: str
min_aloop_pLDDT: float
mismatch: list[int] | None
model_no: int
msa_size: int
msa_source: MSASource
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: BaseModel

Pydantic model for KinCore FASTA information.

end: int | None
end_af2: int | None
end_md: int
group: Group
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: BaseModel

Pydantic model for KinHub information.

family: Family
group: Group
hgnc_name: str | None
kinase_name: str | None
manning_name: str
xname: str
class mkt.schema.kinase_schema.KinaseDomainName(value)

Bases: StrEnum

An 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: BaseModel

Pydantic 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 bound is 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 in DICT_MOLECULAR_BRAKE. An unmapped position (None) is treated as not matching.

Returns:

One boolean per molecular brake position – in DICT_MOLECULAR_BRAKE order – 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_INTACT and LIST_PSEUDOKINASE_HEURISTIC_FALSE_POSITIVE in mkt.schema.constants for membership and citations). Returns False when no KLIFS pocket is available.

Returns:

Whether or not is a predicted pseudokinase

Return type:

bool

kincore: KinCore | None
kinhub: KinHub | None
klifs: KLIFS | None
pfam: Pfam | None
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_BRAKE in mkt.schema.constants for 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 from DICT_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 (KLIFS2UniProtIdx is None).

Return type:

dict[str, str | None] | None

uniprot: UniProt
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: BaseModel

Pydantic model for kinase information at the level of the kinase domain.

kincore: KinCore | None
kinhub: KinHub | None
klifs: KLIFS | 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])?$)]
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: BaseModel

Pydantic model for kinase information at the level of the UniProt ID.

hgnc_name: str
pfam: Pfam | None
uniprot: UniProt
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: StrEnum

Enum 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: BaseModel

Pydantic 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: StrEnum

Enum 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: BaseModel

Pydantic 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