bfee2 2.5.0__py3-none-any.whl → 3.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bfee2 might be problematic. Click here for more details.
- BFEE2/commonTools/commonSlots.py +1 -1
- BFEE2/gui.py +326 -12
- BFEE2/inputGenerator.py +236 -201
- BFEE2/postTreatment.py +156 -0
- BFEE2/templates_namd/configTemplate.py +10 -6
- BFEE2/templates_namd/fep_lddm.tcl +312 -0
- BFEE2/templates_namd/scriptTemplate.py +155 -0
- BFEE2/third_party/py_bar.py +251 -1
- BFEE2/version.py +2 -2
- {bfee2-2.5.0.data → bfee2-3.0.0.data}/scripts/BFEE2Gui.py +19 -18
- {bfee2-2.5.0.dist-info → bfee2-3.0.0.dist-info}/METADATA +84 -76
- {bfee2-2.5.0.dist-info → bfee2-3.0.0.dist-info}/RECORD +15 -14
- {bfee2-2.5.0.dist-info → bfee2-3.0.0.dist-info}/WHEEL +1 -1
- {bfee2-2.5.0.dist-info → bfee2-3.0.0.dist-info/licenses}/LICENSE +0 -0
- {bfee2-2.5.0.dist-info → bfee2-3.0.0.dist-info}/top_level.txt +0 -0
BFEE2/inputGenerator.py
CHANGED
|
@@ -64,7 +64,8 @@ class inputGenerator():
|
|
|
64
64
|
considerRMSDCV = True,
|
|
65
65
|
CUDASOAIntegrator = False,
|
|
66
66
|
timestep = 2.0,
|
|
67
|
-
reEq = False
|
|
67
|
+
reEq = False,
|
|
68
|
+
useLDDM = False
|
|
68
69
|
):
|
|
69
70
|
"""generate all the input files for NAMD alchemical simulation
|
|
70
71
|
|
|
@@ -77,7 +78,7 @@ class inputGenerator():
|
|
|
77
78
|
temperature (float): temperature of the simulation
|
|
78
79
|
selectionPro (str): MDAnalysis-style selection of the protein
|
|
79
80
|
selectionLig (str): MDAnalysis-style selection of the ligand
|
|
80
|
-
stratification (list of int,
|
|
81
|
+
stratification (list of int, 4, optional): number of windows for each simulation.
|
|
81
82
|
Defaults to [1,1,1,1].
|
|
82
83
|
doubleWide (bool, optional): whether double-wide simulations are carried out.
|
|
83
84
|
Defaults to False.
|
|
@@ -95,7 +96,8 @@ class inputGenerator():
|
|
|
95
96
|
considerRMSDCV (bool, optional): Whether consider the RMSD CV. Default to True.
|
|
96
97
|
CUDASOAIntegrator (bool, optional): Whether CUDASOA integrator is used. Default to False.
|
|
97
98
|
timestep (float, optional): timestep of the simulation. Default to 2.0
|
|
98
|
-
reEq (bool, optional): re-equilibration after histogram.
|
|
99
|
+
reEq (bool, optional): re-equilibration after histogram. Default to False.
|
|
100
|
+
useLDDM (bool, optional): whether the LDDM strategy is used. Default to False.
|
|
99
101
|
"""
|
|
100
102
|
|
|
101
103
|
assert(len(stratification) == 4)
|
|
@@ -104,13 +106,14 @@ class inputGenerator():
|
|
|
104
106
|
# determine the type of input top and coor file
|
|
105
107
|
topType, coorType = self._determineFileType(topFile, coorFile)
|
|
106
108
|
|
|
107
|
-
self._makeDirectories(path, 'alchemical', considerRMSDCV=considerRMSDCV)
|
|
109
|
+
self._makeDirectories(path, 'alchemical', considerRMSDCV=considerRMSDCV, useLDDM=useLDDM)
|
|
108
110
|
# after copying files
|
|
109
111
|
# the coordinate file is converted to pdb
|
|
110
112
|
self._copyFiles(
|
|
111
113
|
path, topFile, topType, coorFile, coorType, forceFieldType, forceFieldFiles,
|
|
112
114
|
selectionPro, selectionLig, selectionPro, '', '',
|
|
113
|
-
'alchemical', membraneProtein, neutralizeLigOnly, vmdPath
|
|
115
|
+
'alchemical', membraneProtein, neutralizeLigOnly, vmdPath,
|
|
116
|
+
considerRMSDCV, useLDDM, temperature, stratification[0])
|
|
114
117
|
|
|
115
118
|
# get relative force field path
|
|
116
119
|
relativeFFPath = []
|
|
@@ -121,11 +124,11 @@ class inputGenerator():
|
|
|
121
124
|
self._generateAlchemicalNAMDConfig(
|
|
122
125
|
path, forceFieldType, relativeFFPath, temperature, stratification, doubleWide, minBeforeSample,
|
|
123
126
|
membraneProtein, OPLSMixingRule=OPLSMixingRule, considerRMSDCV=considerRMSDCV,
|
|
124
|
-
CUDASOAIntegrator=CUDASOAIntegrator, timestep=timestep, reEq=reEq
|
|
127
|
+
CUDASOAIntegrator=CUDASOAIntegrator, timestep=timestep, reEq=reEq, useLDDM=useLDDM
|
|
125
128
|
)
|
|
126
129
|
self._generateAlchemicalColvarsConfig(
|
|
127
130
|
path, topType, 'pdb', selectionPro, selectionLig, selectionPro, stratification, pinDownPro, useOldCv,
|
|
128
|
-
considerRMSDCV=considerRMSDCV, reEq=reEq
|
|
131
|
+
considerRMSDCV=considerRMSDCV, reEq=reEq, useLDDM=useLDDM
|
|
129
132
|
)
|
|
130
133
|
|
|
131
134
|
def generateNAMDGeometricFiles(
|
|
@@ -352,13 +355,14 @@ class inputGenerator():
|
|
|
352
355
|
|
|
353
356
|
return topType, coorType
|
|
354
357
|
|
|
355
|
-
def _makeDirectories(self, path, jobType='geometric', considerRMSDCV=True):
|
|
358
|
+
def _makeDirectories(self, path, jobType='geometric', considerRMSDCV=True, useLDDM=False):
|
|
356
359
|
"""make directories for BFEE calculation
|
|
357
360
|
|
|
358
361
|
Args:
|
|
359
362
|
path (str): the path for putting BFEE input files into
|
|
360
363
|
jobType (str, optional): geometric or alchemical. Defaults to 'geometric'.
|
|
361
364
|
considerRMSDCV (bool, optional): Whethre consider the RMSD CV. Default to True.
|
|
365
|
+
useLDDM (bool, optional): whether the LDDM strategy is used. Default to False.
|
|
362
366
|
|
|
363
367
|
Raises:
|
|
364
368
|
DirectoryExistError: if {path}/BFEE exists
|
|
@@ -398,11 +402,13 @@ class inputGenerator():
|
|
|
398
402
|
os.mkdir(f'{path}/BFEE/004_RestraintUnbound/output')
|
|
399
403
|
|
|
400
404
|
os.mkdir(f'{path}/BFEE/001_MoleculeBound')
|
|
401
|
-
os.mkdir(f'{path}/BFEE/002_RestraintBound')
|
|
402
405
|
os.mkdir(f'{path}/BFEE/003_MoleculeUnbound')
|
|
403
406
|
os.mkdir(f'{path}/BFEE/001_MoleculeBound/output')
|
|
404
|
-
os.mkdir(f'{path}/BFEE/002_RestraintBound/output')
|
|
405
407
|
os.mkdir(f'{path}/BFEE/003_MoleculeUnbound/output')
|
|
408
|
+
|
|
409
|
+
if not useLDDM:
|
|
410
|
+
os.mkdir(f'{path}/BFEE/002_RestraintBound')
|
|
411
|
+
os.mkdir(f'{path}/BFEE/002_RestraintBound/output')
|
|
406
412
|
|
|
407
413
|
|
|
408
414
|
|
|
@@ -424,7 +430,10 @@ class inputGenerator():
|
|
|
424
430
|
membraneProtein = False,
|
|
425
431
|
neutralizeLigOnly = 'NaCl',
|
|
426
432
|
vmdPath = '',
|
|
427
|
-
considerRMSDCV = True
|
|
433
|
+
considerRMSDCV = True,
|
|
434
|
+
useLDDM = False,
|
|
435
|
+
LDDMTemperature = 300.0,
|
|
436
|
+
LDDMWindows = 200
|
|
428
437
|
):
|
|
429
438
|
"""copy original and generate necessary topology/structure files
|
|
430
439
|
|
|
@@ -450,6 +459,9 @@ class inputGenerator():
|
|
|
450
459
|
Defaluts to NaCl.
|
|
451
460
|
vmdPath (str, optional): path to vmd, space is forbidden. Defaults to ''.
|
|
452
461
|
considerRMSDCV (bool, optional): Whethre consider the RMSD CV. Default to True.
|
|
462
|
+
useLDDM (bool, optional): whether the LDDM strategy is used. Default to False.
|
|
463
|
+
LDDMTemperature (float, optional): temperature of LDDM simulation. Default to 300.
|
|
464
|
+
LDDMWindows(int, optional): windows of step 1 of LDDM simulation. Default to 200.
|
|
453
465
|
"""
|
|
454
466
|
|
|
455
467
|
# copy force fields
|
|
@@ -626,8 +638,10 @@ class inputGenerator():
|
|
|
626
638
|
if jobType == 'alchemical':
|
|
627
639
|
|
|
628
640
|
# readme file
|
|
629
|
-
|
|
630
|
-
|
|
641
|
+
if not useLDDM:
|
|
642
|
+
with pkg_resources.path(templates_readme, 'Readme_NAMD_Alchemical.txt') as p:
|
|
643
|
+
shutil.copyfile(p, f'{path}/BFEE/Readme.txt')
|
|
644
|
+
# TODO: add LDDM readme
|
|
631
645
|
|
|
632
646
|
# script to update the center after equilibration
|
|
633
647
|
with pkg_resources.path(templates_namd, 'updateCenters.py') as p:
|
|
@@ -641,6 +655,10 @@ class inputGenerator():
|
|
|
641
655
|
)
|
|
642
656
|
with pkg_resources.path(templates_namd, 'fep.tcl') as p:
|
|
643
657
|
shutil.copyfile(p, f'{path}/BFEE/fep.tcl')
|
|
658
|
+
|
|
659
|
+
if useLDDM:
|
|
660
|
+
with pkg_resources.path(templates_namd, 'fep_lddm.tcl') as p:
|
|
661
|
+
shutil.copyfile(p, f'{path}/BFEE/001_MoleculeBound/fep_lddm.tcl')
|
|
644
662
|
|
|
645
663
|
if not membraneProtein:
|
|
646
664
|
# otherwise the these files will be generated by vmd
|
|
@@ -716,6 +734,15 @@ class inputGenerator():
|
|
|
716
734
|
fParserLigandOnly.saveNDX(
|
|
717
735
|
[selectionLig], ['ligand'], f'{path}/BFEE/ligandOnly.ndx', True
|
|
718
736
|
)
|
|
737
|
+
|
|
738
|
+
# LDDM script for generating files
|
|
739
|
+
if useLDDM:
|
|
740
|
+
with open(f'{path}/BFEE/001_MoleculeBound/000_updateForceConstant.py', 'w') as rScript:
|
|
741
|
+
rScript.write(
|
|
742
|
+
scriptTemplate.genarateLDDMFilesTemplate.substitute(
|
|
743
|
+
temperature=LDDMTemperature, windows=LDDMWindows
|
|
744
|
+
)
|
|
745
|
+
)
|
|
719
746
|
|
|
720
747
|
def _makeGromacsTopGro(
|
|
721
748
|
self,
|
|
@@ -859,7 +886,8 @@ class inputGenerator():
|
|
|
859
886
|
considerRMSDCV = True,
|
|
860
887
|
CUDASOAIntegrator = False,
|
|
861
888
|
timestep = 2.0,
|
|
862
|
-
reEq = False
|
|
889
|
+
reEq = False,
|
|
890
|
+
useLDDM = False
|
|
863
891
|
):
|
|
864
892
|
"""generate NAMD config fils for the alchemical route
|
|
865
893
|
|
|
@@ -880,7 +908,8 @@ class inputGenerator():
|
|
|
880
908
|
considerRMSDCV (bool, optional): Whethre consider the RMSD CV. Default to True.
|
|
881
909
|
CUDASOAIntegrator (bool, optional): Whether CUDASOA integrator is used. Default to False.
|
|
882
910
|
timestep (float, optional): timestep of the simulation. Default to 2.0.
|
|
883
|
-
reEq (bool, optional): re-equilibration after histogram.
|
|
911
|
+
reEq (bool, optional): re-equilibration after histogram. Default to False.
|
|
912
|
+
useLDDM (bool, optional): whether the LDDM strategy is used. Default to False.
|
|
884
913
|
"""
|
|
885
914
|
|
|
886
915
|
if forceFieldType == 'charmm':
|
|
@@ -909,7 +938,7 @@ class inputGenerator():
|
|
|
909
938
|
self.cTemplate.namdConfigTemplate(
|
|
910
939
|
forceFieldType, forceFields, f'../complex.{topType}', f'../complex.pdb',
|
|
911
940
|
'', '', '', pbc,
|
|
912
|
-
'output/eq', temperature,
|
|
941
|
+
'output/eq', temperature, 50000000, 'colvars.in', '', membraneProtein=membraneProtein,
|
|
913
942
|
OPLSMixingRule=OPLSMixingRule, CUDASOAIntegrator=CUDASOAIntegrator, timestep=timestep
|
|
914
943
|
)
|
|
915
944
|
)
|
|
@@ -920,7 +949,7 @@ class inputGenerator():
|
|
|
920
949
|
self.cTemplate.namdConfigTemplate(
|
|
921
950
|
forceFieldType, forceFields, f'../complex.{topType}', f'../complex.pdb',
|
|
922
951
|
f'../000_eq/output/eq.coor', f'../000_eq/output/eq.vel', f'../000_eq/output/eq.xsc', '',
|
|
923
|
-
'output/eq2', temperature,
|
|
952
|
+
'output/eq2', temperature, 50000000, 'colvars2.in', '', membraneProtein=membraneProtein,
|
|
924
953
|
OPLSMixingRule=OPLSMixingRule, CUDASOAIntegrator=CUDASOAIntegrator, timestep=timestep
|
|
925
954
|
)
|
|
926
955
|
)
|
|
@@ -930,35 +959,36 @@ class inputGenerator():
|
|
|
930
959
|
self.cTemplate.namdConfigTemplate(
|
|
931
960
|
forceFieldType, forceFields, f'../ligandOnly.{topType}', f'../ligandOnly.pdb',
|
|
932
961
|
'', '', '', pbcLig,
|
|
933
|
-
'output/eq_ligandOnly', temperature,
|
|
962
|
+
'output/eq_ligandOnly', temperature, 10000000, 'colvars_ligandOnly.in',
|
|
934
963
|
'', OPLSMixingRule=OPLSMixingRule, CUDASOAIntegrator=CUDASOAIntegrator,
|
|
935
964
|
timestep=timestep
|
|
936
965
|
)
|
|
937
966
|
)
|
|
938
967
|
|
|
939
968
|
# 001_MoleculeBound
|
|
940
|
-
|
|
941
|
-
namdConfig
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
969
|
+
if not useLDDM:
|
|
970
|
+
with open(f'{path}/BFEE/001_MoleculeBound/001.2_fep_forward.conf', 'w') as namdConfig:
|
|
971
|
+
namdConfig.write(
|
|
972
|
+
self.cTemplate.namdConfigTemplate(
|
|
973
|
+
forceFieldType, forceFields, f'../complex.{topType}', f'../complex.pdb',
|
|
974
|
+
f'output/fep_backward.coor', f'output/fep_backward.vel', f'output/fep_backward.xsc', '',
|
|
975
|
+
'output/fep_forward', temperature, 0, 'colvars.in', '', '', '../fep.pdb',
|
|
976
|
+
stratification[0], True, False, minBeforeSample, membraneProtein=membraneProtein,
|
|
977
|
+
OPLSMixingRule=OPLSMixingRule, CUDASOAIntegrator=CUDASOAIntegrator,
|
|
978
|
+
timestep=timestep
|
|
979
|
+
)
|
|
949
980
|
)
|
|
950
|
-
)
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
981
|
+
with open(f'{path}/BFEE/001_MoleculeBound/001.1_fep_backward.conf', 'w') as namdConfig:
|
|
982
|
+
namdConfig.write(
|
|
983
|
+
self.cTemplate.namdConfigTemplate(
|
|
984
|
+
forceFieldType, forceFields, f'../complex.{topType}', f'../complex.pdb',
|
|
985
|
+
f'../000_eq/output/eq.coor', f'../000_eq/output/eq.vel', f'../000_eq/output/eq.xsc', '',
|
|
986
|
+
'output/fep_backward', temperature, 0, 'colvars.in', '', '', '../fep.pdb',
|
|
987
|
+
stratification[0], False, False, minBeforeSample, membraneProtein=membraneProtein,
|
|
988
|
+
OPLSMixingRule=OPLSMixingRule, CUDASOAIntegrator=CUDASOAIntegrator,
|
|
989
|
+
timestep=timestep
|
|
990
|
+
)
|
|
960
991
|
)
|
|
961
|
-
)
|
|
962
992
|
|
|
963
993
|
if doubleWide:
|
|
964
994
|
with open(f'{path}/BFEE/001_MoleculeBound/001_fep_doubleWide.conf', 'w') as namdConfig:
|
|
@@ -969,59 +999,62 @@ class inputGenerator():
|
|
|
969
999
|
'output/fep_doubleWide', temperature, 0, 'colvars.in', '', '', '../fep.pdb',
|
|
970
1000
|
stratification[0], False, True, membraneProtein=membraneProtein,
|
|
971
1001
|
OPLSMixingRule=OPLSMixingRule, CUDASOAIntegrator=CUDASOAIntegrator,
|
|
972
|
-
timestep=timestep
|
|
1002
|
+
timestep=timestep, LDDMStep1=useLDDM
|
|
973
1003
|
)
|
|
974
1004
|
)
|
|
975
1005
|
|
|
976
1006
|
# 002_RestraintBound
|
|
977
|
-
|
|
978
|
-
namdConfig
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1007
|
+
if not useLDDM:
|
|
1008
|
+
with open(f'{path}/BFEE/002_RestraintBound/002.2_ti_forward.conf', 'w') as namdConfig:
|
|
1009
|
+
namdConfig.write(
|
|
1010
|
+
self.cTemplate.namdConfigTemplate(
|
|
1011
|
+
forceFieldType, forceFields, f'../complex.{topType}', f'../complex.pdb',
|
|
1012
|
+
f'output/ti_backward.coor', f'output/ti_backward.vel', f'output/ti_backward.xsc', '',
|
|
1013
|
+
'output/ti_forward', temperature, f'{500000*(stratification[1]+1)}', 'colvars_forward.in',
|
|
1014
|
+
'', membraneProtein=membraneProtein, OPLSMixingRule=OPLSMixingRule,
|
|
1015
|
+
CUDASOAIntegrator=CUDASOAIntegrator, timestep=timestep
|
|
1016
|
+
)
|
|
985
1017
|
)
|
|
986
|
-
)
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1018
|
+
with open(f'{path}/BFEE/002_RestraintBound/002.1_ti_backward.conf', 'w') as namdConfig:
|
|
1019
|
+
namdConfig.write(
|
|
1020
|
+
self.cTemplate.namdConfigTemplate(
|
|
1021
|
+
forceFieldType, forceFields, f'../complex.{topType}', f'../complex.pdb',
|
|
1022
|
+
f'../000_eq/output/eq.coor', f'../000_eq/output/eq.vel', f'../000_eq/output/eq.xsc', '',
|
|
1023
|
+
'output/ti_backward', temperature, f'{500000*(stratification[1]+1)}', 'colvars_backward.in',
|
|
1024
|
+
'', membraneProtein=membraneProtein, OPLSMixingRule=OPLSMixingRule,
|
|
1025
|
+
CUDASOAIntegrator=CUDASOAIntegrator, timestep=timestep
|
|
1026
|
+
)
|
|
995
1027
|
)
|
|
996
|
-
)
|
|
997
1028
|
|
|
998
1029
|
# 003_MoleculeUnbound
|
|
999
1030
|
if considerRMSDCV:
|
|
1000
1031
|
step3ColvarsConfig = 'colvars.in'
|
|
1001
1032
|
else:
|
|
1002
1033
|
step3ColvarsConfig = ''
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1034
|
+
|
|
1035
|
+
if not useLDDM:
|
|
1036
|
+
with open(f'{path}/BFEE/003_MoleculeUnbound/003.2_fep_forward.conf', 'w') as namdConfig:
|
|
1037
|
+
namdConfig.write(
|
|
1038
|
+
self.cTemplate.namdConfigTemplate(
|
|
1039
|
+
forceFieldType, forceFields, f'../ligandOnly.{topType}', f'../ligandOnly.pdb',
|
|
1040
|
+
f'output/fep_backward.coor', f'output/fep_backward.vel',
|
|
1041
|
+
f'output/fep_backward.xsc', '',
|
|
1042
|
+
'output/fep_forward', temperature, 0, step3ColvarsConfig, '', '', '../fep_ligandOnly.pdb',
|
|
1043
|
+
stratification[2], True, False, minBeforeSample, OPLSMixingRule=OPLSMixingRule,
|
|
1044
|
+
CUDASOAIntegrator=CUDASOAIntegrator, timestep=timestep
|
|
1045
|
+
)
|
|
1012
1046
|
)
|
|
1013
|
-
)
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1047
|
+
with open(f'{path}/BFEE/003_MoleculeUnbound/003.1_fep_backward.conf', 'w') as namdConfig:
|
|
1048
|
+
namdConfig.write(
|
|
1049
|
+
self.cTemplate.namdConfigTemplate(
|
|
1050
|
+
forceFieldType, forceFields, f'../ligandOnly.{topType}', f'../ligandOnly.pdb',
|
|
1051
|
+
f'../000_eq/output/eq_ligandOnly.coor', f'../000_eq/output/eq_ligandOnly.vel',
|
|
1052
|
+
f'../000_eq/output/eq_ligandOnly.xsc', '',
|
|
1053
|
+
'output/fep_backward', temperature, 0, step3ColvarsConfig, '', '', '../fep_ligandOnly.pdb',
|
|
1054
|
+
stratification[2], False, False, minBeforeSample, OPLSMixingRule=OPLSMixingRule,
|
|
1055
|
+
CUDASOAIntegrator=CUDASOAIntegrator, timestep=timestep
|
|
1056
|
+
)
|
|
1023
1057
|
)
|
|
1024
|
-
)
|
|
1025
1058
|
|
|
1026
1059
|
if doubleWide:
|
|
1027
1060
|
with open(f'{path}/BFEE/003_MoleculeUnbound/003_fep_doubleWide.conf', 'w') as namdConfig:
|
|
@@ -1063,7 +1096,7 @@ class inputGenerator():
|
|
|
1063
1096
|
def _generateAlchemicalColvarsConfig(
|
|
1064
1097
|
self, path, topType, coorType, selectionPro, selectionLig, selectionRef,
|
|
1065
1098
|
stratification=[1,1,1,1], pinDownPro=True, useOldCv=True, considerRMSDCV=True,
|
|
1066
|
-
reEq = False
|
|
1099
|
+
reEq = False, useLDDM = False
|
|
1067
1100
|
):
|
|
1068
1101
|
"""generate Colvars config fils for geometric route
|
|
1069
1102
|
|
|
@@ -1079,7 +1112,8 @@ class inputGenerator():
|
|
|
1079
1112
|
pinDownPro (bool, optinal): Whether pinning down the protein. Defaults to True.
|
|
1080
1113
|
useOldCv (bool, optional): whether used old, custom-function-based cv. Defaults to True.
|
|
1081
1114
|
considerRMSDCV (bool, optional): Whethre consider the RMSD CV. Default to True.
|
|
1082
|
-
reEq (bool, optional): re-equilibration after histogram.
|
|
1115
|
+
reEq (bool, optional): re-equilibration after histogram. Default to False.
|
|
1116
|
+
useLDDM (bool, optional): whether the LDDM strategy is used. Default to False.
|
|
1083
1117
|
"""
|
|
1084
1118
|
|
|
1085
1119
|
assert(len(stratification) == 4)
|
|
@@ -1327,149 +1361,150 @@ class inputGenerator():
|
|
|
1327
1361
|
)
|
|
1328
1362
|
|
|
1329
1363
|
# 002_RestraintBound
|
|
1330
|
-
|
|
1331
|
-
colvarsConfig
|
|
1332
|
-
self.cTemplate.cvHeadTemplate('../complex.ndx')
|
|
1333
|
-
)
|
|
1334
|
-
if considerRMSDCV:
|
|
1364
|
+
if not useLDDM:
|
|
1365
|
+
with open(f'{path}/BFEE/002_RestraintBound/colvars_forward.in', 'w') as colvarsConfig:
|
|
1335
1366
|
colvarsConfig.write(
|
|
1336
|
-
self.cTemplate.
|
|
1337
|
-
|
|
1367
|
+
self.cTemplate.cvHeadTemplate('../complex.ndx')
|
|
1368
|
+
)
|
|
1369
|
+
if considerRMSDCV:
|
|
1370
|
+
colvarsConfig.write(
|
|
1371
|
+
self.cTemplate.cvRMSDTemplate(
|
|
1372
|
+
False, '', '', '../complex.xyz',
|
|
1373
|
+
extendedLagrangian = False
|
|
1374
|
+
)
|
|
1375
|
+
)
|
|
1376
|
+
colvarsConfig.write(
|
|
1377
|
+
self.cTemplate.cvAngleTemplate(
|
|
1378
|
+
False, 0, 0, 'eulerTheta', '../complex.xyz', useOldCv,
|
|
1338
1379
|
extendedLagrangian = False
|
|
1339
1380
|
)
|
|
1340
1381
|
)
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1382
|
+
colvarsConfig.write(
|
|
1383
|
+
self.cTemplate.cvAngleTemplate(
|
|
1384
|
+
False, 0, 0, 'eulerPhi', '../complex.xyz', useOldCv,
|
|
1385
|
+
extendedLagrangian = False
|
|
1386
|
+
)
|
|
1345
1387
|
)
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1388
|
+
colvarsConfig.write(
|
|
1389
|
+
self.cTemplate.cvAngleTemplate(
|
|
1390
|
+
False, 0, 0, 'eulerPsi', '../complex.xyz', useOldCv,
|
|
1391
|
+
extendedLagrangian = False
|
|
1392
|
+
)
|
|
1351
1393
|
)
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1394
|
+
colvarsConfig.write(
|
|
1395
|
+
self.cTemplate.cvAngleTemplate(
|
|
1396
|
+
False, 0, 0, 'polarTheta', '../complex.xyz', useOldCv,
|
|
1397
|
+
extendedLagrangian = False
|
|
1398
|
+
)
|
|
1357
1399
|
)
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1400
|
+
colvarsConfig.write(
|
|
1401
|
+
self.cTemplate.cvAngleTemplate(
|
|
1402
|
+
False, 0, 0, 'polarPhi', '../complex.xyz', useOldCv,
|
|
1403
|
+
extendedLagrangian = False
|
|
1404
|
+
)
|
|
1363
1405
|
)
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
extendedLagrangian = False
|
|
1406
|
+
colvarsConfig.write(
|
|
1407
|
+
self.cTemplate.cvRTemplate(
|
|
1408
|
+
False, 0, 0, extendedLagrangian = False
|
|
1409
|
+
)
|
|
1369
1410
|
)
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1411
|
+
if considerRMSDCV:
|
|
1412
|
+
colvarsConfig.write(
|
|
1413
|
+
self.cTemplate.cvHarmonicTemplate('RMSD', 0, 0, stratification[1], True, 10)
|
|
1414
|
+
)
|
|
1415
|
+
colvarsConfig.write(
|
|
1416
|
+
self.cTemplate.cvHarmonicTemplate('eulerTheta', 0, 0, stratification[1], True, 0.1)
|
|
1374
1417
|
)
|
|
1375
|
-
)
|
|
1376
|
-
if considerRMSDCV:
|
|
1377
1418
|
colvarsConfig.write(
|
|
1378
|
-
self.cTemplate.cvHarmonicTemplate('
|
|
1419
|
+
self.cTemplate.cvHarmonicTemplate('eulerPhi', 0, 0, stratification[1], True, 0.1)
|
|
1379
1420
|
)
|
|
1380
|
-
colvarsConfig.write(
|
|
1381
|
-
self.cTemplate.cvHarmonicTemplate('eulerTheta', 0, 0, stratification[1], True, 0.1)
|
|
1382
|
-
)
|
|
1383
|
-
colvarsConfig.write(
|
|
1384
|
-
self.cTemplate.cvHarmonicTemplate('eulerPhi', 0, 0, stratification[1], True, 0.1)
|
|
1385
|
-
)
|
|
1386
|
-
colvarsConfig.write(
|
|
1387
|
-
self.cTemplate.cvHarmonicTemplate('eulerPsi', 0, 0, stratification[1], True, 0.1)
|
|
1388
|
-
)
|
|
1389
|
-
colvarsConfig.write(
|
|
1390
|
-
self.cTemplate.cvHarmonicTemplate('polarTheta', 0, polarAngles[0], stratification[1], True, 0.1)
|
|
1391
|
-
)
|
|
1392
|
-
colvarsConfig.write(
|
|
1393
|
-
self.cTemplate.cvHarmonicTemplate('polarPhi', 0, polarAngles[1], stratification[1], True, 0.1)
|
|
1394
|
-
)
|
|
1395
|
-
colvarsConfig.write(
|
|
1396
|
-
self.cTemplate.cvHarmonicTemplate('r', 0, distance, stratification[1], True, 10)
|
|
1397
|
-
)
|
|
1398
|
-
if pinDownPro:
|
|
1399
1421
|
colvarsConfig.write(
|
|
1400
|
-
self.cTemplate.
|
|
1422
|
+
self.cTemplate.cvHarmonicTemplate('eulerPsi', 0, 0, stratification[1], True, 0.1)
|
|
1401
1423
|
)
|
|
1402
|
-
with open(f'{path}/BFEE/002_RestraintBound/colvars_backward.in', 'w') as colvarsConfig:
|
|
1403
|
-
colvarsConfig.write(
|
|
1404
|
-
self.cTemplate.cvHeadTemplate('../complex.ndx')
|
|
1405
|
-
)
|
|
1406
|
-
if considerRMSDCV:
|
|
1407
1424
|
colvarsConfig.write(
|
|
1408
|
-
self.cTemplate.
|
|
1409
|
-
|
|
1425
|
+
self.cTemplate.cvHarmonicTemplate('polarTheta', 0, polarAngles[0], stratification[1], True, 0.1)
|
|
1426
|
+
)
|
|
1427
|
+
colvarsConfig.write(
|
|
1428
|
+
self.cTemplate.cvHarmonicTemplate('polarPhi', 0, polarAngles[1], stratification[1], True, 0.1)
|
|
1429
|
+
)
|
|
1430
|
+
colvarsConfig.write(
|
|
1431
|
+
self.cTemplate.cvHarmonicTemplate('r', 0, distance, stratification[1], True, 10)
|
|
1432
|
+
)
|
|
1433
|
+
if pinDownPro:
|
|
1434
|
+
colvarsConfig.write(
|
|
1435
|
+
self.cTemplate.cvProteinTemplate(center, '../complex.xyz')
|
|
1410
1436
|
)
|
|
1437
|
+
with open(f'{path}/BFEE/002_RestraintBound/colvars_backward.in', 'w') as colvarsConfig:
|
|
1438
|
+
colvarsConfig.write(
|
|
1439
|
+
self.cTemplate.cvHeadTemplate('../complex.ndx')
|
|
1411
1440
|
)
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1441
|
+
if considerRMSDCV:
|
|
1442
|
+
colvarsConfig.write(
|
|
1443
|
+
self.cTemplate.cvRMSDTemplate(
|
|
1444
|
+
False, '', '', '../complex.xyz', extendedLagrangian = False
|
|
1445
|
+
)
|
|
1446
|
+
)
|
|
1447
|
+
colvarsConfig.write(
|
|
1448
|
+
self.cTemplate.cvAngleTemplate(
|
|
1449
|
+
False, 0, 0, 'eulerTheta', '../complex.xyz', useOldCv,
|
|
1450
|
+
extendedLagrangian = False
|
|
1451
|
+
)
|
|
1416
1452
|
)
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1453
|
+
colvarsConfig.write(
|
|
1454
|
+
self.cTemplate.cvAngleTemplate(
|
|
1455
|
+
False, 0, 0, 'eulerPhi', '../complex.xyz', useOldCv,
|
|
1456
|
+
extendedLagrangian = False
|
|
1457
|
+
)
|
|
1422
1458
|
)
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1459
|
+
colvarsConfig.write(
|
|
1460
|
+
self.cTemplate.cvAngleTemplate(
|
|
1461
|
+
False, 0, 0, 'eulerPsi', '../complex.xyz', useOldCv,
|
|
1462
|
+
extendedLagrangian = False
|
|
1463
|
+
)
|
|
1428
1464
|
)
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1465
|
+
colvarsConfig.write(
|
|
1466
|
+
self.cTemplate.cvAngleTemplate(
|
|
1467
|
+
False, 0, 0, 'polarTheta', '../complex.xyz', useOldCv,
|
|
1468
|
+
extendedLagrangian = False
|
|
1469
|
+
)
|
|
1434
1470
|
)
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1471
|
+
colvarsConfig.write(
|
|
1472
|
+
self.cTemplate.cvAngleTemplate(
|
|
1473
|
+
False, 0, 0, 'polarPhi', '../complex.xyz', useOldCv,
|
|
1474
|
+
extendedLagrangian = False
|
|
1475
|
+
)
|
|
1440
1476
|
)
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1477
|
+
colvarsConfig.write(
|
|
1478
|
+
self.cTemplate.cvRTemplate(
|
|
1479
|
+
False, 0, 0, extendedLagrangian = False
|
|
1480
|
+
)
|
|
1445
1481
|
)
|
|
1446
|
-
|
|
1447
|
-
|
|
1482
|
+
if considerRMSDCV:
|
|
1483
|
+
colvarsConfig.write(
|
|
1484
|
+
self.cTemplate.cvHarmonicTemplate('RMSD', 0, 0, stratification[1], False, 10)
|
|
1485
|
+
)
|
|
1448
1486
|
colvarsConfig.write(
|
|
1449
|
-
self.cTemplate.cvHarmonicTemplate('
|
|
1487
|
+
self.cTemplate.cvHarmonicTemplate('eulerTheta', 0, 0, stratification[1], False, 0.1)
|
|
1450
1488
|
)
|
|
1451
|
-
colvarsConfig.write(
|
|
1452
|
-
self.cTemplate.cvHarmonicTemplate('eulerTheta', 0, 0, stratification[1], False, 0.1)
|
|
1453
|
-
)
|
|
1454
|
-
colvarsConfig.write(
|
|
1455
|
-
self.cTemplate.cvHarmonicTemplate('eulerPhi', 0, 0, stratification[1], False, 0.1)
|
|
1456
|
-
)
|
|
1457
|
-
colvarsConfig.write(
|
|
1458
|
-
self.cTemplate.cvHarmonicTemplate('eulerPsi', 0, 0, stratification[1], False, 0.1)
|
|
1459
|
-
)
|
|
1460
|
-
colvarsConfig.write(
|
|
1461
|
-
self.cTemplate.cvHarmonicTemplate('polarTheta', 0, polarAngles[0], stratification[1], False, 0.1)
|
|
1462
|
-
)
|
|
1463
|
-
colvarsConfig.write(
|
|
1464
|
-
self.cTemplate.cvHarmonicTemplate('polarPhi', 0, polarAngles[1], stratification[1], False, 0.1)
|
|
1465
|
-
)
|
|
1466
|
-
colvarsConfig.write(
|
|
1467
|
-
self.cTemplate.cvHarmonicTemplate('r', 0, distance, stratification[1], False, 10)
|
|
1468
|
-
)
|
|
1469
|
-
if pinDownPro:
|
|
1470
1489
|
colvarsConfig.write(
|
|
1471
|
-
self.cTemplate.
|
|
1490
|
+
self.cTemplate.cvHarmonicTemplate('eulerPhi', 0, 0, stratification[1], False, 0.1)
|
|
1491
|
+
)
|
|
1492
|
+
colvarsConfig.write(
|
|
1493
|
+
self.cTemplate.cvHarmonicTemplate('eulerPsi', 0, 0, stratification[1], False, 0.1)
|
|
1494
|
+
)
|
|
1495
|
+
colvarsConfig.write(
|
|
1496
|
+
self.cTemplate.cvHarmonicTemplate('polarTheta', 0, polarAngles[0], stratification[1], False, 0.1)
|
|
1472
1497
|
)
|
|
1498
|
+
colvarsConfig.write(
|
|
1499
|
+
self.cTemplate.cvHarmonicTemplate('polarPhi', 0, polarAngles[1], stratification[1], False, 0.1)
|
|
1500
|
+
)
|
|
1501
|
+
colvarsConfig.write(
|
|
1502
|
+
self.cTemplate.cvHarmonicTemplate('r', 0, distance, stratification[1], False, 10)
|
|
1503
|
+
)
|
|
1504
|
+
if pinDownPro:
|
|
1505
|
+
colvarsConfig.write(
|
|
1506
|
+
self.cTemplate.cvProteinTemplate(center, '../complex.xyz')
|
|
1507
|
+
)
|
|
1473
1508
|
|
|
1474
1509
|
if considerRMSDCV:
|
|
1475
1510
|
# 003_MoleculeUnbound
|
|
@@ -1591,7 +1626,7 @@ class inputGenerator():
|
|
|
1591
1626
|
self.cTemplate.namdConfigTemplate(
|
|
1592
1627
|
forceFieldType, forceFields, f'../complex.{topType}', f'../complex.pdb',
|
|
1593
1628
|
'', '', '', pbc,
|
|
1594
|
-
'output/eq', temperature,
|
|
1629
|
+
'output/eq', temperature, 50000000, 'colvars.in',
|
|
1595
1630
|
membraneProtein=membraneProtein, OPLSMixingRule=OPLSMixingRule,
|
|
1596
1631
|
GaWTM=False, CUDASOAIntegrator=CUDASOAIntegrator, timestep=timestep
|
|
1597
1632
|
)
|
|
@@ -1907,7 +1942,7 @@ class inputGenerator():
|
|
|
1907
1942
|
forceFieldType, forceFields, f'./complex_largeBox.{topType}', f'./complex_largeBox.pdb',
|
|
1908
1943
|
'', '', '',
|
|
1909
1944
|
pbcStep7,
|
|
1910
|
-
'output/eq', temperature,
|
|
1945
|
+
'output/eq', temperature, 50000000, 'colvars_eq.in', '',
|
|
1911
1946
|
membraneProtein=membraneProtein, OPLSMixingRule=OPLSMixingRule,
|
|
1912
1947
|
GaWTM=False, CUDASOAIntegrator=CUDASOAIntegrator, timestep=timestep
|
|
1913
1948
|
)
|
|
@@ -1918,7 +1953,7 @@ class inputGenerator():
|
|
|
1918
1953
|
self.cTemplate.namdConfigTemplate(
|
|
1919
1954
|
forceFieldType, forceFields, f'./complex_largeBox.{topType}', f'./complex_largeBox.pdb',
|
|
1920
1955
|
'output/eq.coor', 'output/eq.vel', 'output/eq.xsc', '',
|
|
1921
|
-
'output/abf_1', temperature,
|
|
1956
|
+
'output/abf_1', temperature, 100000000, 'colvars_1.in', '',
|
|
1922
1957
|
membraneProtein=membraneProtein, OPLSMixingRule=OPLSMixingRule,
|
|
1923
1958
|
GaWTM=GaWTM, CUDASOAIntegrator=CUDASOAIntegrator, timestep=timestep
|
|
1924
1959
|
)
|
|
@@ -1928,7 +1963,7 @@ class inputGenerator():
|
|
|
1928
1963
|
self.cTemplate.namdConfigTemplate(
|
|
1929
1964
|
forceFieldType, forceFields, f'./complex_largeBox.{topType}', f'./complex_largeBox.pdb',
|
|
1930
1965
|
'output/abf_1.restart.coor', 'output/abf_1.restart.vel', 'output/abf_1.restart.xsc', '',
|
|
1931
|
-
'output/abf_1.extend', temperature,
|
|
1966
|
+
'output/abf_1.extend', temperature, 100000000, 'colvars_1.in', '',
|
|
1932
1967
|
CVRestartFile=f'output/abf_1.restart', membraneProtein=membraneProtein,
|
|
1933
1968
|
OPLSMixingRule=OPLSMixingRule, GaWTM=GaWTM, CUDASOAIntegrator=CUDASOAIntegrator,
|
|
1934
1969
|
timestep=timestep
|
|
@@ -1944,7 +1979,7 @@ class inputGenerator():
|
|
|
1944
1979
|
forceFieldType, forceFields, f'./complex_largeBox.{topType}', f'./complex_largeBox.pdb',
|
|
1945
1980
|
f'output/abf_{i}.restart.coor', f'output/abf_{i}.restart.vel',
|
|
1946
1981
|
f'output/abf_{i}.restart.xsc',
|
|
1947
|
-
'', f'output/abf_{i+1}', temperature,
|
|
1982
|
+
'', f'output/abf_{i+1}', temperature, 100000000, f'colvars_{i+1}.in', '',
|
|
1948
1983
|
membraneProtein=membraneProtein, OPLSMixingRule=OPLSMixingRule,
|
|
1949
1984
|
GaWTM=GaWTM, CUDASOAIntegrator=CUDASOAIntegrator, timestep=timestep
|
|
1950
1985
|
)
|
|
@@ -1955,7 +1990,7 @@ class inputGenerator():
|
|
|
1955
1990
|
forceFieldType, forceFields, f'./complex_largeBox.{topType}', f'./complex_largeBox.pdb',
|
|
1956
1991
|
f'output/abf_{i+1}.restart.coor', f'output/abf_{i+1}.restart.vel',
|
|
1957
1992
|
f'output/abf_{i+1}.restart.xsc',
|
|
1958
|
-
'', f'output/abf_{i+1}.extend', temperature,
|
|
1993
|
+
'', f'output/abf_{i+1}.extend', temperature, 100000000, f'colvars_{i+1}.in', '',
|
|
1959
1994
|
CVRestartFile=f'output/abf_{i+1}.restart', membraneProtein=membraneProtein,
|
|
1960
1995
|
OPLSMixingRule=OPLSMixingRule, GaWTM=GaWTM, CUDASOAIntegrator=CUDASOAIntegrator,
|
|
1961
1996
|
timestep=timestep
|