diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 7f0fab3..86a1e3a 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -79,4 +79,4 @@ jobs: shell: bash if: runner.os == 'Linux' run: | - CodeEntropyPoseidon -f "CodeEntropy/tests/data/1AKI_prod_60.tpr" "CodeEntropy/tests/data/1AKI_prod_60.trr" -l "protein" -b 2 -e 12 -d 2 -t 2 --wm --res --uatom --topog 5 --solwm --solres --soluatom --solContact + CodeEntropyPoseidon -f "CodeEntropy/tests/data/1AKI_prod_60.tpr" "CodeEntropy/tests/data/1AKI_prod_60.trr" -l "protein" -b 2 -e 12 -d 2 -t 2 --wm --res --uatom --topog 3 --solwm --solres --soluatom --solContact \ No newline at end of file diff --git a/.github/workflows/publish-on-pypi.yaml b/.github/workflows/publish-on-pypi.yaml new file mode 100644 index 0000000..3acadfc --- /dev/null +++ b/.github/workflows/publish-on-pypi.yaml @@ -0,0 +1,21 @@ +name: Publish on PyPI + +on: + push: + tags: + # After vMajor.Minor.Patch _anything_ is allowed (without "/") ! + - '*' + +jobs: + publish: + name: Publish to pypi if tagged + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: casperdcl/deploy-pypi@v2 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + pip: wheel -w dist/ --no-deps . + # only upload if a tag is pushed (otherwise just build & check) + upload: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }} \ No newline at end of file diff --git a/CodeEntropy/ClassCollection/PoseidonClass.py b/CodeEntropy/ClassCollection/PoseidonClass.py index 16f83f7..b8c3992 100644 --- a/CodeEntropy/ClassCollection/PoseidonClass.py +++ b/CodeEntropy/ClassCollection/PoseidonClass.py @@ -5,6 +5,8 @@ from collections import Counter from datetime import datetime +from joblib import delayed + from CodeEntropy.poseidon.extractData.readFiles import populateTopology, getCoordsForces, getDistArray # # Energy is not needed # from CodeEntropy.poseidon.extractData.readFiles import populateEnergy, UAEnergyGroup @@ -19,9 +21,15 @@ from CodeEntropy.poseidon.analysis.EECalculation import processEE from CodeEntropy.poseidon.analysis.helper import memoryInfo, weightingPopulation +from CodeEntropy.FunctionCollection.PoseidonHelper import frame_iteration + from functools import partial from multiprocessing import Pool +from pathos.pools import ProcessPool + +import numpy as nmp + class Poseidon(): """ Container to host data from MDAnalysis.Universe and run Poseidon Analysis @@ -413,21 +421,37 @@ def __init__(self ,container, start=0, end=-1, step=1, pureAtomNum=1, cutShell=None, excludedResnames=None, water='WAT', verbose=False, thread=4): - """This is a initialization function to collect information from a MDanalysis universe into a data container for analysis using POSEIDON - Pending Work - - rewrite this into a class initalization for easier understanding - - rewrite the energy part to be compulsory - - Args: - container (MDAnalysis.Universe): A MDAnalysis object with coordinates, forces and energy (loaded to velocity field with the value [Potential Energy(index 0), Kinetic Energy(1) and dummy(2)] respectively) - start (int): Starting Frame ID. Defaults to 0. - end (int): Ending Frame ID, this frame is not included. Defaults to -1. - step (int, optional): Steps between frame. Defaults to 1. - pureAtomNum (int, optional): Reference molecule resid for pure liquid. Defaults to 1. - cutShell (float, optional): Explicit cut off shell (might be buggy since part of it is not defined). Default to None which uses the relative angular distance (RAD) algorithm. See Jonathan Higham and Richard H. Henchman , "Locally adaptive method to define coordination shell", J. Chem. Phys. 145, 084108 (2016) - excludedResnames (list, optional): List of resnames to exclude from nearest non alike analysis. Defaults to None. - water (str, optional): Resname for water molecules. Defaults to 'WAT'. - verbose (bool, optional): print out progress of each analysis step. Defaults to False. + """ + + This is a initialization function to collect information from a MDanalysis universe into a data container for analysis using POSEIDON. + + .. Warning :: + + This requires a lot of memory to run with very little performance gain. + + Parameters + ---------- + container : MDAnalyse.Universe + A Universe object will all topology, dihedrals,coordinates and force information Check ``Example/create_new_universe.py`` on how to create a universe from existing data. + start : int or None, Optional, default: 0 + Frame id to start analysis. + end : int or None, Optional, default: -1 + Frame id to end analysis. + step : int, Optional, default: 1 + Steps between frame. + pureAtomNum : int, Optional, default: 1 + Reference molecule resid for pure liquid. + cutShell : float or None, Optional, default: 1 + Explicit cut off shell. Default to None which uses the relative angular distance (RAD) algorithm. See Jonathan Higham and Richard H. Henchman , "Locally adaptive method to define coordination shell", J. Chem. Phys. 145, 084108 (2016) + excludedResnames : list of str or None, Optional, default: None + List of resnames to exclude from nearest non alike analysis. + water : list of str, Optional, default: "WAT" + Resname for water molecules. + verbose : bool, Optional, default: False + Print out progress of each step. + thread : int, Optional, default: 4 + How many multiprocess thread to spawn + """ startTime = datetime.now() print(startTime) @@ -463,9 +487,15 @@ def __init__(self ,container, start=0, end=-1, if end == -1: end = len(container.trajectory) sys.setrecursionlimit(3000000) - p = Pool(processes=thread) - fi_partial = partial(self.frame_iteration, container, all_data, dimensions, startTime, verbosePrint, waterTuple, cutShell, excludedResnames) - data = p.map(fi_partial, [frame for frame in range(int(start), int(end), int(step))]) + #p = Pool(processes=thread) + p = ProcessPool(nodes=thread) + fi_partial = partial(frame_iteration, container, all_data, dimensions, startTime, verbosePrint, waterTuple, cutShell, excludedResnames) + range = nmp.arange(int(start), int(end), int(step)) + data = p.map(fi_partial, range) + p.close() + + print("Done Threading Work") + print(len(data)) # data = [] # for frame in range(int(start), int(end), int(step)): # data.append(fi_partial(frame)) @@ -480,120 +510,3 @@ def __init__(self ,container, start=0, end=-1, print(datetime.now() - startTime) self.allMoleculeList = allMoleculeList - - def frame_iteration(self, container, all_data, dimensions, startTime, verbosePrint, waterTuple, cutShell, excludedResnames, frame): - clearClass(all_data) - print(f"frame = {frame}") - - all_data, dimensions = getCoordsForces(container, - all_data, dimensions, frame, startTime, - verbosePrint) - # # Energy is not needed - # populateEnergy(container, all_data, - # dimensions, frame, startTime, verbosePrint) - # UAEnergyGroup(all_data) - - - calculateDihedrals(all_data, dimensions) - verbosePrint('DIH') - verbosePrint(datetime.now() - startTime) - sys.stdout.flush() - - #''' - traj = container.trajectory[frame] - neighbour_coords = None - neighbour_coords = traj.positions - - max_cutoff = 10 - for x in range(0, len(all_data)): - atom = all_data[x] - #start nearest array from solutes - if atom.resname not in waterTuple: - getDistArray(atom, all_data, traj, max_cutoff, - dimensions, neighbour_coords, - startTime, verbosePrint) - #find nearest array for solute neighbours that are solvent - for nearDist in atom.nearest_all_atom_array[0:20]: - neighbour = all_data[nearDist[0]] - if neighbour.resname in waterTuple and \ - neighbour.nearest_all_atom_array == None: - getDistArray(neighbour, all_data, traj, max_cutoff, - dimensions, neighbour_coords, - startTime, verbosePrint) - #find solvent neighbours neighbours nearest array - if neighbour.nearest_all_atom_array != None: - for nearDist2 in neighbour.nearest_all_atom_array[0:20]: - neighbour2 = all_data[nearDist2[0]] - if neighbour2.resname in waterTuple and \ - neighbour2.nearest_all_atom_array == None: - getDistArray(neighbour2, all_data, - traj, max_cutoff, - dimensions, - neighbour_coords, - startTime, verbosePrint) - else: - continue - else: - continue - else: - continue - verbosePrint('NEAREST ARRAYS') - verbosePrint(datetime.now() - startTime) - sys.stdout.flush() - #''' - - - - if cutShell != None: - #Used for fixed cut-off coordination shells - try: - cutoff_dist = float(cutShell) - distCutoffNc(all_data, dimensions, cutoff_dist) - # #don't know what this is it is not defined anywhere - # NcPairs(all_data, dimensions) - verbosePrint('distCutoffNc') - verbosePrint(datetime.now() - startTime) - sys.stdout.flush() - except ValueError: - logging.error('Cutoff distance needs to be a float') - - - if cutShell == None: - UALevelRAD(all_data, dimensions) - verbosePrint('RAD') - verbosePrint(datetime.now() - startTime) - - - #if inputType != 'pdb': - HBCalc(all_data, waterTuple, dimensions) - verbosePrint('HB') - verbosePrint(datetime.now() - startTime) - sys.stdout.flush() - - - getShellAssignment(all_data, excludedResnames, dimensions, - startTime, verbosePrint) - verbosePrint('PROX') - verbosePrint(datetime.now() - startTime) - sys.stdout.flush() - - - #if (force != None): - calculateFTMatrix(all_data, dimensions) - verbosePrint('FTMATRIX') - verbosePrint(datetime.now() - startTime) - sys.stdout.flush() - - - moleculePositionRankingRAD(all_data, waterTuple, dimensions) - verbosePrint('ORIENTS') - verbosePrint(datetime.now() - startTime) - sys.stdout.flush() - - ''' - if iterations == 1: - verbosePrint('Generating .pdb file for frame %s' % (frame+1)) - pdbGenerate(all_data, ('frame_%s' % (frame+1)), dimensions) - ''' - - return (all_data, frame, dimensions) diff --git a/CodeEntropy/FunctionCollection/PoseidonHelper.py b/CodeEntropy/FunctionCollection/PoseidonHelper.py new file mode 100644 index 0000000..470435f --- /dev/null +++ b/CodeEntropy/FunctionCollection/PoseidonHelper.py @@ -0,0 +1,135 @@ +import sys +import logging + +from CodeEntropy.poseidon.extractData.readFiles import populateTopology, getCoordsForces, getDistArray +# # Energy is not needed +# from CodeEntropy.poseidon.extractData.readFiles import populateEnergy, UAEnergyGroup +from CodeEntropy.poseidon.extractData.HBRAD import distCutoffNc, UALevelRAD, HBCalc +from CodeEntropy.poseidon.extractData.forceTorques import calculateFTMatrix +from CodeEntropy.poseidon.extractData.dihedrals import calculateDihedrals +from CodeEntropy.poseidon.extractData.nearestNonlike2 import getShellAssignment, moleculePositionRankingRAD +from CodeEntropy.poseidon.extractData.outputFiles import moleculeObjectPopulation +from CodeEntropy.poseidon.extractData.mainClass import clearClass + +from CodeEntropy.poseidon.analysis.populateClasses import classPopulation +from CodeEntropy.poseidon.analysis.EECalculation import processEE +from CodeEntropy.poseidon.analysis.helper import memoryInfo, weightingPopulation + +from datetime import datetime + +def frame_iteration(container, all_data, dimensions, startTime, verbosePrint, waterTuple, cutShell, excludedResnames, frame): + clearClass(all_data) + print(f"frame = {frame}") + + all_data, dimensions = getCoordsForces(container, + all_data, dimensions, frame, startTime, + verbosePrint) + # # Energy is not needed + # populateEnergy(container, all_data, + # dimensions, frame, startTime, verbosePrint) + # UAEnergyGroup(all_data) + + + calculateDihedrals(all_data, dimensions) + verbosePrint('DIH') + verbosePrint(datetime.now() - startTime) + sys.stdout.flush() + + #''' + traj = container.trajectory[frame] + neighbour_coords = None + neighbour_coords = traj.positions + + max_cutoff = 10 + for x in range(0, len(all_data)): + atom = all_data[x] + #start nearest array from solutes + if atom.resname not in waterTuple: + getDistArray(atom, all_data, traj, max_cutoff, + dimensions, neighbour_coords, + startTime, verbosePrint) + #find nearest array for solute neighbours that are solvent + for nearDist in atom.nearest_all_atom_array[0:20]: + neighbour = all_data[nearDist[0]] + if neighbour.resname in waterTuple and \ + neighbour.nearest_all_atom_array == None: + getDistArray(neighbour, all_data, traj, max_cutoff, + dimensions, neighbour_coords, + startTime, verbosePrint) + #find solvent neighbours neighbours nearest array + if neighbour.nearest_all_atom_array != None: + for nearDist2 in neighbour.nearest_all_atom_array[0:20]: + neighbour2 = all_data[nearDist2[0]] + if neighbour2.resname in waterTuple and \ + neighbour2.nearest_all_atom_array == None: + getDistArray(neighbour2, all_data, + traj, max_cutoff, + dimensions, + neighbour_coords, + startTime, verbosePrint) + else: + continue + else: + continue + else: + continue + verbosePrint('NEAREST ARRAYS') + verbosePrint(datetime.now() - startTime) + sys.stdout.flush() + #''' + + + + if cutShell != None: + #Used for fixed cut-off coordination shells + try: + cutoff_dist = float(cutShell) + distCutoffNc(all_data, dimensions, cutoff_dist) + # #don't know what this is it is not defined anywhere + # NcPairs(all_data, dimensions) + verbosePrint('distCutoffNc') + verbosePrint(datetime.now() - startTime) + sys.stdout.flush() + except ValueError: + logging.error('Cutoff distance needs to be a float') + + + if cutShell == None: + UALevelRAD(all_data, dimensions) + verbosePrint('RAD') + verbosePrint(datetime.now() - startTime) + + + #if inputType != 'pdb': + HBCalc(all_data, waterTuple, dimensions) + verbosePrint('HB') + verbosePrint(datetime.now() - startTime) + sys.stdout.flush() + + + getShellAssignment(all_data, excludedResnames, dimensions, + startTime, verbosePrint) + verbosePrint('PROX') + verbosePrint(datetime.now() - startTime) + sys.stdout.flush() + + + #if (force != None): + calculateFTMatrix(all_data, dimensions) + verbosePrint('FTMATRIX') + verbosePrint(datetime.now() - startTime) + sys.stdout.flush() + + + moleculePositionRankingRAD(all_data, waterTuple, dimensions) + verbosePrint('ORIENTS') + verbosePrint(datetime.now() - startTime) + sys.stdout.flush() + + ''' + if iterations == 1: + verbosePrint('Generating .pdb file for frame %s' % (frame+1)) + pdbGenerate(all_data, ('frame_%s' % (frame+1)), dimensions) + ''' + #print(all_data, frame, dimensions) + return (all_data, frame, dimensions) diff --git a/Example/Capped_protein_Example_dask.ipynb b/Example/Capped_protein_Example_dask.ipynb new file mode 100644 index 0000000..a1764e4 --- /dev/null +++ b/Example/Capped_protein_Example_dask.ipynb @@ -0,0 +1,1557 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "b062a235-be79-4897-9f63-73f3d5fa411d", + "metadata": {}, + "source": [ + "# Calculate Solvent Entropy for a capped amino acid (Solvent)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d4724f43-d655-4829-8ae2-521fdcad9a05", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ac10fa4a-9be8-423c-b5b7-9f2d902191c1", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "7ab57875-f604-491b-a08d-85cb5386f9e3", + "metadata": {}, + "source": [ + "## Load Data" + ] + }, + { + "cell_type": "markdown", + "id": "3fb95f32-d4ff-46a1-b6a8-dea0011f07a4", + "metadata": {}, + "source": [ + "1. Load data into MDAnalysis Universe" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "fadb5a2e-d401-418f-bf43-5bb1771d052e", + "metadata": {}, + "outputs": [], + "source": [ + "import MDAnalysis as mda\n", + "# set the working dir to the root of repo inorder to use these path\n", + "tprfile = \"data/1AKI_prod_60.tpr\"\n", + "trrfile = \"data/1AKI_prod_60.trr\"\n", + "u = mda.Universe(tprfile, trrfile)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "9556958c-0992-4359-a41c-3752b254e376", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-07-28 18:22:02,409 - distributed.diskutils - INFO - Found stale lock file and directory '/tmp/dask-worker-space/worker-au6fh2kr', purging\n", + "2022-07-28 18:22:02,409 - distributed.diskutils - INFO - Found stale lock file and directory '/tmp/dask-worker-space/worker-024x0wbs', purging\n", + "2022-07-28 18:22:02,410 - distributed.diskutils - INFO - Found stale lock file and directory '/tmp/dask-worker-space/worker-9xmuk268', purging\n", + "2022-07-28 18:22:02,410 - distributed.diskutils - INFO - Found stale lock file and directory '/tmp/dask-worker-space/worker-76fptn9s', purging\n", + "2022-07-28 18:22:02,410 - distributed.diskutils - INFO - Found stale lock file and directory '/tmp/dask-worker-space/worker-8r24ogky', purging\n", + "2022-07-28 18:22:02,410 - distributed.diskutils - INFO - Found stale lock file and directory '/tmp/dask-worker-space/worker-whhtuqau', purging\n", + "2022-07-28 18:22:02,411 - distributed.diskutils - INFO - Found stale lock file and directory '/tmp/dask-worker-space/worker-9xguvzox', purging\n", + "2022-07-28 18:22:02,411 - distributed.diskutils - INFO - Found stale lock file and directory '/tmp/dask-worker-space/worker-45_2778y', purging\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "
\n", + "
\n", + "

