-
Notifications
You must be signed in to change notification settings - Fork 1
/
readme.txt
563 lines (431 loc) · 25.9 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
#######################################################################################################################
##################################### This script was generated by MDPerTool v0.1 #####################################
#######################################################################################################################
import sys
import os
sys.path.append(r"C:\Users\law5_\anaconda3\envs\perto\Lib\site-packages\mdpertool")
from no_gui.get_positions_from_trajectory_file import *
from no_gui.energy_decomposition_from_trajectory import *
from no_gui.response_time_creator import *
from no_gui.Velocity_Changer import *
from no_gui.response_time_creator import *
from no_gui.apply_pdbfixer import fix_pdb
from no_gui.write_outputs import *
from no_gui.energy_component import *
from openmm import unit
from openmm import *
from openmm import app
from openmm.app import PME, NoCutoff, Ewald, CutoffPeriodic, CutoffNonPeriodic, HBonds, HAngles, AllBonds,DCDReporter, StateDataReporter
import openmm as mm
from openmm.unit import femtosecond, picosecond, nanometer, kelvin, angstrom, atmospheres, molar
from sys import stdout
import platform as pl
import time
import argparse
import multiprocessing as mp
from pathlib import Path, PureWindowsPath
from mdtraj import reporters
from mdtraj.reporters import XTCReporter
from src.logger import Logger
from datetime import datetime
from src.CustomReporters import Perturb_StateDataReporter
#######################################################################################################################
###################################### CLASSICAL MD PROCESS USING MDPerTool v0.1 ######################################
#######################################################################################################################
class Minimization_Reporter(openmm.MinimizationReporter):
energies = [] # array to record progress
logger_object = object
def __init__(self, logger_object, *args):
super().__init__(*args)
self.energies = [] # array to record progress
self.logger_object = logger_object
def report(self, iteration, x, grad, args):
# print current system energy to screen
self.logger_object.info("Iteration: {} - Energy (kJ/mole): {}".format(iteration, args['system energy']))
# save energy at each iteration to an array we can use later
#self.energies.append(args['system energy'])
# The report method must return a bool specifying if minimization should be stopped.
# You can use this functionality for early termination.
return False
# ---------------- LOGGER ---------------- #
current_date = datetime.now().strftime("%Y-%m-%d")
file_name = f"out_{current_date}.log"
log_path = os.path.join('C:/Users/law5_/Desktop/MDPerTool_GUI/Download', file_name)
log_obj = Logger(log_path)
"""
log_obj.critical("CRIC".format())
log_obj.error("ERR".format())
log_obj.warning("WARN".format())
log_obj.debug("debug".format())
log_obj.info("qwerty".format())
log_obj.info("asdfghjkl".format())
log_obj.info("zxcvbnm".format())
# closing file
log_obj.handlers.clear()
"""
# ---------------- LOGGER ---------------- #
simulation_last_time = 0
log_obj.info("pdb file fixing and preparing for simulation ...".format())
fixed_pdb_name = fix_pdb('C:/Users/law5_/Desktop/MDPerTool_GUI/Download/5dk3_fixed_ph7.4.pdb', fixed_pdb_out_path='C:/Users/law5_/Desktop/MDPerTool_GUI/Download', logger_object=log_obj)
log_obj.info("Loading pdb to simulation engine ...".format())
pdb = app.PDBFile(fixed_pdb_name)
box = pdb.topology.getUnitCellDimensions()
log_obj.info("Modeller of pdb file is preparing ...".format())
modeller = mm.app.Modeller(pdb.topology, pdb.positions)
modeller.topology.setUnitCellDimensions(box)
log_obj.info("Forcefield parameters loading to the simulation system ...".format())
forcefield = app.ForceField('amber03.xml', 'tip3p.xml')
log_obj.critical("Adding missing hydrogens to the model ...".format())
modeller.addHydrogens(forcefield)
log_obj.info("Adding solvent (both water and ions) to the model to fill a rectangular box ...".format())
modeller.addSolvent(forcefield, model='tip3p', padding=10*angstrom, ionicStrength=0.1*molar)
log_obj.info("Constructing an OpenMM System ...".format())
system = forcefield.createSystem(modeller.topology, nonbondedMethod=PME,
nonbondedCutoff=1.2*nanometer,
constraints=None, rigidWater=True,
ewaldErrorTolerance=0.005)
system.addForce(mm.MonteCarloBarostat(1 * atmospheres, 310.0*kelvin, 25))
nonbonded = [f for f in system.getForces() if isinstance(f, NonbondedForce)][0]
nonbonded.setUseSwitchingFunction(use=True)
nonbonded.setSwitchingDistance(1.0*nanometer)
nonbonded.setUseDispersionCorrection(True)
log_obj.info('Creating a %sIntegrator with %s %s . time step' %('Langevin', 2.0, 'femtosecond'))
integrator = mm.LangevinIntegrator(310.0*kelvin, 91.0/picosecond, 2.0*femtosecond)
if True == True:
platform = mm.Platform.getPlatformByName('CUDA')
properties = {'CudaPrecision': 'single'}
else:
platform = mm.Platform.getPlatformByName('CUDA')
properties = {'CUDAPrecision': 'single'}
simulation = app.Simulation(modeller.topology, system, integrator, platform, properties)
simulation.context.setPositions(modeller.positions)
simulation.context.computeVirtualSites()
log_obj.info('Minimizing for %s steps ...' % 500)
min_reporter = Minimization_Reporter(logger_object=log_obj)
simulation.minimizeEnergy(maxIterations=int(500), reporter=min_reporter)
log_obj.info("Minimization done, the energy is %s" % simulation.context.getState(getEnergy=True).getPotentialEnergy())
positions = simulation.context.getState(getPositions=True).getPositions()
log_obj.info("Minimized geometry is written to 'minimized.pdb'")
app.PDBFile.writeModel(modeller.topology, positions, open('C:/Users/law5_/Desktop/MDPerTool_GUI/Download/minimized.pdb', 'w'), keepIds=True)
simulation.context.setVelocitiesToTemperature(310.0*kelvin)
log_obj.info('Equilibrating for %s steps ...' % 500)
simulation.step(int(500))
simulation.currentStep = 0
simulation.context.setTime(0)
log_obj.info('The trajectories will be saved in DCD file format.')
simulation.reporters.append(DCDReporter('C:/Users/law5_/Desktop/MDPerTool_GUI/Download/output.dcd', 100))
log_obj.info("Saving DCD File for every 100 period")
log_obj.info("Saving XTC File for every 100 period")
log_obj.info("State Report will tell you.")
simulation.reporters.append(Perturb_StateDataReporter(stdout, 100, step=True, time=True,
potentialEnergy=True, kineticEnergy=True, totalEnergy=True,
temperature=True, progress=True, remainingTime=True, speed=True,
volume=True, density=True, totalSteps=1000,
report_type='Progress (%)'))
log_obj.info("Running Production...")
simulation.step(1000)
log_obj.info("Done!".format())
lastpositions = simulation.context.getState(getPositions=True).getPositions()
last_pdb = app.PDBFile.writeFile(modeller.topology, lastpositions, open('C:/Users/law5_/Desktop/MDPerTool_GUI/Download/last.pdb', 'w'), keepIds=True)
state = simulation.context.getState(getPositions=True, getVelocities=True)
with open('C:/Users/law5_/Desktop/MDPerTool_GUI/Download/system.xml', 'w') as f:
system_xml = mm.XmlSerializer.serialize(system)
f.write(system_xml)
with open('C:/Users/law5_/Desktop/MDPerTool_GUI/Download/integrator.xml', 'w') as f:
integrator_xml = mm.XmlSerializer.serialize(integrator)
f.write(integrator_xml)
with open('C:/Users/law5_/Desktop/MDPerTool_GUI/Download/state.xml', 'w') as f:
f.write(mm.XmlSerializer.serialize(state))
try:
for reporter in simulation.reporters[:]:
print("REPORTER: ", reporter)
simulation.reporters.remove(reporter)
except Exception as E:
print("EEEERRRORRRR: ", E)
#######################################################################################################################
#################################### PERTURBATION MD PROCESS USING MDPerTool v0.1 #####################################
#######################################################################################################################
# ## --> VARIABLES
simulation_last_step = 0
state_file_name = 'state.xml'
last_pdb = 'last.pdb'
dissipated_trajectory_name = 'energy_perturbation_trajectory'
undissipated_trajectory_name = 'without_energy_perturbation_trajectory'
reference_traj_file_for_pos = str
dissipation_traj_file_for_pos = str
OUTPUT_DIRECTORY = str
created_file_for_work = str
OUTPUT_FOLDER_NAME = str
OUTPUT_DIRECTORY = Path('C:/Users/law5_/Desktop/MDPerTool_GUI/Download')
last_pdb_file_path = os.path.join(OUTPUT_DIRECTORY, last_pdb)
modify_atoms = convert_res_to_atoms(last_pdb_file_path, ['GLN6'], 'CA')
state_file_path = os.path.join(OUTPUT_DIRECTORY, state_file_name)
for i in range(len([2])):
name_of_changed_state_xml = change_velocity(state_file_path, [2][i], modify_atoms)
new_dissipated_trajectory_name = dissipated_trajectory_name + str([2][i])
if True == False and False == False:
write_dcd_cond = True
if i == 0:
################################################################################################################
################################ REFERENCE MD PROCESS USING MDPerTool v0.1 #####################################
################################################################################################################
if 'CUDA' == 'OpenCL' and False == True:
properties = {'OpenCLPrecision': 'double', 'OpenCLDeviceIndex': '1'}
precision = 'double'
if 'CUDA' == 'OpenCL' and False == False:
properties = {'OpenCLPrecision': 'double'}
precision = 'double'
if 'CUDA' == 'CUDA' and False == True:
properties = {'CudaPrecision': 'double', 'CudaDeviceIndex': '1'}
precision = 'double'
if 'CUDA' == 'CUDA' and False == False:
properties = {'CudaPrecision': 'double'}
precision = 'double'
if 'CUDA' == 'CPU' and False == True:
log_obj.info("The CPU platform always uses 'mixed' precision.".format())
log_obj.info("Simulation process will use %s Thread(s)" % 2)
properties = {'CpuThreads': '2'}
precision = 'mixed'
if 'CUDA' == 'Reference':
log_obj.info("The Reference platform always uses 'double' precision.".format())
properties = None
precision= 'double'
# we'll just take the topology from here...
pdb = app.PDBFile(last_pdb_file_path)
topology = pdb.topology
log_obj.info("Forcefield parameters loading to the simulation system for NVE simulation ...".format())
forcefield = app.ForceField('amber03.xml', 'tip3p.xml')
log_obj.info("Constructing NVE System".format())
reference_system = forcefield.createSystem(topology, nonbondedMethod=app.PME, nonbondedCutoff=1.2*nanometer,
constraints=None, rigidWater=True, ewaldErrorTolerance=1e-5)
if True == True:
log_obj.info("System will use Switching Distance".format())
nonbonded = [f for f in reference_system.getForces() if isinstance(f, NonbondedForce)][0]
nonbonded.setUseSwitchingFunction(use=True)
nonbonded.setSwitchingDistance(1.0*nanometer)
integrator = VerletIntegrator(1.0*femtosecond)
integrator.setConstraintTolerance(1e-8)
# let's specify our simulation platform again
platform = mm.Platform.getPlatformByName('CUDA')
# ok now let's do some simulation using this restraint
if properties is None:
ref_simulation = app.Simulation(topology, reference_system, integrator, platform)
if properties is not None:
ref_simulation = app.Simulation(topology, reference_system, integrator, platform, properties)
ref_simulation.loadState(state_file_path)
final_state = ref_simulation.context.getState(getVelocities=True, getPositions=True)
positions = final_state.getPositions()
velocities = final_state.getVelocities()
ref_simulation.context.setPositions(positions)
ref_simulation.context.computeVirtualSites()
ref_simulation.context.setVelocities(velocities)
ref_simulation.currentStep = simulation_last_step
#ref_simulation.context.setTime(0)
"""
if pl.system() == 'Windows':
log_obj.info("Saving XTC File for every 1 period".format())
XTC_file_path = os.path.join(OUTPUT_DIRECTORY, '%s.xtc' % undissipated_trajectory_name)
ref_simulation.reporters.append(XTCReporter(XTC_file_path, 1))
"""
try:
if True == False and False == False:
log_obj.info("Saving DCD File for every 1 period".format())
DCD_file_path = os.path.join(OUTPUT_DIRECTORY, '%s.dcd' % undissipated_trajectory_name)
ref_simulation.reporters.append(app.DCDReporter(DCD_file_path, 1))
if True == True:
log_obj.info("Saving DCD File for every 1 period".format())
DCD_file_path = os.path.join(OUTPUT_DIRECTORY, '%s.dcd' % undissipated_trajectory_name)
ref_simulation.reporters.append(app.DCDReporter(DCD_file_path, 1))
if False == True:
log_obj.info("Saving XTC File for every 1 period".format())
XTC_file_path = os.path.join(OUTPUT_DIRECTORY, '%s.xtc' % undissipated_trajectory_name)
ref_simulation.reporters.append(XTCReporter(XTC_file_path, 1))
except Exception as e:
log_obj.error(e, stack_info=True, exc_info=True)
log_obj.info("State Report will tell you ...".format())
ref_simulation.reporters.append(Perturb_StateDataReporter(stdout, 1, step=True, time=True, potentialEnergy=True,
kineticEnergy=True, totalEnergy=True, temperature=True, progress=True, volume=True,
density=True, remainingTime=True, speed=True, totalSteps=1000,
report_type='Reference MD Progress (%)'))
ref_simulation.step(1000)
simulation_last_step = 0
try:
for reporter in ref_simulation.reporters[:]:
print("REPORTER: ", reporter)
ref_simulation.reporters.remove(reporter)
except Exception as E:
print("EEEERRRORRRR: ", E)
################################################################################################################
############################### DISSIPATION MD PROCESS USING MDPerTool v0.1 ####################################
################################################################################################################
if 'CUDA' == 'OpenCL' and False == True:
properties = {'OpenCLPrecision': 'double', 'OpenCLDeviceIndex': '1'}
precision = 'double'
if 'CUDA' == 'OpenCL' and False == False:
properties = {'OpenCLPrecision': 'double'}
precision = 'double'
if 'CUDA' == 'CUDA' and False == True:
properties = {'CudaPrecision': 'double', 'CudaDeviceIndex': '1'}
precision = 'double'
if 'CUDA' == 'CUDA' and False == False:
properties = {'CudaPrecision': 'double'}
precision = 'double'
if 'CUDA' == 'CPU' and False == True:
log_obj.info("The CPU platform always uses 'mixed' precision.".format())
log_obj.info("Simulation process will use %s Thread(s)" % 2)
properties = {'CpuThreads': '2'}
precision = 'mixed'
if 'CUDA' == 'Reference':
log_obj.info("The Reference platform always uses 'double' precision.")
properties = None
precision= 'double'
log_obj.info("System will use %s Platform with %s Precision" % ('CUDA', precision))
# we'll just take the topology from here...
pdb = app.PDBFile(last_pdb_file_path)
topology = pdb.topology
log_obj.info("Forcefield parameters loading to the simulation system ...".format())
forcefield = app.ForceField('amber03.xml', 'tip3p.xml')
log_obj.info("Constructing an OpenMM System".format())
perturbed_system = forcefield.createSystem(topology, nonbondedMethod=app.PME, nonbondedCutoff=1.2*nanometer,
constraints=None, rigidWater=True, ewaldErrorTolerance=1e-5)
if True == True:
log_obj.info("System will use Switching Distance".format())
nonbonded = [f for f in perturbed_system.getForces() if isinstance(f, NonbondedForce)][0]
nonbonded.setUseSwitchingFunction(use=True)
nonbonded.setSwitchingDistance(1.0*nanometer)
integrator = VerletIntegrator(1.0*femtosecond)
integrator.setConstraintTolerance(1e-8)
# let's specify our simulation platform again
platform = mm.Platform.getPlatformByName('CUDA')
# ok now let's do some simulation using this restraint
if properties is None:
dis_simulation = app.Simulation(topology, perturbed_system, integrator, platform)
if properties is not None:
dis_simulation = app.Simulation(topology, perturbed_system, integrator, platform, properties)
dis_simulation.loadState(name_of_changed_state_xml)
final_state = dis_simulation.context.getState(getVelocities=True, getPositions=True)
positions = final_state.getPositions()
velocities = final_state.getVelocities()
dis_simulation.context.setPositions(positions)
dis_simulation.context.computeVirtualSites()
dis_simulation.context.setVelocities(velocities)
log_obj.info("Will the perturbed system use periodic boundary conditions? --> %s" % perturbed_system.usesPeriodicBoundaryConditions())
dis_simulation.currentStep = 0
dis_simulation.context.setTime(0)
"""
if pl.system() == 'Windows':
log_obj.info("Saving XTC File for every 1 period")
XTC_file_path = os.path.join(OUTPUT_DIRECTORY, '%s.xtc' % new_dissipated_trajectory_name)
dis_simulation.reporters.append(XTCReporter(XTC_file_path, 1))
"""
try:
if True == False and False == False:
log_obj.info("Saving DCD File for every 1 period")
DCD_file_path = os.path.join(OUTPUT_DIRECTORY, '%s.dcd' % new_dissipated_trajectory_name)
dis_simulation.reporters.append(app.DCDReporter(DCD_file_path, 1))
if True == True:
log_obj.info("Saving DCD File for every 1 period")
DCD_file_path = os.path.join(OUTPUT_DIRECTORY, '%s.dcd' % new_dissipated_trajectory_name)
dis_simulation.reporters.append(app.DCDReporter(DCD_file_path, 1))
if False == True:
log_obj.info("Saving XTC File for every 1 period")
XTC_file_path = os.path.join(OUTPUT_DIRECTORY, '%s.xtc' % new_dissipated_trajectory_name)
dis_simulation.reporters.append(XTCReporter(XTC_file_path, 1))
except Exception as e:
log_obj.error(e, stack_info=True, exc_info=True)
log_obj.info("State Report will tell you ...")
dis_simulation.reporters.append(Perturb_StateDataReporter(stdout, 1, step=True, time=True, potentialEnergy=True,
kineticEnergy=True, totalEnergy=True, temperature=True, progress=True, volume=True,
density=True, remainingTime=True, speed=True, totalSteps=1000,
report_type='Dissipation MD Progress (%)'))
dis_simulation.step(1000)
simulation_last_step = 0
try:
for reporter in dis_simulation.reporters[:]:
print("REPORTER: ", reporter)
dis_simulation.reporters.remove(reporter)
except Exception as E:
print("EEEERRRORRRR: ", E)
del dis_simulation, ref_simulation
####################################################################################################################
############################### PER RESIDUE ENERGY CALCULATION USING MDPerTool v0.1 ################################
####################################################################################################################
"""
if pl.system() == 'Windows':
log_obj.info("Decompose started using XTC File ...".format())
reference_traj_file_for_pos = os.path.join(OUTPUT_DIRECTORY, undissipated_trajectory_name + '.xtc')
dissipation_traj_file_for_pos = os.path.join(OUTPUT_DIRECTORY, new_dissipated_trajectory_name + '.xtc')
"""
try:
if True == False and False == False:
log_obj.info("Decompose started using DCD File ...".format())
reference_traj_file_for_pos = os.path.join(OUTPUT_DIRECTORY, undissipated_trajectory_name + '.dcd').replace('\\','/')
dissipation_traj_file_for_pos = os.path.join(OUTPUT_DIRECTORY, new_dissipated_trajectory_name + '.dcd').replace('\\','/')
if True == True:
log_obj.info("Decompose started using DCD File ....".format())
reference_traj_file_for_pos = os.path.join(OUTPUT_DIRECTORY, undissipated_trajectory_name + '.dcd').replace('\\','/')
dissipation_traj_file_for_pos = os.path.join(OUTPUT_DIRECTORY, new_dissipated_trajectory_name + '.dcd').replace('\\','/')
print(reference_traj_file_for_pos)
print(dissipation_traj_file_for_pos)
print(last_pdb_file_path)
if False == True:
log_obj.info("Decompose started using XTC File ....".format())
reference_traj_file_for_pos = os.path.join(OUTPUT_DIRECTORY, undissipated_trajectory_name + '.xtc').replace('\\','/')
dissipation_traj_file_for_pos = os.path.join(OUTPUT_DIRECTORY, new_dissipated_trajectory_name + '.xtc').replace('\\','/')
except Exception as e:
print("ERROR: ", e)
log_obj.error(e, stack_info=True, exc_info=True)
try:
#if i == 0:
# position_list, unwrap_pdb = get_openmm_pos_from_traj_with_mdtraj(top=last_pdb_file_path,
# ref_traj=reference_traj_file_for_pos,
# modif_traj=dissipation_traj_file_for_pos,
# logger_object=log_obj)
#if i != 0:
# position_list, unwrap_pdb = get_openmm_pos_from_traj_with_mdtraj(top=last_pdb_file_path,
# ref_traj=None,
# modif_traj=dissipation_traj_file_for_pos,
# logger_object=log_obj)
# --> RESIDUE BASED DECOMPOSITION
if i == 0:
#residue_based_decomposition(topol=unwrap_pdb, trj_pos_list=position_list, start_res=0, stop_res=250,
# output_directory=OUTPUT_DIRECTORY, que=None, platform_name='CUDA',
# ref_energy_name='reference_energy_file.csv', device_id_active=False,
# num_of_threads=2,
# modif_energy_name='modified_energy_file_%s.csv' % int([2][i]),
# origin_last_pdb=last_pdb_file_path, ff='amber03.xml', logger_object=log_obj)
process_energy_data(topology_file=last_pdb_file_path, protein_ff='amber03.xml', water_ff='tip3p.xml',
modif_trajectory=dissipation_traj_file_for_pos, device_id_active=False,
ref_trajectory=reference_traj_file_for_pos, platform_type='CUDA',
nonbonded_cutoff=1.2*nanometer, ref_energy_name = 'reference_energy_file.csv',
modif_energy_name='modified_energy_file_%s.csv' % int([2][i]),
output_directory=OUTPUT_DIRECTORY, num_of_threads=2, que=None,
logger_object=log_obj)
if i != 0:
# --> RESIDUE BASED DECOMPOSITION
"""
residue_based_decomposition(topol=unwrap_pdb, trj_pos_list=position_list, start_res=0, stop_res=250,
output_directory=OUTPUT_DIRECTORY, que=None, platform_name='CUDA',
ref_energy_name=None, device_id_active=False, num_of_threads=2,
modif_energy_name='modified_energy_file_%s.csv' % int([2][i]),
origin_last_pdb=last_pdb_file_path,
ff='amber03.xml', logger_object=log_obj)
"""
process_energy_data(topology_file=last_pdb_file_path, protein_ff='amber03.xml', water_ff='tip3p.xml',
modif_trajectory=dissipation_traj_file_for_pos, device_id_active=False,
ref_trajectory=reference_traj_file_for_pos, platform_type='CUDA',
nonbonded_cutoff=1.2*nanometer, ref_energy_name = 'reference_energy_file.csv',
modif_energy_name='modified_energy_file_%s.csv' % int([2][i]),
output_directory=OUTPUT_DIRECTORY, num_of_threads=2, que=None,
logger_object=log_obj)
# --> RESPONSE TIME CSV EXPORTER
getResidueResponseTimes(os.path.join(OUTPUT_DIRECTORY, 'reference_energy_file.csv'),
os.path.join(OUTPUT_DIRECTORY, 'modified_energy_file_%s.csv' % int([2][i])),
outputName=os.path.join(OUTPUT_DIRECTORY, 'responseTimes_%s.csv' % int([2][i])))
except Exception as e:
print("ERROR: ", e)
log_obj.error(e, stack_info=True, exc_info=True)
try:
del XTC_file_path, ref_simulation, dis_simulation, simulation
except NameError:
pass