{ "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, ?it/s]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "calculating structure - ./input_data/1IE8.pdb\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ " 50%|█████ | 1/2 [00:01<00:01, 1.88s/it]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "calculating structure - ./input_data/1DB1.pdb\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|██████████| 2/2 [00:03<00:00, 1.88s/it]\n" ] } ], "source": [ "df_hprep = calculator.calc_all(input_dir, save_to_csv=False, parallel=False)" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 297 }, "id": "LElDRQQrO8a0", "outputId": "836355bf-3fa0-451d-a472-eb82b68db1d0" }, "outputs": [ { "data": { "text/html": [ "
| \n", " | prot_name | \n", "Dist prot-H1 | \n", "Dist prot-H2 | \n", "Dist prot-H3 | \n", "Dist prot-H4 | \n", "Dist prot-H5 | \n", "Dist prot-H6 | \n", "Dist prot-H7 | \n", "Dist prot-H8 | \n", "Dist prot-H9 | \n", "... | \n", "DSSP end_H6 | \n", "DSSP end_H7 | \n", "DSSP end_H8 | \n", "DSSP end_H9 | \n", "DSSP end_H10 | \n", "DSSP end_H11 | \n", "DSSP end_H12 | \n", "DSSP end_H13 | \n", "DSSP end_H14 | \n", "N_res extra helical | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "1IE8.pdb | \n", "17.357864 | \n", "19.127840 | \n", "28.591221 | \n", "9.301376 | \n", "17.515961 | \n", "4.182082 | \n", "20.480171 | \n", "14.527995 | \n", "11.256910 | \n", "... | \n", "367 | \n", "378 | \n", "396 | \n", "397 | \n", "405 | \n", "410 | \n", "413 | \n", "416 | \n", "421 | \n", "0 | \n", "
| 1 | \n", "1DB1.pdb | \n", "17.383366 | \n", "19.165474 | \n", "28.790037 | \n", "9.335318 | \n", "17.702364 | \n", "4.166907 | \n", "20.691032 | \n", "14.662197 | \n", "11.275689 | \n", "... | \n", "370 | \n", "379 | \n", "396 | \n", "397 | \n", "405 | \n", "0 | \n", "0 | \n", "416 | \n", "421 | \n", "6 | \n", "
2 rows × 285 columns
\n", "