Client

\n", + "

Client-cadca31b-0e99-11ed-a0a2-00155de7810d

\n", + " \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + "
Connection method: Cluster objectCluster type: distributed.LocalCluster
\n", + " Dashboard: http://127.0.0.1:8787/status\n", + "
\n", + "\n", + " \n", + "
\n", + "

Cluster Info

\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

LocalCluster

\n", + "

51a7b50a

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + "\n", + " \n", + "
\n", + " Dashboard: http://127.0.0.1:8787/status\n", + " \n", + " Workers: 4\n", + "
\n", + " Total threads: 16\n", + " \n", + " Total memory: 7.70 GiB\n", + "
Status: runningUsing processes: True
\n", + "\n", + "
\n", + " \n", + "

Scheduler Info

\n", + "
\n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Scheduler

\n", + "

Scheduler-62cc562b-c7c5-46c5-9a48-30cde1a32abb

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
\n", + " Comm: tcp://127.0.0.1:39441\n", + " \n", + " Workers: 4\n", + "
\n", + " Dashboard: http://127.0.0.1:8787/status\n", + " \n", + " Total threads: 16\n", + "
\n", + " Started: Just now\n", + " \n", + " Total memory: 7.70 GiB\n", + "
\n", + "
\n", + "
\n", + "\n", + "
\n", + " \n", + "

Workers

