{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "id": "E_zmG2qEhP_L" }, "outputs": [], "source": [ "from geodes import DescCalculator\n", "from geodes import calc_COM_protein\n", "from geodes import calc_prot_hel_dist" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "id": "4MvdtPG2qVVN" }, "outputs": [], "source": [ "input_dir = './input_data/'" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "id": "qQ9PGq5OEkiA" }, "outputs": [], "source": [ "# helices boundaries and charge clamp residues reference for hVDR\n", "href = [[127,142], [149,152], [218,222], [226,246], [257,265], [268, 278], [298,302], [308,322], [328,338], [350,369], [379,396], [397,406], [411,413], [417,423]]\n", "clamp_resid_h = [246, 264, 420]" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "M9KTkW6_QXQJ", "outputId": "bbc05d04-cbb4-484f-829d-2d2a34dfe157" }, "outputs": [ { "data": { "text/plain": [ "[np.float32(13.355535), np.float32(20.772703), np.float32(42.01453)]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# one descriptor calculation for a single file\n", "\n", "com_protein = calc_COM_protein(input_dir+'1DB1.pdb')\n", "com_protein" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[np.float32(17.383366),\n", " np.float32(19.165474),\n", " np.float32(28.790037),\n", " np.float32(9.335318),\n", " np.float32(17.702364),\n", " np.float32(4.166907),\n", " np.float32(20.691032),\n", " np.float32(14.662197),\n", " np.float32(11.275689),\n", " np.float32(21.76158),\n", " np.float32(10.755531),\n", " np.float32(18.549198),\n", " np.float32(22.36438),\n", " np.float32(15.553819)]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# one descriptor calculation for a single file\n", "\n", "dist_COM_prothel = calc_prot_hel_dist(input_dir+'1DB1.pdb', href)\n", "dist_COM_prothel" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "id": "jrBqa0b3Fki0" }, "outputs": [], "source": [ "# full calculation for a batch of files\n", "\n", "desc_config = {'descriptors': \n", " [\n", " 'prot_hel_dist',\n", " 'pairwise_sep_dist',\n", " 'com_calpha_angles',\n", " 'len_of_hel',\n", " 'angles_between_hel',\n", " 'com_clamp',\n", " 'charge_clamp_dist',\n", " 'charge_clamp_angles',\n", " 'acc_per_hel',\n", " 'sse_content',\n", " 'dssp_hel', \n", " 'dssp_extra'\n", " ]\n", " }\n", "\n", "calculator = DescCalculator(href, clamp_resid_h, config=desc_config)" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "-aCf0MJrFlK6", "outputId": "475b2162-68cb-4d80-c617-164fa1528536" }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ " 0%| | 0/2 [00:00\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
prot_nameDist prot-H1Dist prot-H2Dist prot-H3Dist prot-H4Dist prot-H5Dist prot-H6Dist prot-H7Dist prot-H8Dist prot-H9...DSSP end_H6DSSP end_H7DSSP end_H8DSSP end_H9DSSP end_H10DSSP end_H11DSSP end_H12DSSP end_H13DSSP end_H14N_res extra helical
01IE8.pdb17.35786419.12784028.5912219.30137617.5159614.18208220.48017114.52799511.256910...3673783963974054104134164210
11DB1.pdb17.38336619.16547428.7900379.33531817.7023644.16690720.69103214.66219711.275689...370379396397405004164216
\n", "

2 rows × 285 columns

\n", "" ], "text/plain": [ " prot_name Dist prot-H1 Dist prot-H2 Dist prot-H3 Dist prot-H4 \\\n", "0 1IE8.pdb 17.357864 19.127840 28.591221 9.301376 \n", "1 1DB1.pdb 17.383366 19.165474 28.790037 9.335318 \n", "\n", " Dist prot-H5 Dist prot-H6 Dist prot-H7 Dist prot-H8 Dist prot-H9 ... \\\n", "0 17.515961 4.182082 20.480171 14.527995 11.256910 ... \n", "1 17.702364 4.166907 20.691032 14.662197 11.275689 ... \n", "\n", " DSSP end_H6 DSSP end_H7 DSSP end_H8 DSSP end_H9 DSSP end_H10 \\\n", "0 367 378 396 397 405 \n", "1 370 379 396 397 405 \n", "\n", " DSSP end_H11 DSSP end_H12 DSSP end_H13 DSSP end_H14 N_res extra helical \n", "0 410 413 416 421 0 \n", "1 0 0 416 421 6 \n", "\n", "[2 rows x 285 columns]" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_hprep.head(5)" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "id": "4ovTTkI2aXQr" }, "outputs": [], "source": [ "df_hprep.to_csv('./output_data/output.csv')" ] } ], "metadata": { "colab": { "collapsed_sections": [ "LTUp-k_iqGzk" ], "provenance": [] }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.10" } }, "nbformat": 4, "nbformat_minor": 0 }