diff --git a/examples/example_gromos_trajectories.ipynb b/examples/example_gromos_trajectories.ipynb index 3c4a117a..de2f96c3 100644 --- a/examples/example_gromos_trajectories.ipynb +++ b/examples/example_gromos_trajectories.ipynb @@ -23,7 +23,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": { "pycharm": { "is_executing": true @@ -38,59 +38,9 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0\ttotene\n", - "1\ttotkin\n", - "2\ttotpot\n", - "3\ttotcov\n", - "4\ttotbond\n", - "5\ttotangle\n", - "6\ttotimproper\n", - "7\ttotdihedral\n", - "8\ttotcrossdihedral\n", - "9\ttotnonbonded\n", - "10\ttotlj\n", - "11\ttotcrf\n", - "12\ttotls\n", - "13\ttotlspair\n", - "14\ttotlsreal\n", - "15\ttotlsk\n", - "16\ttotlsa\n", - "17\ttotlsself\n", - "18\ttotlssurf\n", - "19\ttotpolself\n", - "20\ttotspecial\n", - "21\ttotsasa\n", - "22\ttotsasavol\n", - "23\ttotconstraint\n", - "24\ttotdisres\n", - "25\ttotdisfieldres\n", - "26\ttotdihres\n", - "27\ttotposres\n", - "28\ttotjval\n", - "29\ttotxray\n", - "30\ttotle\n", - "31\ttotorder\n", - "32\ttotsymm\n", - "33\teds_vr,entropy\n", - "34\ttotqm\n", - "35\ttotbsleus\n", - "36\ttotrdc\n", - "37\twip1\n", - "38\twip2\n", - "39\twip3\n", - "40\twip4\n", - "41\twip5\n", - "42\twip6\n" - ] - } - ], + "outputs": [], "source": [ "\n", "#specific imports from pygromos for trc and tre file support\n", @@ -115,14 +65,14 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "/cluster/work/igc/wsalome/anaconda3/envs/pygromos/lib/python3.7/site-packages/pandas/core/generic.py:2621: PerformanceWarning: \n", + "/cluster/work/igc/wsalome/anaconda3/envs/pygromos2/lib/python3.7/site-packages/pandas/core/generic.py:2621: PerformanceWarning: \n", "your performance may suffer as PyTables will pickle object types that it cannot\n", "map directly to c-types [inferred_type->mixed,key->block2_values] [items->Index(['POS_1', 'POS_2', 'POS_3', 'POS_4', 'POS_5', 'POS_6', 'POS_7', 'POS_8',\n", " 'POS_9', 'POS_10', 'POS_11', 'POS_12', 'POS_13', 'POS_14', 'POS_15',\n", @@ -152,7 +102,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -178,7 +128,7 @@ " 'write_pdb']" ] }, - "execution_count": 5, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -196,7 +146,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -205,7 +155,7 @@ "0.03803161677595912" ] }, - "execution_count": 6, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -217,7 +167,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -226,7 +176,7 @@ "0.029597332762906308" ] }, - "execution_count": 7, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -238,7 +188,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -247,7 +197,7 @@ "0.15259971796798974" ] }, - "execution_count": 8, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -266,7 +216,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -278,7 +228,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -298,7 +248,7 @@ "Length: 418, dtype: float64" ] }, - "execution_count": 10, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -311,7 +261,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -320,7 +270,7 @@ "0.45100360300648046" ] }, - "execution_count": 11, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -339,7 +289,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -362,23 +312,9 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 15, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/cluster/work/igc/wsalome/anaconda3/envs/pygromos/lib/python3.7/site-packages/pandas/core/generic.py:2621: PerformanceWarning: \n", - "your performance may suffer as PyTables will pickle object types that it cannot\n", - "map directly to c-types [inferred_type->mixed,key->block2_values] [items->Index(['totals', 'baths', 'bonded', 'nonbonded', 'special', 'eds', 'mass',\n", - " 'temperature', 'volume', 'pressure'],\n", - " dtype='object')]\n", - "\n", - " encoding=encoding,\n" - ] - } - ], + "outputs": [], "source": [ "# import the trajectory file into a Tre class\n", "from pygromos.files.trajectory.tre_field_libs.ene_fields import gromos_2015_tre_block_names_table\n", @@ -388,7 +324,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 16, "metadata": { "jupyter": { "outputs_hidden": false @@ -698,7 +634,7 @@ "9 [18.24226614, 108700.5608, 130819.9731, 21.832... " ] }, - "execution_count": 13, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -709,7 +645,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -733,7 +669,7 @@ " 'write']" ] }, - "execution_count": 15, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -762,7 +698,8 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 18, + "metadata": {}, "outputs": [ { "data": { @@ -770,7 +707,7 @@ "874.6182260652407" ] }, - "execution_count": 16, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -782,7 +719,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -791,7 +728,7 @@ "array([297.7702854 , 297.71343093])" ] }, - "execution_count": 17, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -817,7 +754,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -838,7 +775,7 @@ "Name: 2, dtype: object" ] }, - "execution_count": 18, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -849,7 +786,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -868,7 +805,7 @@ "Name: nonbonded, dtype: float64" ] }, - "execution_count": 19, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -880,50 +817,13 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 22, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "(38,) [ -408806.2436 393521.852 -802328.0956 138403.8772\n", - " 0. 49931.35526 0. 88472.52195\n", - " 0. -940731.9728 984602.6158 -1925334.589\n", - " 0. 0. 0. 0.\n", - " 0. 0. 0. 0.\n", - " 0. 0. 0. 0.\n", - " 0. 0. 0. 0.\n", - " 0. 0. 0. 0.\n", - " 0. 0. 0. 0.\n", - " 0. 0. ]\n" - ] - }, - { - "ename": "ValueError", - "evalue": "Shape of passed values is (10, 38), indices imply (10, 43)", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m/cluster/work/igc/wsalome/anaconda3/envs/pygromos/lib/python3.7/site-packages/pandas/core/internals/managers.py\u001b[0m in \u001b[0;36mcreate_block_manager_from_blocks\u001b[0;34m(blocks, axes)\u001b[0m\n\u001b[1;32m 1675\u001b[0m make_block(\n\u001b[0;32m-> 1676\u001b[0;31m \u001b[0mvalues\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mblocks\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mplacement\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mslice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0maxes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mndim\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1677\u001b[0m )\n", - "\u001b[0;32m/cluster/work/igc/wsalome/anaconda3/envs/pygromos/lib/python3.7/site-packages/pandas/core/internals/blocks.py\u001b[0m in \u001b[0;36mmake_block\u001b[0;34m(values, placement, klass, ndim, dtype)\u001b[0m\n\u001b[1;32m 2741\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2742\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mklass\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mndim\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mndim\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mplacement\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mplacement\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2743\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/cluster/work/igc/wsalome/anaconda3/envs/pygromos/lib/python3.7/site-packages/pandas/core/internals/blocks.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, values, placement, ndim)\u001b[0m\n\u001b[1;32m 142\u001b[0m raise ValueError(\n\u001b[0;32m--> 143\u001b[0;31m \u001b[0;34mf\"Wrong number of items passed {len(self.values)}, \"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 144\u001b[0m \u001b[0;34mf\"placement implies {len(self.mgr_locs)}\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mValueError\u001b[0m: Wrong number of items passed 38, placement implies 43", - "\nDuring handling of the above exception, another exception occurred:\n", - "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtre\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_totals\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[0;32m/cluster/work/igc/wsalome/anaconda3/envs/pygromos/lib/python3.7/site-packages/PyGromos-0+untagged.176.g9b9886d-py3.7.egg/pygromos/files/trajectory/tre.py\u001b[0m in \u001b[0;36mget_totals\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mget_totals\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mDataFrame\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 37\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdatabase\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"totals\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdatabase\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"totals\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 38\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtotals\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mDataFrame\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstack\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdatabase\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"totals\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto_numpy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcolumns\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtre_block_name_table\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtotals_subblock_names\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 39\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtotals\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 40\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/cluster/work/igc/wsalome/anaconda3/envs/pygromos/lib/python3.7/site-packages/pandas/core/frame.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, data, index, columns, dtype, copy)\u001b[0m\n\u001b[1;32m 556\u001b[0m \u001b[0mmgr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minit_dict\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mindex\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcolumns\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdtype\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 557\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 558\u001b[0;31m \u001b[0mmgr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minit_ndarray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mindex\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcolumns\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdtype\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcopy\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 559\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 560\u001b[0m \u001b[0;31m# For data is list-like, or Iterable (will consume into list)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/cluster/work/igc/wsalome/anaconda3/envs/pygromos/lib/python3.7/site-packages/pandas/core/internals/construction.py\u001b[0m in \u001b[0;36minit_ndarray\u001b[0;34m(values, index, columns, dtype, copy)\u001b[0m\n\u001b[1;32m 236\u001b[0m \u001b[0mblock_values\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 237\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 238\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mcreate_block_manager_from_blocks\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mblock_values\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mindex\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 239\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 240\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/cluster/work/igc/wsalome/anaconda3/envs/pygromos/lib/python3.7/site-packages/pandas/core/internals/managers.py\u001b[0m in \u001b[0;36mcreate_block_manager_from_blocks\u001b[0;34m(blocks, axes)\u001b[0m\n\u001b[1;32m 1685\u001b[0m \u001b[0mblocks\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"values\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mb\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mb\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mblocks\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1686\u001b[0m \u001b[0mtot_items\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msum\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mb\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mblocks\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1687\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mconstruction_error\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtot_items\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mblocks\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1688\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1689\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mValueError\u001b[0m: Shape of passed values is (10, 38), indices imply (10, 43)" - ] - }, { "data": { "text/html": [ @@ -1266,7 +1166,7 @@ "[10 rows x 38 columns]" ] }, - "execution_count": 19, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -1284,188 +1184,929 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# import the trajectory file into a Tre class\n", - "tre = traj_tre.Tre(input_value=\"example_files/Traj_files/RAFE_TI_l0_5.tre\")\n", - "tre.get_precalclam()" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "pycharm": { - "name": "#%% md\n" - } - }, - "source": [ - "### EDS in TREs" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# import the trajectory file into a Tre class\n", - "tre = traj_tre.Tre(input_value=\"example_files/Traj_files/RAFE_eds.tre\")\n", - "tre.get_eds()" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "pycharm": { - "name": "#%% md\n" - } - }, - "source": [ - "## Concatenate and Copy multiple Trajectories" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Trajectories offer a wide range of additional file manipulations. Trajectory classes can be copied (deep) and added to each other to concatenate multiple small simulation pieces into one large trajectory. " - ] - }, - { - "cell_type": "code", - "execution_count": 24, + "execution_count": 23, "metadata": {}, - "outputs": [], - "source": [ - "tre_copy = traj_tre.Tre(input_value=tre)" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "metadata": { - "pycharm": { - "name": "#%%\n" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "(10, 12)" - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "tre_copy.database.shape" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "metadata": { - "pycharm": { - "name": "#%%\n" - } - }, - "outputs": [], - "source": [ - "tre_combined = tre + tre_copy" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "metadata": { - "pycharm": { - "name": "#%%\n" - } - }, "outputs": [ { - "data": { - "text/plain": [ - "(19, 12)" - ] - }, - "execution_count": 27, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "tre_combined.database.shape" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the new combined trajectory we have one long trajectory made from the two smaller ones. The length is one element shorter, since normally the last element of the first trajectory and the first element of the second trajectory is the same element. This can be controlled via the option \"skip_new_0=True\" in the add_traj() function which is the core of the \"+\" operator for trajectories. In the following line the default behavior can be seen as a smooth numbering in the TIMESTEPs." - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "metadata": { - "pycharm": { - "name": "#%%\n" - } - }, - "outputs": [ + "name": "stderr", + "output_type": "stream", + "text": [ + "/cluster/work/igc/wsalome/anaconda3/envs/pygromos2/lib/python3.7/site-packages/pandas/core/generic.py:2621: PerformanceWarning: \n", + "your performance may suffer as PyTables will pickle object types that it cannot\n", + "map directly to c-types [inferred_type->mixed,key->block2_values] [items->Index(['totals', 'baths', 'bonded', 'nonbonded', 'special', 'eds',\n", + " 'precalclam', 'mass', 'temperature', 'volume', 'pressure'],\n", + " dtype='object')]\n", + "\n", + " encoding=encoding,\n" + ] + }, { "data": { - "text/plain": [ - "0 0.00\n", - "1 0.04\n", - "2 0.08\n", - "3 0.12\n", - "4 0.16\n", - "5 0.20\n", - "6 0.24\n", - "7 0.28\n", - "8 0.32\n", - "9 0.36\n", - "10 0.40\n", - "11 0.44\n", - "12 0.48\n", - "13 0.52\n", - "14 0.56\n", - "15 0.60\n", - "16 0.64\n", - "17 0.68\n", - "18 0.72\n", - "Name: TIMESTEP_time, dtype: float64" - ] - }, - "execution_count": 28, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "tre_combined.database.TIMESTEP_time" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "text/html": [ + "
\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", + " \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", + " \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", + " \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", + "
nr_lambdasA_e_lj_1B_e_lj_1A_e_crf_1B_e_crf_1AB_kinetic_1AB_bond_1AB_angle_1AB_improper_1AB_disres_1...B_e_crf_2AB_kinetic_2AB_bond_2AB_angle_2AB_improper_2AB_disres_2AB_dihres_2AB_disfld_2A_dihedralB_dihedral
02.0-4.469426-53.669555-79.373179-52.88737336.0917970.00.00.00.0...-122.39432036.0917970.00.00.00.00.00.00.00.0
12.0-55.493090-58.228689-86.711496-52.41006244.8866450.00.00.00.0...-122.45759044.8866450.00.00.00.00.00.00.00.0
22.0-3.935587-54.492379-79.515189-54.14254646.1999810.00.00.00.0...-139.03530946.1999810.00.00.00.00.00.00.00.0
32.0-44.047130-54.945185-83.150923-53.67306641.2682210.00.00.00.0...-130.35815841.2682210.00.00.00.00.00.00.00.0
42.0-23.340313-52.961388-75.743516-53.92013336.6802110.00.00.00.0...-134.27206336.6802110.00.00.00.00.00.00.00.0
..................................................................
4952.039.941549-64.577818-71.993096-53.48588935.8293090.00.00.00.0...-130.53497635.8293090.00.00.00.00.00.00.00.0
4962.0-8.487283-54.840254-73.625420-54.11276833.2601610.00.00.00.0...-117.26283233.2601610.00.00.00.00.00.00.00.0
4972.029.934914-54.557127-76.326046-51.81158741.7350860.00.00.00.0...-104.32667341.7350860.00.00.00.00.00.00.00.0
4982.0-35.691879-60.330236-77.859153-54.29543344.9448470.00.00.00.0...-123.23115844.9448470.00.00.00.00.00.00.00.0
4992.021.308545-58.470225-72.376205-53.55497741.7404830.00.00.00.0...-125.53923941.7404830.00.00.00.00.00.00.00.0
\n", + "

