mkt.databases.kincore

Parsing and harmonization of KinCore FASTA and CIF structure files, aligned to UniProt.

Reads KinCore FASTA and CIF files, extracts kinase-domain metadata, aligns KinCore sequences to UniProt, and harmonizes the FASTA- and CIF-derived records.

Module Attributes

LIST_FASTA_KEYS1

List of FASTA keys for KinCore FASTA file.

LIST_FASTA_KEYS2

List of FASTA keys for KinCore FASTA file.

DICT_KINCORE_PARAMS

Dictionary of KinCore parameters for FASTA files.

DICT_GROUP_KINCORE

Dictionary of KinCore groups to map to mkt.schema.kinase_schema.Group.

LIST_CIF_KEYS

List of CIF keys for KinCore CIF file.

Functions

align_kincore2uniprot(str_kincore, str_uniprot)

Align KinCore Human-PK.fasta to canonical Uniprot sequences.

extract_pk_cif_files_as_list()

Extract all cif files from KinCore directory.

extract_pk_fasta_info_as_list(study)

Parse KinCore Human-PK.fasta file to extract information for KinaseInfo object.

harmonize_kincore_fasta_cif()

Harmonize KinCore FASTA/CIF files for af2/md and generate KinCore objects.

parse_fasta_description(str_description[, ...])

Parse fasta description to extract metadata.

return_fasta_contents([path_filename])

update_original_cif_with_new_coords(...)

Update original CIF file with new coordinates post-alignment.

mkt.databases.kincore.DICT_GROUP_KINCORE = {'AGC': 'AGC', 'CAMK': 'CAMK', 'CK1': 'CK1', 'CMGC': 'CMGC', 'NEK': 'NEK', 'OTHER': 'Other', 'RGC': 'RGC', 'STE': 'STE', 'TKL': 'TKL', 'TYR': 'TK'}

Dictionary of KinCore groups to map to mkt.schema.kinase_schema.Group.

Type:

dict[str, str]

mkt.databases.kincore.DICT_KINCORE_PARAMS = {'af2': {'LIST_FASTA_KEYS': ['seq', 'group', 'hgnc1', 'swissprot', 'hgnc2', 'uniprot', 'start_md', 'end_md', 'length_md', 'start_af2', 'end_af2', 'length_af2', 'length_uniprot', 'source_file'], 'bool_af2': True, 'filename': 'AF2-active.fasta', 'study': 'Faezov-Dunbrack_2023'}, 'md': {'LIST_FASTA_KEYS': ['seq', 'group', 'hgnc1', 'start_md', 'end_md', 'swissprot', 'hgnc2', 'uniprot', 'source_file'], 'bool_af2': False, 'filename': 'Human-PK.fasta', 'study': 'Modi-Dunbrack_2019'}}

Dictionary of KinCore parameters for FASTA files.

Type:

dict[str, dict[str, str | list[str]]]

mkt.databases.kincore.LIST_CIF_KEYS = ['cif', 'group', 'hgnc', 'min_aloop_pLDDT', 'template_source', 'msa_size', 'msa_source', 'model_no']

List of CIF keys for KinCore CIF file.

Type:

list[str]

mkt.databases.kincore.LIST_FASTA_KEYS1 = ['seq', 'group', 'hgnc1', 'swissprot', 'hgnc2', 'uniprot', 'start_md', 'end_md', 'length_md', 'start_af2', 'end_af2', 'length_af2', 'length_uniprot', 'source_file']

List of FASTA keys for KinCore FASTA file.

Type:

list[str]

mkt.databases.kincore.LIST_FASTA_KEYS2 = ['seq', 'group', 'hgnc1', 'start_md', 'end_md', 'swissprot', 'hgnc2', 'uniprot', 'source_file']

List of FASTA keys for KinCore FASTA file.

Type:

list[str]

mkt.databases.kincore.align_kincore2uniprot(str_kincore: str, str_uniprot: str) dict[str, dict[str, str | int | list[int] | None]][source]

Align KinCore Human-PK.fasta to canonical Uniprot sequences.

Parameters:
  • str_kicore (str) – KinCore sequence

  • str_uniprot (str) – Uniprot sequence

Returns:

Dictionary of {start : int | None, end : int, mismatch : list[int]}

Return type:

dict[str, dict[str, str | None]]

mkt.databases.kincore.extract_pk_cif_files_as_list() list[KinCoreCIF][source]

Extract all cif files from KinCore directory.

Returns:

List of KinCoreCIF objects

Return type:

list[KinCoreCIF]

mkt.databases.kincore.extract_pk_fasta_info_as_list(study: str) list[KinCoreFASTA][source]

Parse KinCore Human-PK.fasta file to extract information for KinaseInfo object.

Parameters:

study (str) – Study FASTA to use; options are “af2” (Faezov-Dunbrack, 2023) or “md” (Modi-Dunbrack, 2019)

Returns:

List of KinCoreFASTA objects

Return type:

list[KinCoreFASTA]

mkt.databases.kincore.harmonize_kincore_fasta_cif()[source]

Harmonize KinCore FASTA/CIF files for af2/md and generate KinCore objects.

Returns:

Dictionary of {uniprot : list[KinCore]}

Return type:

dict[str, list[KinCore]]

mkt.databases.kincore.parse_fasta_description(str_description: str, bool_af2: bool = True) dict[str, str | int][source]

Parse fasta description to extract metadata.

Parameters:

str_description (str) – Description from fasta file

Returns:

Dictionary of metadata

Return type:

dict[str, str]

mkt.databases.kincore.return_fasta_contents(path_filename=<class 'str'>) FastaIterator[source]
mkt.databases.kincore.update_original_cif_with_new_coords(str_orig: str, str_updated: str, str_filepath: str) None[source]

Update original CIF file with new coordinates post-alignment.

Parameters:
  • str_orig (str) – Path to original tar.gz CIF file

  • str_updated (str) – Path to updated tar.gz CIF file

  • str_filepath (str) – Path to save updated CIF tar.gz file

Returns:

None

Return type:

None