|
220 | 220 | " zcoor = [molConf.GetAtomPosition(c).z for c in range(len(molAtom))]\n", |
221 | 221 | " return [xcoor, ycoor, zcoor]\n", |
222 | 222 | "\n", |
223 | | - "def labogrid(coorList, scale=2):\n", |
| 223 | + "def labox(coorList, scale=2):\n", |
224 | 224 | " X, Y, Z = coorList[0], coorList[1], coorList[2]\n", |
225 | 225 | " range = [[min(X), max(X)],\n", |
226 | 226 | " [min(Y), max(Y)],\n", |
|
303 | 303 | " columns=INTER[BSI_key][BD_key][0])\n", |
304 | 304 | " if not DF.empty:\n", |
305 | 305 | " INTER_TYPE.extend([BD_key.upper()]*len(DF))\n", |
306 | | - " INTER_DF = INTER_DF.append(DF)\n", |
| 306 | + " INTER_DF = pd.concat([INTER_DF, DF], ignore_index=True)\n", |
307 | 307 | " INTER_DF = INTER_DF.assign(BOND=INTER_TYPE)\n", |
308 | 308 | " INTER_DF.reset_index(drop=True, inplace=True)\n", |
309 | 309 | " INTER_DF.to_csv(CSV_Ifile, index=False)\n", |
|
381 | 381 | " showChain=False, showResLabel=False, showVDW=False,\n", |
382 | 382 | " outline=False):\n", |
383 | 383 | " # Variables\n", |
384 | | - " mview = py3Dmol.view(1000,1500)\n", |
| 384 | + " mview = py3Dmol.view(width=960, height=640)\n", |
385 | 385 | " if model in \"none\":\n", |
386 | 386 | " model = cType = color = \"\"\n", |
387 | 387 | " if model in \"cartoon\":\n", |
|
390 | 390 | " cType, color = \"colorscheme\", color + \"Carbon\"\n", |
391 | 391 | "\n", |
392 | 392 | " # Protein Model\n", |
393 | | - " count = 1\n", |
| 393 | + " count = 0\n", |
394 | 394 | " prot_model = count\n", |
395 | 395 | " print(f\"+ Showing {os.path.basename(inputP)}\")\n", |
396 | 396 | " mol = open(inputP, \"r\").read()\n", |
|
450 | 450 | "\n", |
451 | 451 | "def VIEW_ELIG(inputE, showAtomLabel=False, outline=False):\n", |
452 | 452 | " # Variable\n", |
453 | | - " mview = py3Dmol.view(1000, 1500)\n", |
| 453 | + " mview = py3Dmol.view(width=960, height=640)\n", |
454 | 454 | "\n", |
455 | 455 | " # Experimental ligand model\n", |
456 | | - " count = 1\n", |
| 456 | + " count = 0\n", |
457 | 457 | " elig_model = count\n", |
458 | 458 | " print(f\"+ Showing {os.path.basename(inputE)}\")\n", |
459 | 459 | " mol = open(inputE, \"r\").read()\n", |
|
483 | 483 | "\n", |
484 | 484 | "def VIEW_LIG(inputL, showHs=False, showAtomLabel=False, outline=False):\n", |
485 | 485 | " # Variable\n", |
486 | | - " mview = py3Dmol.view(1000, 1500)\n", |
| 486 | + " mview = py3Dmol.view(width=960, height=640)\n", |
487 | 487 | "\n", |
488 | 488 | " # Ligand model\n", |
489 | | - " count = 1\n", |
| 489 | + " count = 0\n", |
490 | 490 | " lig_model = count\n", |
491 | 491 | " print(f\"+ Showing {os.path.basename(inputL)}\")\n", |
492 | 492 | " smi = open(inputL, \"r\").read()\n", |
|
524 | 524 | "\n", |
525 | 525 | "def VIEW_GRID(inputP, inputE, focusRes, center, size=[10, 10, 10]):\n", |
526 | 526 | " # Variable\n", |
527 | | - " mview = py3Dmol.view(1000, 1500)\n", |
| 527 | + " mview = py3Dmol.view(width=960, height=640)\n", |
528 | 528 | "\n", |
529 | 529 | " # Grid box\n", |
530 | 530 | " bxi, byi, bzi = center[0], center[1], center[2]\n", |
|
537 | 537 | " \"color\": \"skyBlue\", \"opacity\": 0.7})\n", |
538 | 538 | "\n", |
539 | 539 | " # Protein model\n", |
540 | | - " count = 1\n", |
| 540 | + " count = 0\n", |
541 | 541 | " prot_model = count\n", |
542 | 542 | " print(f\"+ Showing {os.path.basename(inputP)}\")\n", |
543 | 543 | " molA = open(inputP, \"r\").read()\n", |
|
584 | 584 | " showLig=False, showAllPose=False, showBestPose=False,\n", |
585 | 585 | " outline=False):\n", |
586 | 586 | " # Variables\n", |
587 | | - " mview = py3Dmol.view(1000, 1500)\n", |
| 587 | + " mview = py3Dmol.view(width=960, height=640)\n", |
588 | 588 | " if model in \"none\":\n", |
589 | 589 | " model = cType = color = \"\"\n", |
590 | 590 | " if model in \"cartoon\":\n", |
|
593 | 593 | " cType, color = \"colorscheme\", color + \"Carbon\"\n", |
594 | 594 | "\n", |
595 | 595 | " # Protein model\n", |
596 | | - " count = 1\n", |
| 596 | + " count = 0\n", |
597 | 597 | " prot_model = count\n", |
598 | 598 | " print(f\"+ Showing {os.path.basename(inputP)}\")\n", |
599 | 599 | " molA = open(inputP, \"r\").read()\n", |
|
1129 | 1129 | "#@markdown Place the **< Gridbox >** at the center of binding site. \\\n", |
1130 | 1130 | "\n", |
1131 | 1131 | "Focus_residues = \"\" #@param {type:\"string\"}\n", |
1132 | | - "Method = \"LABOGRID\" #@param [\"LABOGRID\", \"eBoxSize\", \"eBoxSize-modified\", \"Autodock-Grid\", \"manual\"]\n", |
| 1132 | + "Method = \"LaBOX\" #@param [\"LaBOX\", \"eBoxSize\", \"eBoxSize-modified\", \"Autodock-Grid\", \"manual\"]\n", |
1133 | 1133 | "\n", |
1134 | 1134 | "#@markdown ---\n", |
1135 | 1135 | "\n", |
1136 | | - "if Method == \"LABOGRID\":\n", |
| 1136 | + "if Method == \"LaBOX\":\n", |
1137 | 1137 | " atomCoord = get_atom_coordinate(EXP_pdb_Dfile)\n", |
1138 | | - " grid = labogrid(atomCoord)\n", |
| 1138 | + " grid = labox(atomCoord)\n", |
1139 | 1139 | " Center, Size = grid[0], grid[1]\n", |
1140 | 1140 | "\n", |
1141 | 1141 | "if Method == \"eBoxSize\":\n", |
|
1444 | 1444 | "vina_rank = pd.DataFrame()\n", |
1445 | 1445 | "for N,ID in enumerate(lig_IDs):\n", |
1446 | 1446 | " out_sdf_Dfile = os.path.join(DCK_FLD, f\"{ID}/{ID}_output.sdf\")\n", |
1447 | | - " vina_rank = vina_rank.append(get_score(out_sdf_Dfile, EXP_pose, result=\"first\"))\n", |
1448 | | - "# vina_rank[\"SCORE\"].dtypes\n", |
| 1447 | + " vina_rank = pd.concat([vina_rank, get_score(out_sdf_Dfile, EXP_pose, result=\"first\")])\n", |
| 1448 | + "\n", |
1449 | 1449 | "vina_rank = vina_rank.sort_values(\"SCORE\", ascending=True, ignore_index=True)\n", |
1450 | 1450 | "rank_csv_Dfile = os.path.join(DCK_FLD, \"ranked_result.csv\")\n", |
1451 | 1451 | "vina_rank.to_csv(rank_csv_Dfile)\n", |
|
1465 | 1465 | "source": [ |
1466 | 1466 | "#@title **Show docking result of ligand** {run : \"auto\"}\n", |
1467 | 1467 | "\n", |
1468 | | - "Select_ligand = \"SB_4\" #@param {type:\"string\"}\n", |
| 1468 | + "Select_ligand = \"SB_5\" #@param {type:\"string\"}\n", |
1469 | 1469 | "LIG_out_csv_Dfile = os.path.join(DCK_FLD, f\"{Select_ligand}/{Select_ligand}_result.csv\")\n", |
1470 | 1470 | "ligResultDF = pd.read_csv(LIG_out_csv_Dfile)\n", |
1471 | 1471 | "ligResultDF" |
|
1626 | 1626 | ], |
1627 | 1627 | "provenance": [], |
1628 | 1628 | "mount_file_id": "1r1k3mK4lzvKM8ZF4SeASkFazgOlfXKkU", |
1629 | | - "authorship_tag": "ABX9TyPXRwapuJ0PS4hXigxFGnuU", |
| 1629 | + "authorship_tag": "ABX9TyM43DtsS8VeX6k+tXNJsZqY", |
1630 | 1630 | "include_colab_link": true |
1631 | 1631 | }, |
1632 | 1632 | "kernelspec": { |
|
0 commit comments