\n", + "
\n", + "\n", + " \n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Worker: 0

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + "
\n", + " Comm: tcp://127.0.0.1:41523\n", + " \n", + " Total threads: 4\n", + "
\n", + " Dashboard: http://127.0.0.1:45231/status\n", + " \n", + " Memory: 1.92 GiB\n", + "
\n", + " Nanny: tcp://127.0.0.1:36329\n", + "
\n", + " Local directory: /tmp/dask-worker-space/worker-h00ktz12\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Worker: 1

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + "
\n", + " Comm: tcp://127.0.0.1:42921\n", + " \n", + " Total threads: 4\n", + "
\n", + " Dashboard: http://127.0.0.1:38047/status\n", + " \n", + " Memory: 1.92 GiB\n", + "
\n", + " Nanny: tcp://127.0.0.1:44551\n", + "
\n", + " Local directory: /tmp/dask-worker-space/worker-vud0_r_u\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Worker: 2

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + "
\n", + " Comm: tcp://127.0.0.1:41499\n", + " \n", + " Total threads: 4\n", + "
\n", + " Dashboard: http://127.0.0.1:44985/status\n", + " \n", + " Memory: 1.92 GiB\n", + "
\n", + " Nanny: tcp://127.0.0.1:46385\n", + "
\n", + " Local directory: /tmp/dask-worker-space/worker-skfrjn5y\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Worker: 3

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + "
\n", + " Comm: tcp://127.0.0.1:41151\n", + " \n", + " Total threads: 4\n", + "
\n", + " Dashboard: http://127.0.0.1:34671/status\n", + " \n", + " Memory: 1.92 GiB\n", + "
\n", + " Nanny: tcp://127.0.0.1:42665\n", + "
\n", + " Local directory: /tmp/dask-worker-space/worker-d179xp5o\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "\n", + "
\n", + "
\n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "\n", + "
\n", + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import dask\n", + "import dask.multiprocessing\n", + "dask.config.set(scheduler='processes')\n", + "from dask.distributed import Client, progress\n", + "client = Client()\n", + "client" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "fd5a5807-dde0-458c-8e65-715083df5079", + "metadata": {}, + "outputs": [], + "source": [ + "import sys\n", + "import logging\n", + "import gc\n", + "\n", + "from collections import Counter\n", + "from datetime import datetime\n", + "\n", + "from joblib import delayed\n", + "\n", + "from CodeEntropy.poseidon.extractData.readFiles import populateTopology, getCoordsForces, getDistArray\n", + "# # Energy is not needed\n", + "# from CodeEntropy.poseidon.extractData.readFiles import populateEnergy, UAEnergyGroup\n", + "from CodeEntropy.poseidon.extractData.HBRAD import distCutoffNc, UALevelRAD, HBCalc\n", + "from CodeEntropy.poseidon.extractData.forceTorques import calculateFTMatrix\n", + "from CodeEntropy.poseidon.extractData.dihedrals import calculateDihedrals\n", + "from CodeEntropy.poseidon.extractData.nearestNonlike2 import getShellAssignment, moleculePositionRankingRAD \n", + "from CodeEntropy.poseidon.extractData.outputFiles import moleculeObjectPopulation\n", + "from CodeEntropy.poseidon.extractData.mainClass import clearClass\n", + "\n", + "from CodeEntropy.poseidon.analysis.populateClasses import classPopulation\n", + "from CodeEntropy.poseidon.analysis.EECalculation import processEE\n", + "from CodeEntropy.poseidon.analysis.helper import memoryInfo, weightingPopulation\n", + "\n", + "from CodeEntropy.FunctionCollection.PoseidonHelper import frame_iteration" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "6371f229-a8fb-4ba5-b65d-930ee098073f", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2022-07-28 18:19:46.761391\n", + "TOPOLOGY\n", + "0:00:10.816648\n", + "dict_keys(['LYS', 'VAL', 'PHE', 'GLY', 'ARG', 'CYS', 'GLU', 'LEU', 'ALA', 'MET', 'HIS', 'ASP', 'ASN', 'TYR', 'SER', 'TRP', 'THR', 'GLN', 'ILE', 'PRO', 'SOL', 'CL'])\n", + "EXCLUDED RESNAMES: None\n", + "prepare to execute\n", + "frame = 3\n", + "< Timestep 3 with unit cell dimensions [69.52697 69.52697 69.52697 90. 90. 90. ] >\n", + "COORDS-FORCES\n", + "0:00:14.470321\n", + "frame = 2\n", + "< Timestep 2 with unit cell dimensions [69.61369 69.61369 69.61369 90. 90. 90. ] >\n", + "COORDS-FORCES\n", + "0:00:14.534201\n", + "frame = 1\n", + "< Timestep 1 with unit cell dimensions [69.476456 69.476456 69.476456 90. 90. 90. ] >\n", + "COORDS-FORCES\n", + "0:00:14.535861\n", + "DIH\n", + "0:00:14.804284\n", + "DIH\n", + "0:00:14.890316\n", + "DIH\n", + "0:00:14.894539\n", + "frame = 4\n", + "frame = 0\n", + "< Timestep 4 with unit cell dimensions [69.57063 69.57063 69.57063 90. 90. 90. ] >\n", + "< Timestep 0 with unit cell dimensions [69.57307 69.57307 69.57307 90. 90. 90. ] >\n", + "COORDS-FORCES\n", + "0:00:16.530269\n", + "DIH\n", + "0:00:17.063608\n", + "COORDS-FORCES\n", + "0:00:17.272644\n", + "DIH\n", + "0:00:17.706473\n", + "NEAREST ARRAYS\n", + "0:00:24.242707\n", + "NEAREST ARRAYS\n", + "0:00:24.294053\n", + "NEAREST ARRAYS\n", + "0:00:24.392514\n", + "NEAREST ARRAYS\n", + "0:00:36.637898\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/CodeEntropy/poseidon/extractData/HBRAD.py:192: RuntimeWarning: invalid value encountered in arccos\n", + " angle1 = np.arccos(cosine_angle)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RAD\n", + "0:00:35.219296\n", + "HB\n", + "0:00:37.813414\n", + "NEAREST NON-LIKE ASSIGNMENT\n", + "0:00:37.847995\n", + "PROX\n", + "0:00:37.884287\n", + "RAD\n", + "0:00:35.603050\n", + "HB\n", + "0:00:38.440154\n", + "NEAREST NON-LIKE ASSIGNMENT\n", + "0:00:38.473420\n", + "RAD\n", + "0:00:35.809416\n", + "HB\n", + "0:00:38.495989\n", + "PROX\n", + "0:00:38.509796\n", + "NEAREST NON-LIKE ASSIGNMENT\n", + "0:00:38.532525\n", + "PROX\n", + "0:00:38.569533\n", + "NEAREST ARRAYS\n", + "0:00:39.726922\n", + "FTMATRIX\n", + "0:00:43.661345\n", + "ORIENTS\n", + "0:00:43.729755\n", + "FTMATRIX\n", + "0:00:44.487481\n", + "ORIENTS\n", + "0:00:44.554535\n", + "FTMATRIX\n", + "0:00:44.695925\n", + "ORIENTS\n", + "0:00:44.765300\n", + "RAD\n", + "0:01:04.065172\n", + "RAD\n", + "0:01:10.980770\n", + "HB\n", + "0:01:11.554396\n", + "NEAREST NON-LIKE ASSIGNMENT\n", + "0:01:11.609858\n", + "PROX\n", + "0:01:11.668300\n", + "HB\n", + "0:01:15.105755\n", + "NEAREST NON-LIKE ASSIGNMENT\n", + "0:01:15.147424\n", + "PROX\n", + "0:01:15.187237\n", + "FTMATRIX\n", + "0:01:29.186166\n", + "ORIENTS\n", + "0:01:29.305053\n", + "FTMATRIX\n", + "0:01:30.530090\n", + "ORIENTS\n", + "0:01:30.984170\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-07-28 18:21:21,340 - distributed.protocol.core - CRITICAL - Failed to deserialize\n", + "Traceback (most recent call last):\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/core.py\", line 158, in loads\n", + " return msgpack.loads(\n", + " File \"msgpack/_unpacker.pyx\", line 194, in msgpack._cmsgpack.unpackb\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/core.py\", line 138, in _decode_default\n", + " return merge_and_deserialize(\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\", line 497, in merge_and_deserialize\n", + " return deserialize(header, merged_frames, deserializers=deserializers)\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\", line 410, in deserialize\n", + " deserialize(\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\", line 426, in deserialize\n", + " return loads(header, frames)\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\", line 180, in serialization_error_loads\n", + " raise TypeError(msg)\n", + "TypeError: Could not serialize object of type list\n", + "Traceback (most recent call last):\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/pickle.py\", line 46, in dumps\n", + " result = pickle.dumps(x, **dump_kwargs)\n", + "RecursionError: maximum recursion depth exceeded while calling a Python object\n", + "\n", + "During handling of the above exception, another exception occurred:\n", + "\n", + "Traceback (most recent call last):\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/cloudpickle/cloudpickle_fast.py\", line 602, in dump\n", + " return Pickler.dump(self, obj)\n", + "RecursionError: maximum recursion depth exceeded\n", + "\n", + "The above exception was the direct cause of the following exception:\n", + "\n", + "Traceback (most recent call last):\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\", line 347, in serialize\n", + " header, frames = dumps(x, context=context) if wants_context else dumps(x)\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\", line 71, in pickle_dumps\n", + " frames[0] = pickle.dumps(\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/pickle.py\", line 58, in dumps\n", + " result = cloudpickle.dumps(x, **dump_kwargs)\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/cloudpickle/cloudpickle_fast.py\", line 73, in dumps\n", + " cp.dump(obj)\n", + " File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/cloudpickle/cloudpickle_fast.py\", line 609, in dump\n", + " raise pickle.PicklingError(msg) from e\n", + "_pickle.PicklingError: Could not pickle object as excessively deep recursion required.\n", + "\n" + ] + }, + { + "ename": "TypeError", + "evalue": "Could not serialize object of type list\nTraceback (most recent call last):\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/pickle.py\", line 46, in dumps\n result = pickle.dumps(x, **dump_kwargs)\nRecursionError: maximum recursion depth exceeded while calling a Python object\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/cloudpickle/cloudpickle_fast.py\", line 602, in dump\n return Pickler.dump(self, obj)\nRecursionError: maximum recursion depth exceeded\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\", line 347, in serialize\n header, frames = dumps(x, context=context) if wants_context else dumps(x)\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\", line 71, in pickle_dumps\n frames[0] = pickle.dumps(\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/pickle.py\", line 58, in dumps\n result = cloudpickle.dumps(x, **dump_kwargs)\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/cloudpickle/cloudpickle_fast.py\", line 73, in dumps\n cp.dump(obj)\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/cloudpickle/cloudpickle_fast.py\", line 609, in dump\n raise pickle.PicklingError(msg) from e\n_pickle.PicklingError: Could not pickle object as excessively deep recursion required.\n", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m/tmp/ipykernel_7257/2897571424.py\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 92\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 93\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"prepare to execute\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 94\u001b[0;31m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdask\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcompute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mjob_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mscheduler\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"distributed\"\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 95\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 96\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Done Threading Work\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/dask/base.py\u001b[0m in \u001b[0;36mcompute\u001b[0;34m(traverse, optimize_graph, scheduler, get, *args, **kwargs)\u001b[0m\n\u001b[1;32m 596\u001b[0m \u001b[0mpostcomputes\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__dask_postcompute__\u001b[0m\u001b[0;34m(\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[1;32m 597\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 598\u001b[0;31m \u001b[0mresults\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mschedule\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdsk\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkeys\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\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 599\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mrepack\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mzip\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresults\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpostcomputes\u001b[0m\u001b[0;34m)\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[1;32m 600\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/client.py\u001b[0m in \u001b[0;36mget\u001b[0;34m(self, dsk, keys, workers, allow_other_workers, resources, sync, asynchronous, direct, retries, priority, fifo_timeout, actors, **kwargs)\u001b[0m\n\u001b[1;32m 2999\u001b[0m \u001b[0mshould_rejoin\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3000\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3001\u001b[0;31m \u001b[0mresults\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgather\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpacked\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0masynchronous\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0masynchronous\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdirect\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdirect\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 3002\u001b[0m \u001b[0;32mfinally\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3003\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mf\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mfutures\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[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/client.py\u001b[0m in \u001b[0;36mgather\u001b[0;34m(self, futures, errors, direct, asynchronous)\u001b[0m\n\u001b[1;32m 2173\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[1;32m 2174\u001b[0m \u001b[0mlocal_worker\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2175\u001b[0;31m return self.sync(\n\u001b[0m\u001b[1;32m 2176\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_gather\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2177\u001b[0m \u001b[0mfutures\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/utils.py\u001b[0m in \u001b[0;36msync\u001b[0;34m(self, func, asynchronous, callback_timeout, *args, **kwargs)\u001b[0m\n\u001b[1;32m 336\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mfuture\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 337\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--> 338\u001b[0;31m return sync(\n\u001b[0m\u001b[1;32m 339\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloop\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcallback_timeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcallback_timeout\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 340\u001b[0m )\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/utils.py\u001b[0m in \u001b[0;36msync\u001b[0;34m(loop, func, callback_timeout, *args, **kwargs)\u001b[0m\n\u001b[1;32m 403\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0merror\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 404\u001b[0m \u001b[0mtyp\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtb\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0merror\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 405\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mexc\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwith_traceback\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtb\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 406\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[1;32m 407\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/utils.py\u001b[0m in \u001b[0;36mf\u001b[0;34m()\u001b[0m\n\u001b[1;32m 376\u001b[0m \u001b[0mfuture\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0masyncio\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwait_for\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfuture\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcallback_timeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 377\u001b[0m \u001b[0mfuture\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0masyncio\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mensure_future\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfuture\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 378\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32myield\u001b[0m \u001b[0mfuture\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 379\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 380\u001b[0m \u001b[0merror\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msys\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexc_info\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~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/tornado/gen.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 760\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 761\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 762\u001b[0;31m \u001b[0mvalue\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfuture\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mresult\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 763\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 764\u001b[0m \u001b[0mexc_info\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msys\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexc_info\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~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/client.py\u001b[0m in \u001b[0;36m_gather\u001b[0;34m(self, futures, errors, direct, local_worker)\u001b[0m\n\u001b[1;32m 2065\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[1;32m 2066\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_gather_future\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfuture\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2067\u001b[0;31m \u001b[0mresponse\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0mfuture\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2068\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2069\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mresponse\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"status\"\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m\"error\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/client.py\u001b[0m in \u001b[0;36m_gather_remote\u001b[0;34m(self, direct, local_worker)\u001b[0m\n\u001b[1;32m 2116\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2117\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# ask scheduler to gather data for us\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2118\u001b[0;31m \u001b[0mresponse\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0mretry_operation\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mscheduler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgather\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkeys\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mkeys\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 2119\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2120\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresponse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/utils_comm.py\u001b[0m in \u001b[0;36mretry_operation\u001b[0;34m(coro, operation, *args, **kwargs)\u001b[0m\n\u001b[1;32m 381\u001b[0m \u001b[0mdask\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"distributed.comm.retry.delay.max\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdefault\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"s\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 382\u001b[0m )\n\u001b[0;32m--> 383\u001b[0;31m return await retry(\n\u001b[0m\u001b[1;32m 384\u001b[0m \u001b[0mpartial\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcoro\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\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[1;32m 385\u001b[0m \u001b[0mcount\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mretry_count\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/utils_comm.py\u001b[0m in \u001b[0;36mretry\u001b[0;34m(coro, count, delay_min, delay_max, jitter_fraction, retry_on_exceptions, operation)\u001b[0m\n\u001b[1;32m 366\u001b[0m \u001b[0mdelay\u001b[0m \u001b[0;34m*=\u001b[0m \u001b[0;36m1\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mjitter_fraction\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 367\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0masyncio\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdelay\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 368\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0mcoro\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 369\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 370\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/core.py\u001b[0m in \u001b[0;36msend_recv_from_rpc\u001b[0;34m(**kwargs)\u001b[0m\n\u001b[1;32m 1151\u001b[0m \u001b[0mprev_name\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcomm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcomm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"ConnectionPool.\"\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1152\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1153\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0msend_recv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcomm\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcomm\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mop\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\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 1154\u001b[0m \u001b[0;32mfinally\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1155\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpool\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreuse\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0maddr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcomm\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/core.py\u001b[0m in \u001b[0;36msend_recv\u001b[0;34m(comm, reply, serializers, deserializers, **kwargs)\u001b[0m\n\u001b[1;32m 916\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0mcomm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwrite\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmsg\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mserializers\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mserializers\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mon_error\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"raise\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 917\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mreply\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 918\u001b[0;31m \u001b[0mresponse\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0mcomm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdeserializers\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdeserializers\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 919\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[1;32m 920\u001b[0m \u001b[0mresponse\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/comm/tcp.py\u001b[0m in \u001b[0;36mread\u001b[0;34m(self, deserializers)\u001b[0m\n\u001b[1;32m 250\u001b[0m \u001b[0mframes\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0munpack_frames\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mframes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 251\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 252\u001b[0;31m msg = await from_frames(\n\u001b[0m\u001b[1;32m 253\u001b[0m \u001b[0mframes\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 254\u001b[0m \u001b[0mdeserialize\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdeserialize\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/comm/utils.py\u001b[0m in \u001b[0;36mfrom_frames\u001b[0;34m(frames, deserialize, deserializers, allow_offload)\u001b[0m\n\u001b[1;32m 98\u001b[0m \u001b[0mres\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0moffload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_from_frames\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 99\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--> 100\u001b[0;31m \u001b[0mres\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_from_frames\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 101\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 102\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mres\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/comm/utils.py\u001b[0m in \u001b[0;36m_from_frames\u001b[0;34m()\u001b[0m\n\u001b[1;32m 81\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_from_frames\u001b[0m\u001b[0;34m(\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[1;32m 82\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 83\u001b[0;31m return protocol.loads(\n\u001b[0m\u001b[1;32m 84\u001b[0m \u001b[0mframes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdeserialize\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdeserialize\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdeserializers\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdeserializers\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 85\u001b[0m )\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/core.py\u001b[0m in \u001b[0;36mloads\u001b[0;34m(frames, deserialize, deserializers)\u001b[0m\n\u001b[1;32m 156\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mmsgpack_decode_default\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 157\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 158\u001b[0;31m return msgpack.loads(\n\u001b[0m\u001b[1;32m 159\u001b[0m \u001b[0mframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mobject_hook\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0m_decode_default\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0muse_list\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mmsgpack_opts\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 160\u001b[0m )\n", + "\u001b[0;32mmsgpack/_unpacker.pyx\u001b[0m in \u001b[0;36mmsgpack._cmsgpack.unpackb\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/core.py\u001b[0m in \u001b[0;36m_decode_default\u001b[0;34m(obj)\u001b[0m\n\u001b[1;32m 136\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m\"compression\"\u001b[0m \u001b[0;32min\u001b[0m \u001b[0msub_header\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 137\u001b[0m \u001b[0msub_frames\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdecompress\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msub_header\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msub_frames\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 138\u001b[0;31m return merge_and_deserialize(\n\u001b[0m\u001b[1;32m 139\u001b[0m \u001b[0msub_header\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msub_frames\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdeserializers\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdeserializers\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 140\u001b[0m )\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\u001b[0m in \u001b[0;36mmerge_and_deserialize\u001b[0;34m(header, frames, deserializers)\u001b[0m\n\u001b[1;32m 495\u001b[0m \u001b[0mmerged_frames\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmerged\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 496\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 497\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mdeserialize\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mheader\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmerged_frames\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdeserializers\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdeserializers\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 498\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 499\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\u001b[0m in \u001b[0;36mdeserialize\u001b[0;34m(header, frames, deserializers)\u001b[0m\n\u001b[1;32m 408\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0m_header\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_length\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mzip\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mheaders\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlengths\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[1;32m 409\u001b[0m lst.append(\n\u001b[0;32m--> 410\u001b[0;31m deserialize(\n\u001b[0m\u001b[1;32m 411\u001b[0m \u001b[0m_header\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 412\u001b[0m \u001b[0mframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstart\u001b[0m \u001b[0;34m:\u001b[0m \u001b[0mstart\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0m_length\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~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\u001b[0m in \u001b[0;36mdeserialize\u001b[0;34m(header, frames, deserializers)\u001b[0m\n\u001b[1;32m 424\u001b[0m )\n\u001b[1;32m 425\u001b[0m \u001b[0mdumps\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mloads\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mwants_context\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfamilies\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 426\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mloads\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mheader\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mframes\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 427\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 428\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\u001b[0m in \u001b[0;36mserialization_error_loads\u001b[0;34m(header, frames)\u001b[0m\n\u001b[1;32m 178\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mserialization_error_loads\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mheader\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mframes\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[1;32m 179\u001b[0m \u001b[0mmsg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"\\n\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mcodecs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdecode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mframe\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"utf8\"\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mframe\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mframes\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--> 180\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmsg\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 181\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 182\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mTypeError\u001b[0m: Could not serialize object of type list\nTraceback (most recent call last):\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/pickle.py\", line 46, in dumps\n result = pickle.dumps(x, **dump_kwargs)\nRecursionError: maximum recursion depth exceeded while calling a Python object\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/cloudpickle/cloudpickle_fast.py\", line 602, in dump\n return Pickler.dump(self, obj)\nRecursionError: maximum recursion depth exceeded\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\", line 347, in serialize\n header, frames = dumps(x, context=context) if wants_context else dumps(x)\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/serialize.py\", line 71, in pickle_dumps\n frames[0] = pickle.dumps(\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/distributed/protocol/pickle.py\", line 58, in dumps\n result = cloudpickle.dumps(x, **dump_kwargs)\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/cloudpickle/cloudpickle_fast.py\", line 73, in dumps\n cp.dump(obj)\n File \"/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/cloudpickle/cloudpickle_fast.py\", line 609, in dump\n raise pickle.PicklingError(msg) from e\n_pickle.PicklingError: Could not pickle object as excessively deep recursion required.\n" + ] + } + ], + "source": [ + "# def load(container, start=0, end=-1, \n", + "# step=1, pureAtomNum=1, cutShell=None, \n", + "# excludedResnames=None,\n", + "# water='WAT', verbose=False, thread=4):\n", + "# \"\"\"\n", + "# Warning!!!\n", + "\n", + "# This requires a lot of memory to run with very little performance gain.\n", + "\n", + "# This is a initialization function to collect information from a MDanalysis universe into a data container for analysis using POSEIDON.\n", + "\n", + "# Parameters\n", + "# ----------\n", + "# container : MDAnalyse.Universe\n", + "# A Universe object will all topology, dihedrals,coordinates and force information Check ``Example/create_new_universe.py`` on how to create a universe from existing data.\n", + "# start : int or None, Optional, default: 0\n", + "# Frame id to start analysis.\n", + "# end : int or None, Optional, default: -1\n", + "# Frame id to end analysis.\n", + "# step : int, Optional, default: 1\n", + "# Steps between frame.\n", + "# pureAtomNum : int, Optional, default: 1\n", + "# Reference molecule resid for pure liquid.\n", + "# cutShell : float or None, Optional, default: 1\n", + "# Explicit cut off shell. Default to None which uses the relative angular distance (RAD) algorithm. See Jonathan Higham and Richard H. Henchman , \"Locally adaptive method to define coordination shell\", J. Chem. Phys. 145, 084108 (2016)\n", + "# excludedResnames : list of str or None, Optional, default: None\n", + "# List of resnames to exclude from nearest non alike analysis.\n", + "# water : list of str, Optional, default: \"WAT\"\n", + "# Resname for water molecules.\n", + "# verbose : bool, Optional, default: False\n", + "# Print out progress of each step.\n", + "# thread : int, Optional, default: 4\n", + "# How many multiprocess thread to spawn\n", + "\n", + "# \"\"\"\n", + "container=u\n", + "start=0\n", + "end=5\n", + "step=1\n", + "pureAtomNum=1\n", + "cutShell=None\n", + "excludedResnames=None,\n", + "water='WAT'\n", + "verbose=True\n", + "thread=4\n", + "startTime = datetime.now()\n", + "print(startTime)\n", + "verbosePrint = print if verbose else lambda *a, **k: None\n", + "\n", + "waterTuple = ('SOL', 'WAT', 'HOH', 'TIP3') #needed for pdb as top file \n", + "if water != 'WAT':\n", + " waterTuple = (water)\n", + "\n", + "iterations = 0\n", + "\n", + "all_data = []\n", + "\n", + "populateTopology(container, all_data, waterTuple)\n", + "verbosePrint('TOPOLOGY')\n", + "verbosePrint(datetime.now() - startTime)\n", + "sys.stdout.flush()\n", + "\n", + "\n", + "resids = Counter([(i.resname) for i in all_data])\n", + "verbosePrint(resids.keys())\n", + "if len(resids.keys()) == 1:\n", + " verbosePrint('Pure system with reference ID: %s' % (pureAtomNum))\n", + "\n", + "if excludedResnames != None:\n", + " verbosePrint('EXCLUDED RESNAMES: %s' % (excludedResnames))\n", + "\n", + "\n", + "dimensions = None\n", + "allMoleculeList = []\n", + "\n", + "#fix end frame\n", + "if end == -1:\n", + " end = len(container.trajectory)\n", + "sys.setrecursionlimit(3000000)\n", + "job_list = []\n", + "for frame in range(int(start), int(end), int(step)):\n", + " job_list.append(dask.delayed(frame_iteration)(\n", + " container, \n", + " all_data, \n", + " dimensions, \n", + " startTime, \n", + " verbosePrint, \n", + " waterTuple, \n", + " cutShell, \n", + " excludedResnames,\n", + " frame))\n", + " \n", + "print(\"prepare to execute\")\n", + "data = dask.compute(job_list, scheduler=\"distributed\")\n", + "\n", + "print(\"Done Threading Work\")\n", + "#print(data)\n", + "# data = []\n", + "# for frame in range(int(start), int(end), int(step)):\n", + "# data.append(fi_partial(frame))\n", + "\n", + "print(len(data))\n", + "for item in data[0]:\n", + " allMoleculeList = moleculeObjectPopulation(item[0], \n", + " allMoleculeList, item[1], item[2])\n", + "# #writing file here \n", + "# with gzip.GzipFile('moleculeListAll.obj', 'wb') as pickleFile:\n", + "# pickle.dump((allMoleculeList), pickleFile, protocol=2)\n", + "# pickleFile.close()\n", + "\n", + "print(datetime.now() - startTime)\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "e59703af-e98f-4770-be93-4566b7b7f4d2", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2022-07-28 18:06:33.882125\n", + "\n", + "solvent: ['WAT', 'wat', 'SOL', 'H2O', 'h2o', 'WAT_O', 'TIP3']\n", + "\n", + "water: ['WAT', 'wat', 'SOL', 'H2O', 'h2o', 'WAT_O', 'TIP3']\n", + "\n", + "1. Populate Dictionaries\n", + "\n", + "memory use: 1.929 GB\n", + "0:00:00.000914\n", + "memory use: 1.929 GB\n", + "0:00:01.406618\n", + "0:00:01.407275\n", + "memory use: 1.929 GB\n", + "\n", + "Total number of frames: 20.0\n", + "Number of atoms in each frame: 916\n", + "Number of variables in each list: 19\n", + "\n", + "2. Process Dictionaries\n", + "['moleculeLevel']\n", + "---level: moleculeLevel\n", + "\n", + "\n", + "0:00:01.600541\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/CodeEntropy/poseidon/analysis/EECalculation.py:859: RuntimeWarning: invalid value encountered in double_scalars\n", + " w = w ** 0.5\n" + ] + }, + { + "data": { + "text/plain": [ + "{'moleculeLevel': {'solventData': nearest assigned shell_num variable value count\n", + " 0 ACE WAT 1.0 Sor_test2 4.489916 155\n", + " 1 ACE WAT 1.0 Strans 140.062995 155\n", + " 2 ACE WAT 1.0 Srot 113.115592 155\n", + " 3 ACE WAT 1.0 count 7.75 155\n", + " 4 ARG WAT 1.0 Sor_test2 4.389286 358\n", + " 5 ARG WAT 1.0 Strans 139.597899 358\n", + " 6 ARG WAT 1.0 Srot 113.456453 358\n", + " 7 ARG WAT 1.0 count 17.9 358\n", + " 8 NME WAT 1.0 Sor_test2 2.782703 117\n", + " 9 NME WAT 1.0 Strans 139.409094 117\n", + " 10 NME WAT 1.0 Srot 112.39722 117\n", + " 11 NME WAT 1.0 count 5.85 117,\n", + " 'soluteData': resName variable value count\n", + " 0 ACE WM_Strans 123.289652 20\n", + " 1 ACE WM_Srot 102.152818 20\n", + " 2 ACE WM_UA_Strans 76.734475 20\n", + " 3 ACE WM_UA_Srot 106.684997 20\n", + " 4 ARG WM_Strans 130.232761 20\n", + " 5 ARG WM_Srot 99.15884 20\n", + " 6 ARG WM_UA_Strans 923.724725 20\n", + " 7 ARG WM_UA_Srot NaN 20\n", + " 8 ARG conf_AE 18.358527 20\n", + " 9 NME WM_Strans 120.852381 20\n", + " 10 NME WM_Srot 66.745401 20\n", + " 11 NME WM_UA_Strans 0.0 20\n", + " 12 NME WM_UA_Srot 202.251284 20}}" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def run_analysis(allMoleculeList, \n", + " temperature=298.0, \n", + " entropyEnergy=True, \n", + " level_list=['moleculeLevel'], \n", + " solvent=None, water='WAT',\n", + " verbose=False, weighting=None, \n", + " forceUnits='kJ'):\n", + " \"\"\"Perform analysis using poseidon\n", + "\n", + " Parameters\n", + " -----------\n", + " temperature : float, Optional, default: 298.0\n", + " Temperature for system.\n", + " entropyEnergy : Bool, Optional, default: True\n", + " Run entropy and energy analysis.\n", + " level_list : list of str, Optional, default: ['moleculeLevel']\n", + " Choose and refine the level of analyiss: moleculeLevel, residLevel_resname, atomLevel, soluteContacts.\n", + " solvent : str, Optional, default: None\n", + " Resname for solvent.\n", + " water : str or list of str, Optional, default: 'WAT'\n", + " Resname for water.\n", + " verbose : bool, Optional, default: False\n", + " Print out progress of each step.\n", + " weighting : str or None, Optional, default: None\n", + " Get weighing for each frame if the simulation is biased.\n", + " forceUnits : str, Optional, default: 'kJ'\n", + " Units of forces, kJ or Kcal. \n", + "\n", + " Returns\n", + " ---------\n", + " Tuple of DataFrame, for each level analysed:\n", + " solventData: dataframe that contains the result for solvent\n", + " soluteData: dataframe that contains the result for solute\n", + " contactMatrix: dataframe that contains the contact matrix\n", + " \"\"\"\n", + "\n", + " verbosePrint = print if verbose else lambda *a, **k: None\n", + " startTime = datetime.now()\n", + " print(startTime)\n", + "\n", + "\n", + "\n", + " waterTuple = ['WAT', 'wat', 'SOL', 'H2O', 'h2o', 'WAT_O', 'TIP3']\n", + " if water != 'WAT':\n", + " waterTuple = [water]\n", + " if solvent == None: ##when solvent is NOT water\n", + " solvent = waterTuple\n", + "\n", + "\n", + "\n", + "\n", + " print('\\nsolvent: %s' % (solvent))\n", + " print('\\nwater: %s' % (waterTuple))\n", + " print('\\n1. Populate Dictionaries\\n')\n", + "\n", + " count = 1\n", + " totAtoms = 0\n", + " list_len = None\n", + " atom_nums = []\n", + " atom_count = 0\n", + " objectIteration = 0\n", + "\n", + " EEclass = None \n", + " EEclass_residLevel_resname = None\n", + " EEclass_soluteContacts = None\n", + " EEclass_atomLevel = None\n", + "\n", + "\n", + " class_str_list = ['EEclass', 'EEclass_residLevel_resname', \n", + " 'EEclass_soluteContacts', 'EEclass_atomLevel', \n", + " 'totAtoms', 'atom_nums', 'atom_count', 'objectIteration']\n", + "\n", + " memoryInfo(verbosePrint)\n", + " print(datetime.now() - startTime)\n", + " sys.stdout.flush()\n", + " if totAtoms != 0:\n", + " count = 2\n", + "\n", + " weighting_info = None\n", + " atomList = allMoleculeList\n", + " list_len = len(atomList[0])\n", + " totAtoms += len(atomList)\n", + " if count == 1:\n", + " for i in atomList:\n", + " atom_num = i[2]\n", + " if atom_num not in atom_nums:\n", + " atom_nums.append(atom_num)\n", + " else:\n", + " break\n", + " if weighting != None:\n", + " weighting_info = weightingPopulation(weighting)\n", + "\n", + " EEclass, EEclass_residLevel_resname, \\\n", + " EEclass_soluteContacts, EEclass_atomLevel, \\\n", + " atom_count = \\\n", + " classPopulation(\n", + " atomList, entropyEnergy, \n", + " level_list, count, \n", + " atom_count, len(atom_nums), \n", + " waterTuple, temperature, \n", + " solvent, EEclass, \n", + " EEclass_residLevel_resname, EEclass_soluteContacts, \n", + " EEclass_atomLevel, \n", + " weighting_info, verbosePrint)\n", + " count += 1 #needed for class initiation\n", + " gc.enable()\n", + " memoryInfo(verbosePrint)\n", + " print(datetime.now() - startTime)\n", + " sys.stdout.flush()\n", + "\n", + "\n", + " print(datetime.now() - startTime)\n", + " memoryInfo(verbosePrint)\n", + " sys.stdout.flush()\n", + "\n", + "\n", + " try:\n", + " totFrames = float(totAtoms) / float(len(atom_nums))\n", + " print('\\nTotal number of frames: %s' % (totFrames))\n", + " print('Number of atoms in each frame: %s' % (len(atom_nums)))\n", + " print('Number of variables in each list: %s' % (list_len))\n", + " num_frames = totFrames\n", + " except ZeroDivisionError:\n", + " logging.error('No frames to analyse, please chose correct '\\\n", + " 'path to .obj files')\n", + " num_frames = None\n", + " sys.exit()\n", + "\n", + " ###once all the classes have been populated, calculate properties\n", + " #and output to files\n", + "\n", + " print('\\n2. Process Dictionaries')\n", + " result_list = dict()\n", + " print(level_list)\n", + " for level in level_list:\n", + "\n", + " print('---level:', level)\n", + " EEclass2, DSclass2 = None, None\n", + "\n", + " if level in [None, 'moleculeLevel']:\n", + " EEclass2 = EEclass\n", + " if level in ['residLevel_resname']:\n", + " EEclass2 = EEclass_residLevel_resname\n", + " if level in ['soluteContacts']:\n", + " EEclass2 = EEclass_soluteContacts\n", + " if level in ['atomLevel']:\n", + " EEclass2 = EEclass_atomLevel\n", + "\n", + "\n", + " if entropyEnergy:\n", + " name = 'EE'\n", + " result = processEE(num_frames, totFrames, EEclass2, \n", + " solvent, waterTuple, \n", + " temperature, level, name, forceUnits, verbosePrint)\n", + " result_list[level] = result\n", + " # #'''\n", + " # ##Save each class as an object so that we can continue populating\n", + " # #in stages.\n", + " # if len(paths) != 0:\n", + " # objectIteration += 1\n", + " # if pathClasses:\n", + " # print('\\n3. Save Dictionaries')\n", + " # for Aclass in class_str_list:\n", + " # with gzip.GzipFile('%s.obj' % (Aclass), 'wb') as pickleFile:\n", + " # pickle.dump((locals()[Aclass]), pickleFile, protocol=2)\n", + " # pickleFile.close()\n", + " # #locals()[Aclass] = None\n", + " # print('Number of objectIteration cycles saved: %s' % \n", + " # (objectIteration))\n", + " # print('Total atoms processed: %s' % (totAtoms))\n", + "\n", + " # #'''\n", + "\n", + "\n", + " sys.stdout.flush()\n", + " print('\\n')\n", + " print(datetime.now() - startTime)\n", + " return result_list\n", + "\n", + "run_analysis(allMoleculeList)" + ] + }, + { + "cell_type": "markdown", + "id": "289d84e8-c4f5-48d2-8c91-6c9d7243a351", + "metadata": {}, + "source": [ + "2. Load data into POSEIDON object" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "b6a0fd0c-2bb1-4c90-a90b-b094a976ee3b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2022-07-28 18:07:05.426259\n", + "frame = 0\n", + "< Timestep 0 with unit cell dimensions [30.67833 30.40052 29.490604 90. 90. 90. ] >\n", + "0:00:02.403687\n", + "frame = 1\n", + "< Timestep 1 with unit cell dimensions [30.682182 30.404337 29.494312 90. 90. 90. ] >\n", + "0:00:04.069732\n", + "frame = 2\n", + "< Timestep 2 with unit cell dimensions [30.713255 30.435127 29.524178 90. 90. 90. ] >\n", + "0:00:05.803433\n", + "frame = 3\n", + "< Timestep 3 with unit cell dimensions [30.598316 30.321232 29.41369 90. 90. 90. ] >\n", + "0:00:07.367259\n", + "frame = 4\n", + "< Timestep 4 with unit cell dimensions [30.618622 30.341354 29.43321 90. 90. 90. ] >\n", + "0:00:08.980108\n", + "frame = 5\n", + "< Timestep 5 with unit cell dimensions [30.619095 30.341824 29.433666 90. 90. 90. ] >\n", + "0:00:10.749856\n", + "frame = 6\n", + "< Timestep 6 with unit cell dimensions [30.738136 30.459784 29.5481 90. 90. 90. ] >\n", + "0:00:12.403620\n", + "frame = 7\n", + "< Timestep 7 with unit cell dimensions [30.694881 30.416918 29.506514 90. 90. 90. ] >\n", + "0:00:14.742970\n", + "frame = 8\n", + "< Timestep 8 with unit cell dimensions [30.644718 30.36721 29.458292 90. 90. 90. ] >\n", + "0:00:16.458944\n", + "frame = 9\n", + "< Timestep 9 with unit cell dimensions [30.726116 30.447872 29.536541 90. 90. 90. ] >\n", + "0:00:18.211993\n", + "frame = 10\n", + "< Timestep 10 with unit cell dimensions [30.580582 30.303658 29.39664 90. 90. 90. ] >\n", + "0:00:19.819312\n", + "frame = 11\n", + "< Timestep 11 with unit cell dimensions [30.772951 30.494282 29.581562 90. 90. 90. ] >\n", + "0:00:21.489616\n", + "frame = 12\n", + "< Timestep 12 with unit cell dimensions [30.772266 30.493605 29.580906 90. 90. 90. ] >\n", + "0:00:23.093535\n", + "frame = 13\n", + "< Timestep 13 with unit cell dimensions [30.58512 30.308151 29.401005 90. 90. 90. ] >\n", + "0:00:24.708540\n", + "frame = 14\n", + "< Timestep 14 with unit cell dimensions [30.599762 30.322662 29.415077 90. 90. 90. ] >\n", + "0:00:26.441673\n", + "frame = 15\n", + "< Timestep 15 with unit cell dimensions [30.746477 30.468048 29.556114 90. 90. 90. ] >\n", + "0:00:28.087924\n", + "frame = 16\n", + "< Timestep 16 with unit cell dimensions [30.764982 30.486385 29.573902 90. 90. 90. ] >\n", + "0:00:29.980376\n", + "frame = 17\n", + "< Timestep 17 with unit cell dimensions [30.672724 30.394962 29.485216 90. 90. 90. ] >\n", + "0:00:31.753867\n", + "frame = 18\n", + "< Timestep 18 with unit cell dimensions [30.674246 30.396471 29.48668 90. 90. 90. ] >\n", + "0:00:34.179204\n", + "frame = 19\n", + "< Timestep 19 with unit cell dimensions [30.699165 30.421165 29.510633 90. 90. 90. ] >\n", + "0:00:36.197494\n", + "0:00:36.198390\n", + "0:00:36.205887\n" + ] + } + ], + "source": [ + "from CodeEntropy.ClassCollection.PoseidonClass import Poseidon\n", + "startTime = datetime.now()\n", + "poseidon_object = Poseidon(container=u, start=0, end=20)\n", + "print(datetime.now() - startTime)" + ] + }, + { + "cell_type": "markdown", + "id": "5fd37e4e-1fc5-4a30-84b3-863f19cbb0b6", + "metadata": { + "tags": [] + }, + "source": [ + "## Calculate Entropy" + ] + }, + { + "cell_type": "markdown", + "id": "41cc97b9-e89d-431c-9991-00a39f69f2a2", + "metadata": { + "tags": [] + }, + "source": [ + "### Whole Molecule level" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "f5f77c6b-2b32-4321-9fab-f597f6371ac4", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2022-07-28 18:08:43.031855\n", + "\n", + "solvent: ['WAT', 'wat', 'SOL', 'H2O', 'h2o', 'WAT_O', 'TIP3']\n", + "\n", + "water: ['WAT', 'wat', 'SOL', 'H2O', 'h2o', 'WAT_O', 'TIP3']\n", + "\n", + "1. Populate Dictionaries\n", + "\n", + "memory use: 1.929 GB\n", + "0:00:00.001169\n", + "memory use: 1.929 GB\n", + "0:00:01.406683\n", + "0:00:01.407889\n", + "memory use: 1.929 GB\n", + "\n", + "Total number of frames: 20.0\n", + "Number of atoms in each frame: 916\n", + "Number of variables in each list: 19\n", + "\n", + "2. Process Dictionaries\n", + "['moleculeLevel']\n", + "---level: moleculeLevel\n", + "\n", + "\n", + "0:00:01.603452\n", + "{'moleculeLevel': {'solventData': nearest assigned shell_num variable value count\n", + "0 ACE WAT 1.0 Sor_test2 4.489916 155\n", + "1 ACE WAT 1.0 Strans 47.114194 155\n", + "2 ACE WAT 1.0 Srot 21.518819 155\n", + "3 ACE WAT 1.0 count 7.75 155\n", + "4 ARG WAT 1.0 Sor_test2 4.389286 358\n", + "5 ARG WAT 1.0 Strans 46.659296 358\n", + "6 ARG WAT 1.0 Srot 21.813924 358\n", + "7 ARG WAT 1.0 count 17.9 358\n", + "8 NME WAT 1.0 Sor_test2 2.782703 117\n", + "9 NME WAT 1.0 Strans 46.479766 117\n", + "10 NME WAT 1.0 Srot 20.958346 117\n", + "11 NME WAT 1.0 count 5.85 117, 'soluteData': resName variable value count\n", + "0 ACE WM_Strans 31.20938 20\n", + "1 ACE WM_Srot 18.233384 20\n", + "2 ACE WM_UA_Strans 1.450273 20\n", + "3 ACE WM_UA_Srot 17.25675 20\n", + "4 ARG WM_Strans 37.553747 20\n", + "5 ARG WM_Srot 10.55119 20\n", + "6 ARG WM_UA_Strans 203.095275 20\n", + "7 ARG WM_UA_Srot NaN 20\n", + "8 ARG conf_AE 18.358527 20\n", + "9 NME WM_Strans 28.852401 20\n", + "10 NME WM_Srot 0.387749 20\n", + "11 NME WM_UA_Strans 0.0 20\n", + "12 NME WM_UA_Srot 27.433272 20}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/CodeEntropy/poseidon/analysis/EECalculation.py:859: RuntimeWarning: invalid value encountered in double_scalars\n", + " w = w ** 0.5\n" + ] + } + ], + "source": [ + "result_wm = poseidon_object.run_analysis(level_list = ['moleculeLevel'], verbose=False, forceUnits=\"Kcal\") # this is because the forces value supplied in this trajectory is in Kcal\n", + "print(result_wm)" + ] + }, + { + "cell_type": "markdown", + "id": "6899945c-edb3-408c-a0ae-4035895b50e9", + "metadata": {}, + "source": [ + "### Residue Level" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "2a32bbeb-0033-4958-84d6-cf05266b486d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2022-06-30 14:03:08.891780\n", + "\n", + "solvent: ['WAT', 'wat', 'SOL', 'H2O', 'h2o', 'WAT_O', 'TIP3']\n", + "\n", + "water: ['WAT', 'wat', 'SOL', 'H2O', 'h2o', 'WAT_O', 'TIP3']\n", + "\n", + "1. Populate Dictionaries\n", + "\n", + "memory use: 0.232 GB\n", + "0:00:00.001426\n", + "memory use: 0.232 GB\n", + "0:00:01.297753\n", + "0:00:01.298211\n", + "memory use: 0.232 GB\n", + "\n", + "Total number of frames: 20.0\n", + "Number of atoms in each frame: 916\n", + "Number of variables in each list: 19\n", + "\n", + "2. Process Dictionaries\n", + "['residLevel_resname']\n", + "---level: residLevel_resname\n", + "\n", + "\n", + "0:00:01.458315\n", + "{'residLevel_resname': {'solventData': nearest assigned shell_num variable value count\n", + "0 ACE_1 WAT 1.0 Sor_test2 4.489916 155\n", + "1 ACE_1 WAT 1.0 Strans 47.114194 155\n", + "2 ACE_1 WAT 1.0 Srot 21.518819 155\n", + "3 ACE_1 WAT 1.0 count 7.75 155\n", + "4 ARG_2 WAT 1.0 Sor_test2 4.389286 358\n", + "5 ARG_2 WAT 1.0 Strans 46.659296 358\n", + "6 ARG_2 WAT 1.0 Srot 21.813924 358\n", + "7 ARG_2 WAT 1.0 count 17.9 358\n", + "8 NME_3 WAT 1.0 Sor_test2 2.782703 117\n", + "9 NME_3 WAT 1.0 Strans 46.479766 117\n", + "10 NME_3 WAT 1.0 Srot 20.958346 117\n", + "11 NME_3 WAT 1.0 count 5.85 117, 'soluteData': resName variable value count\n", + "0 ACE_1 WM_Strans 31.20938 20\n", + "1 ACE_1 WM_Srot 18.233384 20\n", + "2 ACE_1 WM_UA_Strans 1.450273 20\n", + "3 ACE_1 WM_UA_Srot 17.25675 20\n", + "4 ARG_2 WM_Strans 37.553747 20\n", + "5 ARG_2 WM_Srot 10.55119 20\n", + "6 ARG_2 WM_UA_Strans 203.095275 20\n", + "7 ARG_2 WM_UA_Srot NaN 20\n", + "8 ARG_2 conf_AE 18.358527 20\n", + "9 NME_3 WM_Strans 28.852401 20\n", + "10 NME_3 WM_Srot 0.387749 20\n", + "11 NME_3 WM_UA_Strans 0.0 20\n", + "12 NME_3 WM_UA_Srot 27.433272 20, 'contactMatrix': centre_resid neighbour_resid count centre_resname neighbour_resname\n", + "0 1 2 3.0 ACE_1 ARG\n", + "1 1 3 0.1 ACE_1 NME\n", + "2 2 1 3.0 ARG_2 ACE\n", + "3 2 3 3.0 ARG_2 NME\n", + "4 3 1 0.1 NME_3 ACE\n", + "5 3 2 3.0 NME_3 ARG}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/CodeEntropy/poseidon/analysis/EECalculation.py:859: RuntimeWarning: invalid value encountered in double_scalars\n", + " w = w ** 0.5\n" + ] + } + ], + "source": [ + "result_res = poseidon_object.run_analysis(level_list = ['residLevel_resname'], verbose=False, forceUnits=\"Kcal\") # this is because the forces value supplied in this trajectory is in Kcal\n", + "print(result_res)" + ] + }, + { + "cell_type": "markdown", + "id": "81e7011e-3dc9-4115-932f-0bbad538ae0a", + "metadata": {}, + "source": [ + "### United Atom Level" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "33ebd4aa-d117-4812-b7e8-1faed30c88e0", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2022-06-30 14:03:13.104061\n", + "\n", + "solvent: ['WAT', 'wat', 'SOL', 'H2O', 'h2o', 'WAT_O', 'TIP3']\n", + "\n", + "water: ['WAT', 'wat', 'SOL', 'H2O', 'h2o', 'WAT_O', 'TIP3']\n", + "\n", + "1. Populate Dictionaries\n", + "\n", + "memory use: 0.232 GB\n", + "0:00:00.002788\n", + "memory use: 0.233 GB\n", + "0:00:01.388482\n", + "0:00:01.388816\n", + "memory use: 0.233 GB\n", + "\n", + "Total number of frames: 20.0\n", + "Number of atoms in each frame: 916\n", + "Number of variables in each list: 19\n", + "\n", + "2. Process Dictionaries\n", + "['atomLevel']\n", + "---level: atomLevel\n", + "\n", + "\n", + "0:00:01.590813\n", + "{'atomLevel': {'solventData': nearest assigned shell_num variable value count\n", + "0 ACE_C WAT_O 1.0 Sor_test2 3.859492 90\n", + "1 ACE_C WAT_O 1.0 Strans 46.89642 90\n", + "2 ACE_C WAT_O 1.0 Srot 21.477797 90\n", + "3 ACE_C WAT_O 1.0 count 4.5 90\n", + "4 ACE_O WAT_O 1.0 Sor_test2 1.383652 65\n", + "5 ACE_O WAT_O 1.0 Strans 47.442017 65\n", + "6 ACE_O WAT_O 1.0 Srot 21.607751 65\n", + "7 ACE_O WAT_O 1.0 count 3.25 65\n", + "8 ARG_C WAT_O 1.0 Sor_test2 2.209787 94\n", + "9 ARG_C WAT_O 1.0 Strans 44.950488 94\n", + "10 ARG_C WAT_O 1.0 Srot 22.805753 94\n", + "11 ARG_C WAT_O 1.0 count 4.7 94\n", + "12 ARG_N WAT_O 1.0 Sor_test2 4.32251 213\n", + "13 ARG_N WAT_O 1.0 Strans 47.054251 213\n", + "14 ARG_N WAT_O 1.0 Srot 21.210664 213\n", + "15 ARG_N WAT_O 1.0 count 10.65 213\n", + "16 ARG_O WAT_O 1.0 Sor_test2 0.658554 51\n", + "17 ARG_O WAT_O 1.0 Strans 49.519626 51\n", + "18 ARG_O WAT_O 1.0 Srot 23.221778 51\n", + "19 ARG_O WAT_O 1.0 count 2.55 51\n", + "20 NME_C WAT_O 1.0 Sor_test2 2.876769 92\n", + "21 NME_C WAT_O 1.0 Strans 46.592128 92\n", + "22 NME_C WAT_O 1.0 Srot 20.791071 92\n", + "23 NME_C WAT_O 1.0 count 4.6 92\n", + "24 NME_N WAT_O 1.0 Sor_test2 0.3607 25\n", + "25 NME_N WAT_O 1.0 Strans 46.337027 25\n", + "26 NME_N WAT_O 1.0 Srot 21.698027 25\n", + "27 NME_N WAT_O 1.0 count 1.25 25, 'soluteData': resName variable value count\n", + "0 ACE_C WM_Strans 31.20938 20\n", + "1 ACE_C WM_Srot 18.233384 20\n", + "2 ACE_C WM_UA_Strans 1.450273 20\n", + "3 ACE_C WM_UA_Srot 17.25675 20\n", + "4 ARG_N WM_Strans 37.553747 20\n", + "5 ARG_N WM_Srot 10.55119 20\n", + "6 ARG_N WM_UA_Strans 203.095275 20\n", + "7 ARG_N WM_UA_Srot NaN 20\n", + "8 ARG_N conf_AE 18.358527 20\n", + "9 NME_N WM_Strans 28.852401 20\n", + "10 NME_N WM_Srot 0.387749 20\n", + "11 NME_N WM_UA_Strans 0.0 20\n", + "12 NME_N WM_UA_Srot 27.433272 20, 'contactMatrix': centre_resid neighbour_resid count centre_resname neighbour_resname \\\n", + "0 1 2 1.0 ACE ARG \n", + "1 2 3 1.0 ARG NME \n", + "2 2 1 1.0 ARG ACE \n", + "3 2 3 1.0 ARG NME \n", + "4 1 2 1.0 ACE ARG \n", + "5 3 2 1.0 NME ARG \n", + "6 2 1 1.0 ARG ACE \n", + "7 2 1 1.0 ARG ACE \n", + "8 3 2 1.0 NME ARG \n", + "9 3 1 0.1 NME ACE \n", + "10 3 2 1.0 NME ARG \n", + "11 1 2 1.0 ACE ARG \n", + "12 1 3 0.1 ACE NME \n", + "13 2 3 1.0 ARG NME \n", + "\n", + " centre_atom neighbour_atom \n", + "0 C CA \n", + "1 C CH3 \n", + "2 CA C \n", + "3 CA N \n", + "4 CH3 N \n", + "5 CH3 C \n", + "6 N CH3 \n", + "7 N O \n", + "8 N CA \n", + "9 N O \n", + "10 N O \n", + "11 O N \n", + "12 O N \n", + "13 O N }}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/donald/miniconda3/envs/CEtrial/lib/python3.10/site-packages/CodeEntropy/poseidon/analysis/EECalculation.py:859: RuntimeWarning: invalid value encountered in double_scalars\n", + " w = w ** 0.5\n" + ] + } + ], + "source": [ + "result_ua = poseidon_object.run_analysis(level_list = ['atomLevel'], verbose=False, forceUnits=\"Kcal\") # this is because the forces value supplied in this trajectory is in Kcal\n", + "print(result_ua)" + ] + }, + { + "cell_type": "markdown", + "id": "0137f3df-31d8-49d6-abab-6bce5f1d2ca3", + "metadata": {}, + "source": [ + "### Solute Contact" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "27ca66f2-04c2-4471-9fa7-23b6d392c26b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2022-06-30 14:03:19.556689\n", + "\n", + "solvent: ['WAT', 'wat', 'SOL', 'H2O', 'h2o', 'WAT_O', 'TIP3']\n", + "\n", + "water: ['WAT', 'wat', 'SOL', 'H2O', 'h2o', 'WAT_O', 'TIP3']\n", + "\n", + "1. Populate Dictionaries\n", + "\n", + "memory use: 0.233 GB\n", + "0:00:00.001247\n", + "memory use: 0.233 GB\n", + "0:00:00.091347\n", + "0:00:00.091990\n", + "memory use: 0.233 GB\n", + "\n", + "Total number of frames: 20.0\n", + "Number of atoms in each frame: 916\n", + "Number of variables in each list: 19\n", + "\n", + "2. Process Dictionaries\n", + "['soluteContacts']\n", + "---level: soluteContacts\n", + "\n", + "\n", + "0:00:00.190073\n", + "{'soluteContacts': {'solventData': nearest assigned shell_num variable value count\n", + "0 ACE_1_ACE_1 WAT 1.0 Sor_test2 0.747622 19\n", + "1 ACE_1_ACE_1 WAT 1.0 Strans 54.849501 19\n", + "2 ACE_1_ACE_1 WAT 1.0 Srot 21.83436 19\n", + "3 ACE_1_ACE_1 WAT 1.0 count 0.95 19\n", + "4 ACE_1_ARG_2 WAT 1.0 Sor_test2 0.129079 26\n", + "5 ACE_1_ARG_2 WAT 1.0 Strans 53.464565 26\n", + "6 ACE_1_ARG_2 WAT 1.0 Srot 21.481491 26\n", + "7 ACE_1_ARG_2 WAT 1.0 count 1.3 26\n", + "8 ACE_1_NME_3 WAT 1.0 Sor_test2 0.029043 16\n", + "9 ACE_1_NME_3 WAT 1.0 Strans 49.229698 16\n", + "10 ACE_1_NME_3 WAT 1.0 Srot 26.038399 16\n", + "11 ACE_1_NME_3 WAT 1.0 count 0.8 16\n", + "12 ARG_2_ACE_1 WAT 1.0 Sor_test2 0.129079 26\n", + "13 ARG_2_ACE_1 WAT 1.0 Strans 53.464565 26\n", + "14 ARG_2_ACE_1 WAT 1.0 Srot 21.481491 26\n", + "15 ARG_2_ACE_1 WAT 1.0 count 1.3 26\n", + "16 ARG_2_ARG_2 WAT 1.0 Sor_test2 0.424278 104\n", + "17 ARG_2_ARG_2 WAT 1.0 Strans 47.596492 104\n", + "18 ARG_2_ARG_2 WAT 1.0 Srot 23.318138 104\n", + "19 ARG_2_ARG_2 WAT 1.0 count 5.2 104\n", + "20 ARG_2_NME_3 WAT 1.0 Sor_test2 0.733499 35\n", + "21 ARG_2_NME_3 WAT 1.0 Strans 49.012885 35\n", + "22 ARG_2_NME_3 WAT 1.0 Srot 20.595806 35\n", + "23 ARG_2_NME_3 WAT 1.0 count 1.75 35\n", + "24 NME_3_ACE_1 WAT 1.0 Sor_test2 0.029043 16\n", + "25 NME_3_ACE_1 WAT 1.0 Strans 49.229698 16\n", + "26 NME_3_ACE_1 WAT 1.0 Srot 26.038399 16\n", + "27 NME_3_ACE_1 WAT 1.0 count 0.8 16\n", + "28 NME_3_ARG_2 WAT 1.0 Sor_test2 0.733499 35\n", + "29 NME_3_ARG_2 WAT 1.0 Strans 49.012885 35\n", + "30 NME_3_ARG_2 WAT 1.0 Srot 20.595806 35\n", + "31 NME_3_ARG_2 WAT 1.0 count 1.75 35\n", + "32 NME_3_NME_3 WAT 1.0 Sor_test2 0.015884 13\n", + "33 NME_3_NME_3 WAT 1.0 Strans 48.028634 13\n", + "34 NME_3_NME_3 WAT 1.0 Srot 22.175048 13\n", + "35 NME_3_NME_3 WAT 1.0 count 0.65 13, 'soluteData': Empty DataFrame\n", + "Columns: [resName, variable, value, count]\n", + "Index: []}}\n" + ] + } + ], + "source": [ + "result_solcon = poseidon_object.run_analysis(level_list = ['soluteContacts'], verbose=False, forceUnits=\"Kcal\") # this is because the forces value supplied in this trajectory is in Kcal\n", + "print(result_solcon)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8bbbbf65-8e67-4a06-9e92-2d515e31567d", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "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.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Example/Poseidon_GROMACS.py b/Example/Poseidon_GROMACS.py index d2a1b3b..55fdec5 100644 --- a/Example/Poseidon_GROMACS.py +++ b/Example/Poseidon_GROMACS.py @@ -7,18 +7,18 @@ from MDAnalysis.analysis.base import AnalysisFromFunction from MDAnalysis.coordinates.memory import MemoryReader import pandas as pd -from CodeEntropy.ClassCollection.PoseidonClass import Poseidon, Poseidon_mp +from CodeEntropy.ClassCollection.PoseidonClass import Poseidon, Poseidon_mp, Poseidon_dask def main(): #hard coded for now wd = os.path.dirname(os.path.abspath(__file__)) # loading files - topo_file = os.path.join(wd,"data/1AKI_prod_60.tpr") - traj_file = os.path.join(wd,"data/1AKI_prod_60.trr") + topo_file = os.path.join(wd,"data/poseidon_example.prmtop") + traj_file = os.path.join(wd,"data/poseidon_example.trr") # loading data into individual universe main = mda.Universe(topo_file, traj_file) - poseidon_object = Poseidon(container=main, start=0, end=10, water=('SOL',), excludedResnames=("CL",), verbose=False) + poseidon_object = Poseidon_dask(container=main, start=0, end=10, verbose=True) poseidon_object.run_analysis(level_list=['moleculeLevel', 'residLevel_resname', 'atomLevel', 'soluteContacts'], verbose=False) if __name__ == '__main__': diff --git a/MANIFEST.in b/MANIFEST.in index aaeee58..d71277c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,4 +4,6 @@ include CODE_OF_CONDUCT.md include versioneer.py graft CodeEntropy -global-exclude *.py[cod] __pycache__ *.so \ No newline at end of file +global-exclude *.py[cod] __pycache__ *.so + +prune CodeEntropy/tests/* \ No newline at end of file diff --git a/README.md b/README.md index c0b1cf6..e146e28 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,7 @@ CodeEntropy ============================== -!!! This repo is now moved to [CCPBioSim/CodeEntropy](https://github.com/CCPBioSim/CodeEntropy). Please check there for the latest version. - - - [//]: # (Badges) -[![GitHub Actions Build Status](https://github.com/DonaldChung-HK/CodeEntropy/workflows/CI/badge.svg)](https://github.com/DonaldChung-HK/CodeEntropy/actions?query=workflow%3ACI) -[![codecov](https://codecov.io/gh/DonaldChung-HK/CodeEntropy/branch/main/graph/badge.svg)](https://codecov.io/gh/DonaldChung-HK/CodeEntropy/branch/main) +[![GitHub Actions Build Status](https://github.com/CCPBioSim/CodeEntropy/workflows/CI/badge.svg)](https://github.com/CCPBioSim/CodeEntropy/actions?query=workflow%3ACI) CodeEntropy tool with POSEIDON code integrated to form a complete and generally applicable set of tools for calculating entropy @@ -21,9 +16,14 @@ See [CodeEntropy’s documentation](https://codeentropy.readthedocs.io/en/latest ### Install via ``` -pip install . +pip install CodeEntropy ``` +### Input +For supported format (AMBER NETCDF and GROMACS TRR) you will need to output the **coordinates** and **forces** to the **same file**. + +See [Format overview — MDAnalysis User Guide documentation](https://userguide.mdanalysis.org/stable/formats/index.html) + ### Command-line tool A quick and easy way to get started is to use the command-line tool which you can run in bash by simply typing `CodeEntropyPoseidon` (Note: this doesn't work on Windows!!!) #### For help @@ -33,11 +33,11 @@ CodeEntropyPoseidon -h #### Arguments | Arguments | Description | Default | type| | ------------- | ------------- |----------- |--------------| -| `-f`, `--top_traj_file` | Path to Structure/topology file (AMBER PRMTOP or GROMACS TPR) followed by Trajectory file(s) | Requires either `--top_traj_file` or `--pickle` | list of `str` | +| `-f`, `--top_traj_file` | Path to Structure/topology file (AMBER PRMTOP or GROMACS TPR) followed by Trajectory file(s) (AMBER NETCDF or GROMACS TRR). You will need to output the **coordinates** and **forces** to the **same file** | Require at least 2 file: a topology and a trajectory file | list of `str` | | `-l`, `--selectString` | Selection string for CodeEntropy such as protein or resid, refer to `MDAnalysis.select_atoms` for more information. | `"all"`: select all atom in trajectory for CodeEntropy analysis for trajectory without solvent | `str` | | `-b`, `--begin` | Start analysing the trajectory from this frame index. | `0`: From begining | `int` | | `-e`, `--end` | Stop analysing the trajectory at this frame index | `-1`: end of trajectory | `int` | -| `-d`, `--step` | Stop analysing the trajectory at this frame index | `1` | `int` | +| `-d`, `--step` | Steps between frame | `1` | `int` | | `-k`, `--tempra` | Temperature for entropy calculation (K) | `298.0` | `float` | | `-t`, `--thread` | How many multiprocess to use. | `1`: for single core execution | `int` | | `-o`, `--out` | Name of the file where the text format output will be written. | `outfile.out` | `str` | @@ -54,15 +54,16 @@ CodeEntropyPoseidon -h | `--wm` | Do entropy calculation at whole molecule level (The whole molecule is treated as one single bead.). | Flag, activate when included | Flag | | `--res` | Do entropy calculation at residue level (A residue as a whole represents a bead.). | Flag, activate when included | Flag | | `--uatom` | Do entropy calculation at united atom level (A heavy atom and its covalently bonded H-atoms for an united atom and represent a bead.). | Flag, activate when included | Flag | -| `--topog` | Compute the topographical entropy using | `0`: no topographical analysis | `int` | +| `--topog` | Compute the topographical entropy using | `0`: no topographical analysis | `int` | | `--solwm` | Do water entropy calculation at residue level (The whole molecule is treated as one single bead.). | Flag, activate when included | Flag | | `--solres` | Do water entropy calculation at residue level (A residue as a whole represents a bead. | Flag, activate when included | Flag | | `--soluatom` | Do solution entropy calculation at united atom level (A heavy atom and its covalently bonded H-atoms for an united atom and represent a bead.). | Flag, activate when included | Flag | | `--solContact` | Do solute contact calculation. | Flag, activate when included | Flag | #### Example +You need to clone this repository to download example trajectories. ``` # example 1 DNA -CodeEntropyPoseidon -f "Example/data/md_A4_dna.tpr" "Example/data/md_A4_dna_xf.trr" -a "C5'" "C4'" "C3'" -l "all" -t 8 --wm --res --uatom --topog 5 +CodeEntropyPoseidon -f "Example/data/md_A4_dna.tpr" "Example/data/md_A4_dna_xf.trr" -a "C5'" "C4'" "C3'" -l "all" -t 8 --wm --res --uatom --topog 3 # example 2 lysozyme in water CodeEntropyPoseidon -f "Example/data/1AKI_prod_60.tpr" "Example/data/1AKI_prod_60.trr" -l "protein" -b 1 -e 30 -d 2 --wm --res --uatom --topog 1 --solwm --solres --soluatom --solContact @@ -78,29 +79,9 @@ The program assumes the following default unit | mass | u | | force | kJ/(mol·Å) | -## Script Examples -See `Example` folder -You can add your own trajectories by editing the path in the python script to point to your own trajectories -### `create_new_universe.py` -This repo uses MDAnalysis to parse values and it can only parse force natively for GROMACS TRR and AMBER NETCDF. This scripts shows you how to create a new universe from unsuppported data so that you can use trajectories created from other simulation software or reduce the size of universe to focus on a section of simulation. -### `CodeEntropy_non_topo.py` -Calculate entropy of target trajectory non topographical level with a no water lysozyme trajectory -### `CodeEntropy_topo.py` -Calculate entropy of target trajectory based on different method with a no water lysozyme trajectory -### `Poseidon_GROMACS` -Run POSEIDON analysis for a GROMACS trajectories with a lysozyme in water -### `Poseidon_LAMMPS` -A LAMMPS example for POSEIDON this is a capped amino acid example (note the force unit of this trajectory is based on KCal not KJ) -### `mcc_mdanalysis` -A DNA example for CodeEntropy without using function to show the inner working of CodeEntropy -### `mcc_mdanalysis_multiprocess` -mcc_mdanalysis with multiprocess parallelization -### `CodeEntropy_DNA.py` -the DNA strand example but with updated generalized CodeEntropy functions - ## Copyright -Copyright (c) 2022, DonaldChung-HK +Copyright (c) 2022, DonaldChung-HK, CCPBioSim ## Acknowledgements diff --git a/docs/Run_as_script.rst b/docs/Run_as_script.rst index 4ac5ce4..0f6c92a 100644 --- a/docs/Run_as_script.rst +++ b/docs/Run_as_script.rst @@ -2,6 +2,8 @@ Run As Script ================= CodeEntropy can also be run as a script for more advanced operations. +.. _load-custom: + 1. Loading data ------------------- First you should load the data into an MDanalysis universe. For this code, MDanalysis must be able to read dihedral and force directly from the trajectory files diff --git a/docs/api.rst b/docs/api.rst index 6f07203..9e5ebd8 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -69,6 +69,7 @@ Import Data :toctree: autosummary CodeEntropy.ClassCollection.PoseidonClass.Poseidon + CodeEntropy.ClassCollection.PoseidonClass.Poseidon_mp Run Analysis ^^^^^^^^^^^^^^^^ @@ -76,4 +77,5 @@ Run Analysis .. autosummary:: :toctree: autosummary - CodeEntropy.ClassCollection.PoseidonClass.Poseidon.run_analysis \ No newline at end of file + CodeEntropy.ClassCollection.PoseidonClass.Poseidon.run_analysis + CodeEntropy.ClassCollection.PoseidonClass.Poseidon_mp.run_analysis \ No newline at end of file diff --git a/docs/autosummary/CodeEntropy.ClassCollection.PoseidonClass.Poseidon_mp.rst b/docs/autosummary/CodeEntropy.ClassCollection.PoseidonClass.Poseidon_mp.rst new file mode 100644 index 0000000..741df18 --- /dev/null +++ b/docs/autosummary/CodeEntropy.ClassCollection.PoseidonClass.Poseidon_mp.rst @@ -0,0 +1,23 @@ +CodeEntropy.ClassCollection.PoseidonClass.Poseidon\_mp +====================================================== + +.. currentmodule:: CodeEntropy.ClassCollection.PoseidonClass + +.. autoclass:: Poseidon_mp + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Poseidon_mp.__init__ + ~Poseidon_mp.run_analysis + + + + + + \ No newline at end of file diff --git a/docs/autosummary/CodeEntropy.ClassCollection.PoseidonClass.Poseidon_mp.run_analysis.rst b/docs/autosummary/CodeEntropy.ClassCollection.PoseidonClass.Poseidon_mp.run_analysis.rst new file mode 100644 index 0000000..f396829 --- /dev/null +++ b/docs/autosummary/CodeEntropy.ClassCollection.PoseidonClass.Poseidon_mp.run_analysis.rst @@ -0,0 +1,6 @@ +CodeEntropy.ClassCollection.PoseidonClass.Poseidon\_mp.run\_analysis +==================================================================== + +.. currentmodule:: CodeEntropy.ClassCollection.PoseidonClass + +.. automethod:: Poseidon_mp.run_analysis \ No newline at end of file diff --git a/docs/community_guide.rst b/docs/community_guide.rst new file mode 100644 index 0000000..b527d13 --- /dev/null +++ b/docs/community_guide.rst @@ -0,0 +1,14 @@ +Community guidelines +============================== + +Contribute to the software +----------------------------- +To contribute to CodeEntropy, fork the repository and create a pull request when you want to share and push your changes upstream. + +Report Issue +----------------- +Create an issue ticket on GitHub and the team will review it as soon as possible. Please send us the input file as well. + +Seek support +---------------- +Post on GitHub discussion and the team will reply as soon as possible. \ No newline at end of file diff --git a/docs/developer_guide.rst b/docs/developer_guide.rst new file mode 100644 index 0000000..c83cab0 --- /dev/null +++ b/docs/developer_guide.rst @@ -0,0 +1,25 @@ +Developer's Guide +============================== + +CodeEntropy uses the Python programming language. + +Running tests +----------------------------- +To run the full test suite, simply install ``pytest`` and run in root directory of the repository: + +.. code-block:: bash + + pytest + +To only run the unit tests in a particular part of program. For example only running test for solute part. + +.. code-block:: bash + + pytest CodeEntropy/tests/test_CodeEntropy.py + + +To only run the a specific test. e.g. + +.. code-block:: bash + + pytest CodeEntropy/tests/test_CodeEntropy.py::test_CodeEntropy_parser_labForces \ No newline at end of file diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 5b31681..40320f3 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -3,7 +3,8 @@ Getting Started Requirements ---------------- -* Python >3.9 + +* Python > 3.9 * gcc * g++ @@ -13,7 +14,13 @@ Run the following at the root directory of this repository .. code-block:: bash - pip install . + pip install CodeEntropy + +Input +---------- +For supported format (AMBER NETCDF and GROMACS TRR) you will need to output the **coordinates** and **forces** to the **same file**. + +For unsupported format see :ref:`load-custom` for ideas on how to load custom data into MDanalysis universe and convert to supported format. Units ------------ @@ -54,10 +61,6 @@ For help Arguments ^^^^^^^^^^^^^ -.. Warning:: - - Method 3 and 4 for topographical analysis is still in development!!! - .. list-table:: Arguments :widths: 20 30 10 10 :class: tight-table @@ -68,7 +71,7 @@ Arguments - Default - Type * - ``-f``, ``--top_traj_file`` - - Path to Structure/topology file(``AMBER PRMTOP``, ``GROMACS TPR`` or topology file with MDAnalysis readable dihedral information (not officially supported)) followed by Trajectory file(s) (``GROMAC TRR`` or ``AMBER NETCDF``) + - Path to Structure/topology file(``AMBER PRMTOP``, ``GROMACS TPR`` or topology file with MDAnalysis readable dihedral information (not officially supported)) followed by Trajectory file(s) (``GROMAC TRR`` or ``AMBER NETCDF``) You will need to output the **coordinates** and **forces** to the **same file** . - Required - list of ``str`` * - ``-l``, ``--selectString`` @@ -155,7 +158,7 @@ Arguments - Compute the topographical entropy using : * 1 : pLogP method (will separate between backbone and side chain) * 2 : Corr. pLogP method (will separate between backbone and side chain) - * 5 : Corr. pLogP after adaptive enumeration of states + * 3 : Corr. pLogP after adaptive enumeration of states - ``0`` : no topographical analysis - ``int`` * - ``--solwm`` @@ -182,7 +185,7 @@ Example .. code-block:: bash # example 1 DNA - CodeEntropyPoseidon -f "Example/data/md_A4_dna.tpr" "Example/data/md_A4_dna_xf.trr" -a "C5'" "C4'" "C3'" -l "all" -t 8 --wm --res --uatom --topog 5 + CodeEntropyPoseidon -f "Example/data/md_A4_dna.tpr" "Example/data/md_A4_dna_xf.trr" -a "C5'" "C4'" "C3'" -l "all" -t 8 --wm --res --uatom --topog 3 # example 2 lysozyme in water - CodeEntropyPoseidon -f "Example/data/1AKI_prod_60.tpr" "Example/data/1AKI_prod_60.trr" -l "protein" -b 1 -e 30 -d 2 --wm --res --uatom --topog 1 --solwm --solres --soluatom --solContact \ No newline at end of file + CodeEntropyPoseidon -f "Example/data/1AKI_prod_60.tpr" "Example/data/1AKI_prod_60.trr" -l "protein" -b 1 -e 30 -d 2 --wm --res --uatom --topog 1 --solwm --solres --soluatom --solContact diff --git a/docs/index.rst b/docs/index.rst index 706fcb4..93fd45e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -19,6 +19,8 @@ This code is based on the CodeEntropy tool with POSEIDON code integrated to form Script_example api faq + community_guide + developer_guide diff --git a/paper/paper.bib b/paper/paper.bib new file mode 100644 index 0000000..4dc685b --- /dev/null +++ b/paper/paper.bib @@ -0,0 +1,35 @@ + @article{mda2, + title={MDAnalysis: A python package for the rapid analysis of molecular dynamics simulations}, + DOI={10.25080/majora-629e541a-00e}, + journal={Proceedings of the Python in Science Conference}, + author={Gowers, Richard and Linke, Max and Barnoud, Jonathan and Reddy, Tyler and Melo, Manuel and Seyler, Sean and Domański, Jan and Dotson, David and Buchoux, Sébastien and Kenney, Ian and Beckstein, Oliver}, + year={2016}} + + @article{mda1, + title={MDAnalysis: A toolkit for the analysis of molecular dynamics simulations}, + volume={32}, + DOI={10.1002/jcc.21787}, + number={10}, + journal={Journal of Computational Chemistry}, + author={Michaud-Agrawal, Naveen and Denning, Elizabeth J. and Woolf, Thomas B. and Beckstein, Oliver}, + year={2011}, + pages={2319–2327}} + + +@misc{argoRepo, + author = {Chakravorty, Arghya}, + title = {CodeEntropy}, + year = {2021}, + publisher = {GitHub}, + journal = {GitHub repository}, + url = {https://github.com/arghya90/CodeEntropy} +} + +@misc{jasRepo, + author = {Kalayan, Jas}, + title = {PoseidonBeta}, + year = {2021}, + publisher = {GitHub}, + journal = {GitHub repository}, + url = {https://github.com/jkalayan/PoseidonBeta} +} \ No newline at end of file diff --git a/paper/paper.jats b/paper/paper.jats new file mode 100644 index 0000000..34e1a48 --- /dev/null +++ b/paper/paper.jats @@ -0,0 +1,234 @@ + + +
+ + + + +Journal of Open Source Software +JOSS + +2475-9066 + +Open Journals + + + +0 +N/A + +CodeEntropy: A Python package for Multiscale Entropy and +Structure Quantification from Molecular Dynamics +Simulation + + + + +Chakravorty +Arghya + + + + + +Kalayan +Jas + + + + + +Chung +Donald + + + + + +University of Michigan, Ann Arbor, USA + + + + +University of Manchester, United Kingdom + + + + +Science and Technology Facilities Council, United +Kingdom + + + + +21 +7 +2022 + +¿VOL? +¿ISSUE? +¿PAGE? + +Authors of papers retain copyright and release the +work under a Creative Commons Attribution 4.0 International License (CC +BY 4.0) +2022 +The article authors + +Authors of papers retain copyright and release the work under +a Creative Commons Attribution 4.0 International License (CC BY +4.0) + + + +Python +entropy +molecular dynamics +molecular simulations + + + + + + Summary +

Entropy is a fundamental property of any system that quantifies the + structural flexibility of the system and together with energy governs + system stability. It is particularly important in biomolecular systems + because of their highly flexible and complex nature. Many properties + are a delicate balance of entropy versus energy, necessitating the + determination of entropy in order to understand stability. Moreover, + entropy provides a way to quantify the structural flexibility of a + system over all its degrees of freedom. + CodeEntropy is a code based on the Multiscale + Cell Correlation (MCC) method which is a novel solution to the + problems encountered by other methods by providing a single, scalable + and general framework applicable to all molecules in the system.

+

CodeEntropy is a code that calculates + entropy with Multiscale Cell Correlation (MCC) method based on + molecular simulation trajectories. The code is based on a combination + of CodeEntropy + (Chakravorty, + 2021) by Dr Arghya Chakravorty and + POSEIDON + (Kalayan, + 2021) by Jas Kalayan. The code written by Dr Chakravorty + accounts for the vibrational and conformational entropy in a + multiscale formulation using an Applications Programming Interface + that makes it highly customisable. To make + CodeEntropy fully applicable to biomolecular + systems, the POSEIDON code will calculate the + topographical entropy terms for solvents and mixtures. The + topology/trajectory parser, atom selector and distance calculation is + performed by the MDAnalysis + (Gowers + et al., 2016; + Michaud-Agrawal + et al., 2011) package.

+
+ + Statement of needs +

There are a range of existing methods to calculate entropy from + molecular dynamics simulations but they suffer from a number of + limitations: they may only work for particular kinds of system or + degrees of freedom, they may require additional calculations, they can + be difficult to interpret, or they do not scale well to large and + complex systems. Some methods only work for water, such as + Inhomogeneous Solvation Theory, for liquids such as 2-Phase + Thermodynamics, for only some degrees of freedom such as dihedral + binning, or for single molecules such as Quasiharmonic Analysis, + Normal Mode Analysis or non-parametric methods such as Minimal + Spanning Tree or K-Nearest-Neighbours.

+

Given the widespread use of free-energy calculations and molecular + dynamics simulations, there is a large user-community for software to + calculate entropy and quantify full structural flexibility of + biomolecular systems. Multiscale Cell Correlation (MCC) provides a + novel solution to the problems encountered by other methods by + providing a single, scalable and general framework applicable to all + molecules in the system. It utilises a judicial synthesis of + mean-field cell theory and covariance matrices over a range of length + scales: First, Correlations are considered between groups of locally + connected atoms as in a mean-field cell, and longer-range correlations + are accounted for using a coarser representation of the groups, a + framework that is scaled to higher length scales. Second, At each + length scale, the potential energy surface is discretised into energy + wells for translational and rotational motion. These are represented + as an average energy well and an energy-well distribution, denoted as + vibrational and topographical, respectively. Finally, The + decomposition over molecules, length scales, type of motion and + energy-well size and distribution provides an exquisite level of + detail in explaining the entropies obtained.

+

MCC has been applied by the group of RH to a wide range of systems, + namely liquids, aqueous and octanol solutions, host-guest complexes, + chemical reactions and large biomolecules such as proteins, DNA and + membrane bilayers in aqueous electrolytes.

+
+ + + + + + + GowersRichard + LinkeMax + BarnoudJonathan + ReddyTyler + MeloManuel + SeylerSean + DomańskiJan + DotsonDavid + BuchouxSébastien + KenneyIan + BecksteinOliver + + MDAnalysis: A python package for the rapid analysis of molecular dynamics simulations + Proceedings of the Python in Science Conference + 2016 + 10.25080/majora-629e541a-00e + + + + + + Michaud-AgrawalNaveen + DenningElizabeth J. + WoolfThomas B. + BecksteinOliver + + MDAnalysis: A toolkit for the analysis of molecular dynamics simulations + Journal of Computational Chemistry + 2011 + 32 + 10 + 10.1002/jcc.21787 + 2319 + 2327 + + + + + + ChakravortyArghya + + CodeEntropy + GitHub repository + GitHub + 2021 + https://github.com/arghya90/CodeEntropy + + + + + + KalayanJas + + PoseidonBeta + GitHub repository + GitHub + 2021 + https://github.com/jkalayan/PoseidonBeta + + + + +
diff --git a/paper/paper.md b/paper/paper.md new file mode 100644 index 0000000..94319b9 --- /dev/null +++ b/paper/paper.md @@ -0,0 +1,41 @@ +--- +title: 'CodeEntropy: A Python package for Multiscale Entropy and Structure Quantification from Molecular Dynamics Simulation' +tags: + - Python + - entropy + - molecular dynamics + - molecular simulations +authors: + - name: Arghya Chakravorty + equal-contrib: true + affiliation: 1 # (Multiple affiliations must be quoted) + - name: Jas Kalayan + equal-contrib: true # (This is how you can denote equal contributions between multiple authors) + affiliation: 2 + - name: Donald Chung + equal-contrib: true # (This is how you can denote equal contributions between multiple authors) + affiliation: 3 +affiliations: + - name: University of Michigan, Ann Arbor, USA + index: 1 + - name: University of Manchester, United Kingdom + index: 2 + - name: Science and Technology Facilities Council, United Kingdom + index: 3 +date: 21 July 2022 +bibliography: paper.bib +--- +# Summary + +Entropy is a fundamental property of any system that quantifies the structural flexibility of the system and together with energy governs system stability. It is particularly important in biomolecular systems because of their highly flexible and complex nature. Many properties are a delicate balance of entropy versus energy, necessitating the determination of entropy in order to understand stability. Moreover, entropy provides a way to quantify the structural flexibility of a system over all its degrees of freedom. ``CodeEntropy`` is a code based on the Multiscale Cell Correlation (MCC) method which is a novel solution to the problems encountered by other methods by providing a single, scalable and general framework applicable to all molecules in the system. + +``CodeEntropy`` is a code that calculates entropy with Multiscale Cell Correlation (MCC) method based on molecular simulation trajectories. The code is based on a combination of ``CodeEntropy`` [@argoRepo] by Dr Arghya Chakravorty and ``POSEIDON`` [@jasRepo] by Jas Kalayan. The code written by Dr Chakravorty accounts for the vibrational and conformational entropy in a multiscale formulation using an Applications Programming Interface that makes it highly customisable. To make ``CodeEntropy`` fully applicable to biomolecular systems, the ``POSEIDON`` code will calculate the topographical entropy terms for solvents and mixtures. The topology/trajectory parser, atom selector and distance calculation is performed by the ``MDAnalysis`` [@mda1; @mda2] package. + +# Statement of needs +There are a range of existing methods to calculate entropy from molecular dynamics simulations but they suffer from a number of limitations: they may only work for particular kinds of system or degrees of freedom, they may require additional calculations, they can be difficult to interpret, or they do not scale well to large and complex systems. Some methods only work for water, such as Inhomogeneous Solvation Theory, for liquids such as 2-Phase Thermodynamics, for only some degrees of freedom such as dihedral binning, or for single molecules such as Quasiharmonic Analysis, Normal Mode Analysis or non-parametric methods such as Minimal Spanning Tree or K-Nearest-Neighbours. + +Given the widespread use of free-energy calculations and molecular dynamics simulations, there is a large user-community for software to calculate entropy and quantify full structural flexibility of biomolecular systems. Multiscale Cell Correlation (MCC) provides a novel solution to the problems encountered by other methods by providing a single, scalable and general framework applicable to all molecules in the system. It utilises a judicial synthesis of mean-field cell theory and covariance matrices over a range of length scales: First, Correlations are considered between groups of locally connected atoms as in a mean-field cell, and longer-range correlations are accounted for using a coarser representation of the groups, a framework that is scaled to higher length scales. Second, At each length scale, the potential energy surface is discretised into energy wells for translational and rotational motion. These are represented as an average energy well and an energy-well distribution, denoted as vibrational and topographical, respectively. Finally, The decomposition over molecules, length scales, type of motion and energy-well size and distribution provides an exquisite level of detail in explaining the entropies obtained. + +MCC has been applied by the group of RH to a wide range of systems, namely liquids, aqueous and octanol solutions, host-guest complexes, chemical reactions and large biomolecules such as proteins, DNA and membrane bilayers in aqueous electrolytes. + +# References \ No newline at end of file diff --git a/scripts/CodeEntropyPoseidon b/scripts/CodeEntropyPoseidon index 6e452a4..ecb75d1 100755 --- a/scripts/CodeEntropyPoseidon +++ b/scripts/CodeEntropyPoseidon @@ -43,7 +43,7 @@ try: dest="filePath", action='store', nargs='+', - help="Path to Structure/topology file (AMBER PRMTOP, GROMACS TPR which contains topology and dihedral information) followed by Trajectory file(s) (AMBER NETCDF or GROMACS TRR). Required.") + help="Path to Structure/topology file (AMBER PRMTOP, GROMACS TPR which contains topology and dihedral information) followed by Trajectory file(s) (AMBER NETCDF or GROMACS TRR) you will need to output the coordinates and forces to the same file. Required.") parser.add_argument('-l', '--selectString', action='store', dest="selectionString", @@ -426,7 +426,7 @@ if topogEntropyMethod != 0: # results_df = pd.concat([results_df, newRow], ignore_index=True) # print(f"result_entropy4 = {result_entropy4}") - elif topogEntropyMethod == 5: + elif topogEntropyMethod == 3: result_entropyAEM = EF.compute_topographical_entropy_AEM( arg_hostDataContainer = dataContainer, arg_selector = "all", diff --git a/setup.cfg b/setup.cfg index 865d33c..4e6d5d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,6 +7,9 @@ omit = */tests/* # Omit generated versioneer CodeEntropy/_version.py + # Omit the Examples + */Example/* + Example/* [yapf] # YAPF, in .style.yapf files this shows up as "[style]" header diff --git a/setup.py b/setup.py index 18541ed..647aa68 100644 --- a/setup.py +++ b/setup.py @@ -22,8 +22,8 @@ setup( # Self-descriptive entries which should always be present name='CodeEntropy', - author='Arghya \"Argo\" Chakravorty, DonaldChung-HK', - author_email='arghyac@umich.edu, lpchungaa@gmail.com', + author='Arghya \"Argo\" Chakravorty, Jas Kalayan, DonaldChung-HK', + author_email='arghyac@umich.edu, jas.kalayan@manchester.ac.uk, donald.chung@stfc.ac.uk', description=short_description, long_description=long_description, long_description_content_type="text/markdown", @@ -56,19 +56,20 @@ # Manual control if final package is compressible or not, set False to prevent the .egg from being made # zip_safe=False, ## REQUIREMENTS ## - classifiers = ['Programming Language :: Python :: 3.9', - 'Intended Audience :: Users'], + classifiers = ['Programming Language :: Python :: 3', + 'Intended Audience :: Science/Research'], # can be run as a zip zip_safe = False, install_requires=[ - 'numpy', - 'bitarray', - 'mdanalysis', - 'pandas', - 'psutil', - 'dill' + 'numpy==1.22.3', + 'bitarray==2.5.0', + 'mdanalysis==2.1.0', + 'pandas==1.4.2', + 'psutil==5.9.0', + 'dill==0.3.5.1', + 'pathos==0.2.9', ], scripts=['scripts/CodeEntropyPoseidon']