500 rows × 25 columns

\n", + "
" + ], + "text/plain": [ + " nr_lambdas A_e_lj_1 B_e_lj_1 A_e_crf_1 B_e_crf_1 AB_kinetic_1 \\\n", + "0 2.0 -4.469426 -53.669555 -79.373179 -52.887373 36.091797 \n", + "1 2.0 -55.493090 -58.228689 -86.711496 -52.410062 44.886645 \n", + "2 2.0 -3.935587 -54.492379 -79.515189 -54.142546 46.199981 \n", + "3 2.0 -44.047130 -54.945185 -83.150923 -53.673066 41.268221 \n", + "4 2.0 -23.340313 -52.961388 -75.743516 -53.920133 36.680211 \n", + ".. ... ... ... ... ... ... \n", + "495 2.0 39.941549 -64.577818 -71.993096 -53.485889 35.829309 \n", + "496 2.0 -8.487283 -54.840254 -73.625420 -54.112768 33.260161 \n", + "497 2.0 29.934914 -54.557127 -76.326046 -51.811587 41.735086 \n", + "498 2.0 -35.691879 -60.330236 -77.859153 -54.295433 44.944847 \n", + "499 2.0 21.308545 -58.470225 -72.376205 -53.554977 41.740483 \n", + "\n", + " AB_bond_1 AB_angle_1 AB_improper_1 AB_disres_1 ... B_e_crf_2 \\\n", + "0 0.0 0.0 0.0 0.0 ... -122.394320 \n", + "1 0.0 0.0 0.0 0.0 ... -122.457590 \n", + "2 0.0 0.0 0.0 0.0 ... -139.035309 \n", + "3 0.0 0.0 0.0 0.0 ... -130.358158 \n", + "4 0.0 0.0 0.0 0.0 ... -134.272063 \n", + ".. ... ... ... ... ... ... \n", + "495 0.0 0.0 0.0 0.0 ... -130.534976 \n", + "496 0.0 0.0 0.0 0.0 ... -117.262832 \n", + "497 0.0 0.0 0.0 0.0 ... -104.326673 \n", + "498 0.0 0.0 0.0 0.0 ... -123.231158 \n", + "499 0.0 0.0 0.0 0.0 ... -125.539239 \n", + "\n", + " AB_kinetic_2 AB_bond_2 AB_angle_2 AB_improper_2 AB_disres_2 \\\n", + "0 36.091797 0.0 0.0 0.0 0.0 \n", + "1 44.886645 0.0 0.0 0.0 0.0 \n", + "2 46.199981 0.0 0.0 0.0 0.0 \n", + "3 41.268221 0.0 0.0 0.0 0.0 \n", + "4 36.680211 0.0 0.0 0.0 0.0 \n", + ".. ... ... ... ... ... \n", + "495 35.829309 0.0 0.0 0.0 0.0 \n", + "496 33.260161 0.0 0.0 0.0 0.0 \n", + "497 41.735086 0.0 0.0 0.0 0.0 \n", + "498 44.944847 0.0 0.0 0.0 0.0 \n", + "499 41.740483 0.0 0.0 0.0 0.0 \n", + "\n", + " AB_dihres_2 AB_disfld_2 A_dihedral B_dihedral \n", + "0 0.0 0.0 0.0 0.0 \n", + "1 0.0 0.0 0.0 0.0 \n", + "2 0.0 0.0 0.0 0.0 \n", + "3 0.0 0.0 0.0 0.0 \n", + "4 0.0 0.0 0.0 0.0 \n", + ".. ... ... ... ... \n", + "495 0.0 0.0 0.0 0.0 \n", + "496 0.0 0.0 0.0 0.0 \n", + "497 0.0 0.0 0.0 0.0 \n", + "498 0.0 0.0 0.0 0.0 \n", + "499 0.0 0.0 0.0 0.0 \n", + "\n", + "[500 rows x 25 columns]" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# import the trajectory file into a Tre class\n", + "tre = traj_tre.Tre(input_value=\"example_files/Traj_files/RAFE_TI_l0_5.tre\")\n", + "tre.get_precalclam()" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "pycharm": { + "name": "#%% md\n" + } + }, + "source": [ + "### EDS in TREs" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/cluster/work/igc/wsalome/anaconda3/envs/pygromos2/lib/python3.7/site-packages/pandas/core/generic.py:2621: PerformanceWarning: \n", + "your performance may suffer as PyTables will pickle object types that it cannot\n", + "map directly to c-types [inferred_type->mixed,key->block2_values] [items->Index(['totals', 'baths', 'bonded', 'nonbonded', 'special', 'eds',\n", + " 'precalclam', 'mass', 'temperature', 'volume', 'pressure'],\n", + " dtype='object')]\n", + "\n", + " encoding=encoding,\n" + ] + }, + { + "data": { + "text/html": [ + "
\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", + " \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", + " \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", + " \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", + "
numstatestotal_1nonbonded_1special_1offset_1total_2nonbonded_2special_2offset_2total_3...special_7offset_7total_8nonbonded_8special_8offset_8total_9nonbonded_9special_9offset_9
09.0-304.241276-304.2412760.00.0-309.738568-309.7385680.00.0-286.397004...0.00.0-306.757290-306.7572900.00.01.661115e+051.661115e+050.00.0
19.0-327.432243-327.4322430.00.0-343.990987-343.9909870.00.0-330.156886...0.00.0-337.505471-337.5054710.00.02.114028e+052.114028e+050.00.0
29.0-342.969913-342.9699130.00.0-348.338017-348.3380170.00.0-342.678812...0.00.0-343.085575-343.0855750.00.02.335587e+052.335587e+050.00.0
39.0-307.787722-307.7877220.00.0-320.642022-320.6420220.00.0-275.892803...0.00.0-287.546356-287.5463560.00.01.263949e+051.263949e+050.00.0
49.0-325.101329-325.1013290.00.0-333.832261-333.8322610.00.0-309.882401...0.00.0-328.133697-328.1336970.00.03.637117e+053.637117e+050.00.0
59.0-341.014069-341.0140690.00.0-338.126642-338.1266420.00.0-319.108916...0.00.0-331.591241-331.5912410.00.03.426647e+063.426647e+060.00.0
69.0-332.591891-332.5918910.00.0-313.860613-313.8606130.00.0-270.145527...0.00.0-295.307547-295.3075470.00.06.720166e+056.720166e+050.00.0
79.0-384.741762-384.7417620.00.0-379.723111-379.7231110.00.0-340.573094...0.00.0-363.097220-363.0972200.00.06.147874e+046.147874e+040.00.0
89.0-341.408526-341.4085260.00.0-352.793311-352.7933110.00.0-268.495614...0.00.0-327.075935-327.0759350.00.02.863084e+042.863084e+040.00.0
99.0-336.573404-336.5734040.00.0-340.350887-340.3508870.00.0-238.003947...0.00.0-325.957742-325.9577420.00.03.048352e+043.048352e+040.00.0
\n", + "

10 rows × 37 columns

\n", + "
" + ], + "text/plain": [ + " numstates total_1 nonbonded_1 special_1 offset_1 total_2 \\\n", + "0 9.0 -304.241276 -304.241276 0.0 0.0 -309.738568 \n", + "1 9.0 -327.432243 -327.432243 0.0 0.0 -343.990987 \n", + "2 9.0 -342.969913 -342.969913 0.0 0.0 -348.338017 \n", + "3 9.0 -307.787722 -307.787722 0.0 0.0 -320.642022 \n", + "4 9.0 -325.101329 -325.101329 0.0 0.0 -333.832261 \n", + "5 9.0 -341.014069 -341.014069 0.0 0.0 -338.126642 \n", + "6 9.0 -332.591891 -332.591891 0.0 0.0 -313.860613 \n", + "7 9.0 -384.741762 -384.741762 0.0 0.0 -379.723111 \n", + "8 9.0 -341.408526 -341.408526 0.0 0.0 -352.793311 \n", + "9 9.0 -336.573404 -336.573404 0.0 0.0 -340.350887 \n", + "\n", + " nonbonded_2 special_2 offset_2 total_3 ... special_7 offset_7 \\\n", + "0 -309.738568 0.0 0.0 -286.397004 ... 0.0 0.0 \n", + "1 -343.990987 0.0 0.0 -330.156886 ... 0.0 0.0 \n", + "2 -348.338017 0.0 0.0 -342.678812 ... 0.0 0.0 \n", + "3 -320.642022 0.0 0.0 -275.892803 ... 0.0 0.0 \n", + "4 -333.832261 0.0 0.0 -309.882401 ... 0.0 0.0 \n", + "5 -338.126642 0.0 0.0 -319.108916 ... 0.0 0.0 \n", + "6 -313.860613 0.0 0.0 -270.145527 ... 0.0 0.0 \n", + "7 -379.723111 0.0 0.0 -340.573094 ... 0.0 0.0 \n", + "8 -352.793311 0.0 0.0 -268.495614 ... 0.0 0.0 \n", + "9 -340.350887 0.0 0.0 -238.003947 ... 0.0 0.0 \n", + "\n", + " total_8 nonbonded_8 special_8 offset_8 total_9 nonbonded_9 \\\n", + "0 -306.757290 -306.757290 0.0 0.0 1.661115e+05 1.661115e+05 \n", + "1 -337.505471 -337.505471 0.0 0.0 2.114028e+05 2.114028e+05 \n", + "2 -343.085575 -343.085575 0.0 0.0 2.335587e+05 2.335587e+05 \n", + "3 -287.546356 -287.546356 0.0 0.0 1.263949e+05 1.263949e+05 \n", + "4 -328.133697 -328.133697 0.0 0.0 3.637117e+05 3.637117e+05 \n", + "5 -331.591241 -331.591241 0.0 0.0 3.426647e+06 3.426647e+06 \n", + "6 -295.307547 -295.307547 0.0 0.0 6.720166e+05 6.720166e+05 \n", + "7 -363.097220 -363.097220 0.0 0.0 6.147874e+04 6.147874e+04 \n", + "8 -327.075935 -327.075935 0.0 0.0 2.863084e+04 2.863084e+04 \n", + "9 -325.957742 -325.957742 0.0 0.0 3.048352e+04 3.048352e+04 \n", + "\n", + " special_9 offset_9 \n", + "0 0.0 0.0 \n", + "1 0.0 0.0 \n", + "2 0.0 0.0 \n", + "3 0.0 0.0 \n", + "4 0.0 0.0 \n", + "5 0.0 0.0 \n", + "6 0.0 0.0 \n", + "7 0.0 0.0 \n", + "8 0.0 0.0 \n", + "9 0.0 0.0 \n", + "\n", + "[10 rows x 37 columns]" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# import the trajectory file into a Tre class\n", + "tre = traj_tre.Tre(input_value=\"example_files/Traj_files/RAFE_eds.tre\")\n", + "tre.get_eds()" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "pycharm": { + "name": "#%% md\n" + } + }, + "source": [ + "## Concatenate and Copy multiple Trajectories" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Trajectories offer a wide range of additional file manipulations. Trajectory classes can be copied (deep) and added to each other to concatenate multiple small simulation pieces into one large trajectory. " + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "tre_copy = traj_tre.Tre(input_value=tre)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(10, 13)" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tre_copy.database.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [], + "source": [ + "tre_combined = tre + tre_copy" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(19, 13)" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tre_combined.database.shape" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the new combined trajectory we have one long trajectory made from the two smaller ones. The length is one element shorter, since normally the last element of the first trajectory and the first element of the second trajectory is the same element. This can be controlled via the option \"skip_new_0=True\" in the add_traj() function which is the core of the \"+\" operator for trajectories. In the following line the default behavior can be seen as a smooth numbering in the TIMESTEPs." + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "pycharm": { + "name": "#%%\n" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "0 0.00\n", + "1 0.04\n", + "2 0.08\n", + "3 0.12\n", + "4 0.16\n", + "5 0.20\n", + "6 0.24\n", + "7 0.28\n", + "8 0.32\n", + "9 0.36\n", + "10 0.40\n", + "11 0.44\n", + "12 0.48\n", + "13 0.52\n", + "14 0.56\n", + "15 0.60\n", + "16 0.64\n", + "17 0.68\n", + "18 0.72\n", + "Name: TIMESTEP_time, dtype: float64" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tre_combined.database.TIMESTEP_time" + ] } ], "metadata": { "kernelspec": { - "display_name": "pygromos", + "display_name": "pygromos2", "language": "python", - "name": "pygromos" + "name": "pygromos2" }, "language_info": { "codemirror_mode": {