Skip to content

Commit

Permalink
updated KLIFS pocket notebook for latest kinase schema including KLIF…
Browse files Browse the repository at this point in the history
…S2UniProt dict
  • Loading branch information
jessicaw9910 committed Oct 16, 2024
1 parent d5b6985 commit adc17a1
Showing 1 changed file with 23 additions and 48 deletions.
71 changes: 23 additions & 48 deletions notebooks/klifs_pocket.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@
" (j.KLIFS is not None and j.KLIFS.pocket_seq is not None)}"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "cf9e691e-a7aa-4005-aece-ae6183323d4a",
"metadata": {},
"outputs": [],
"source": [
"# check that all KLIFS2UniProt alignments working as expected - should be no output\n",
"for hgnc, pocket in dict_klifs.items():\n",
" list_temp = [pocket.UniProt.canonical_seq[val-1] == pocket.KLIFS.pocket_seq[idx] \\\n",
" for idx, (key, val) in enumerate(pocket.KLIFS2UniProt.items()) if val is not None]\n",
" not any(list_temp)"
]
},
{
"cell_type": "markdown",
"id": "27513e9e",
Expand All @@ -60,7 +74,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "3369c424-3727-449a-97c7-1a07114a1541",
"metadata": {},
"outputs": [],
Expand All @@ -72,7 +86,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"id": "2cb0372b-dcbd-4f97-bdff-2045a46e87a8",
"metadata": {},
"outputs": [],
Expand All @@ -83,7 +97,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"id": "88f3481e-6b5a-410f-9061-330820f50f9a",
"metadata": {},
"outputs": [],
Expand All @@ -96,7 +110,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"id": "c61efdee-43bf-47d0-993f-cf5a1bcee962",
"metadata": {},
"outputs": [],
Expand All @@ -107,7 +121,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"id": "7a0a522f-3adb-4d37-9f82-2c5f3b4d8ec0",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -236,10 +250,10 @@
" dict_annot = colors.DICT_COLORS[str_col][\"DICT_ANNOTATION\"]\n",
" if dict_annot is None:\n",
" ax.legend(loc=\"upper center\", \n",
" bbox_to_anchor=(0.5, -0.15),\n",
" fancybox=True, \n",
" shadow=True, \n",
" ncol=11)\n",
" bbox_to_anchor=(0.5, -0.15),\n",
" fancybox=True, \n",
" shadow=True, \n",
" ncol=11)\n",
" else:\n",
" l1 = ax.legend(loc=\"upper center\", \n",
" bbox_to_anchor=(0.5, -0.15),\n",
Expand All @@ -258,45 +272,6 @@
" plt.title(f\"{cols} Color Scheme\")\n",
" plt.savefig(f\"KLIFS_pocket_{cols}.pdf\", bbox_inches=\"tight\");"
]
},
{
"cell_type": "markdown",
"id": "72a3bec4-20f7-46f2-bcb5-64bded860f72",
"metadata": {},
"source": [
"## Generate KLIFS alignment"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "cd456ee4-5976-412c-bb75-c3bf9f7bc397",
"metadata": {},
"outputs": [],
"source": [
"list_KLIFSPocket = []\n",
"\n",
"for _, j in dict_klifs.items():\n",
" uniprot_id = j.uniprot_id\n",
" hgnc = j.hgnc_name\n",
" str_uniprot = j.UniProt.canonical_seq\n",
" str_klifs_pocket = j.KLIFS.pocket_seq\n",
" kd_idx = (None, None) \n",
" # if j.KinCore is not None:\n",
" # kd_idx = (j.KinCore.start-1, j.KinCore.end-1)\n",
" # else:\n",
" # kd_idx = (None, None) \n",
"\n",
" dict_temp1 = {\n",
" \"uniprotID\": uniprot_id,\n",
" \"hgncName\": hgnc,\n",
" \"uniprotSeq\": str_uniprot,\n",
" \"klifsSeq\": str_klifs_pocket,\n",
" \"idx_kd\": kd_idx,\n",
" }\n",
"\n",
" list_KLIFSPocket.append(klifs.KLIFSPocket(**dict_temp1))"
]
}
],
"metadata": {
Expand Down

0 comments on commit adc17a1

Please sign in to comment.