-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild_equil_run.py
80 lines (62 loc) · 2.03 KB
/
build_equil_run.py
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
from htmd.ui import *
from os.path import join
from moleculekit.projections.metricdistance import MetricDistance
#Protein
prot = Molecule('noncovhits/Mpro-x0104.pdb')
prot.reps.add(sel='resname LIG', style='CPK')
prot.reps.add(sel='not protein', style='Licorice')
prot.reps.add(sel='protein', style='Lines')
prot.view(name='original')
prot.remove('resname LIG')
prot.filter('protein')
prot = proteinPrepare(prot, pH=7.0)
prot = autoSegment(prot, sel='protein')
prot.set('segid', 'W', sel='water')
prot.set('segid', 'CA', sel='resname CA')
prot.center()
#LIGAND
ligand = Molecule('/home/alejandro/covid19/MDrun/melatonin_cov/parameters/GAFF2/mol.mol2')
ligand.center()
ligand.set('segid','L')
ligand.set('resname','MOL')
ligand.rotateBy(uniformRandomRotation())
from moleculekit.util import maxDistance
D = maxDistance(prot, 'all')
D += 5
ligand.moveBy([D, 0, 0])
mol = Molecule(name='combo')
mol.append(prot)
mol.append(ligand)
mol.reps.add(sel='protein', style='NewCartoon', color='Secondary Structure')
mol.reps.add(sel='resname MOL', style='Licorice')
mol.view()
# We solvate with a larger box to fully solvate the ligand
DW = D + 3
smol = solvate(mol, minmax=[[-DW, -DW, -DW], [DW, DW, DW]])
smol.reps.add(sel='water', style='Lines')
smol.view()
topos_amber = amber.defaultTopo()
frcmods_amber = amber.defaultParam() + [join('melatonin_cov/parameters/GAFF2/', 'mol.frcmod')]
bmol_amber = amber.build(smol, topo=topos_amber, param=frcmods_amber, outdir='./build_amber')
bmol_amber.view(name='ready2run')
from htmd.protocols.equilibration_v2 import Equilibration
md = Equilibration()
md.runtime = 3
md.timeunits = 'ns'
md.temperature = 310
md.useconstantratio = False
md.write('./build_amber/', './equil')
local = LocalGPUQueue()
local.submit('./equil/')
local.wait()
from htmd.protocols.production_v6 import Production
md = Production()
md.runtime = 10
md.timeunits = 'ns'
md.temperature = 310
md.acemd.bincoordinates = 'output.coor'
md.acemd.extendedsystem = 'output.xsc'
md.write('equil','prod')
local = LocalGPUQueue()
local.submit('./prod/')
local.wait()