From bf99722943a936a1e5a5f80d558f887e71e7cab0 Mon Sep 17 00:00:00 2001 From: Amaya Jimenez Date: Sat, 24 Mar 2018 02:19:42 +0100 Subject: [PATCH 1/7] pdb_anm.calcModes() change --- anmmc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anmmc.py b/anmmc.py index 5821f97..79a2bc6 100644 --- a/anmmc.py +++ b/anmmc.py @@ -63,7 +63,7 @@ # ANM calculation based on current pdb_anm = ANM('pdb ca') pdb_anm.buildHessian(initial_pdb_ca, cutoff=anm_cut) -pdb_anm.calcModes(n_modes='all') +pdb_anm.calcModes() # Cumulative sum vector preparation for metropolis sampling eigs = 1/sqrt(pdb_anm.getEigvals()) From d6c575f70cbe6139e45771561a8b25b49dd2f0e5 Mon Sep 17 00:00:00 2001 From: Amaya Jimenez Date: Mon, 26 Mar 2018 11:44:33 +0200 Subject: [PATCH 2/7] using pseudoatoms --- anmmc.py | 60 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/anmmc.py b/anmmc.py index ec961bb..f14bca8 100644 --- a/anmmc.py +++ b/anmmc.py @@ -3,7 +3,9 @@ from random import random import os.path import sys +import time +time.sleep(10) ar =[] for arg in sys.argv: ar.append(arg) @@ -33,7 +35,7 @@ else: acceptance_ratio = 0.9 -accept_para = 0.1 +accept_para=0.1 if len(ar) > 9 and ar[9].strip() is not '0': anm_cut=float(ar[9]) @@ -52,16 +54,19 @@ initial_pdb_id + '_' + final_pdb_id + '_final_structure.dcd' if len(ar) > 12 and ar[12].strip() is not '0': - ensemble_dcd_name = ar[12] + usePseudoatoms = int(ar[12]) else: - ensemble_dcd_name = 'cycle_{0}_'.format(int(comd_cycle_number)) + \ - initial_pdb_id + '_' + final_pdb_id + '_ensemble.dcd' + usePseudoatoms = 0 initial_pdb = parsePDB(initial_pdbn) final_pdb = parsePDB(final_pdbn) - -initial_pdb_ca = initial_pdb.ca -final_pdb_ca = final_pdb.ca + +if usePseudoatoms: + initial_pdb_ca = initial_pdb + final_pdb_ca = final_pdb +else: + initial_pdb_ca = initial_pdb.ca + final_pdb_ca = final_pdb.ca # ANM calculation based on current pdb_anm = ANM('pdb ca') @@ -96,21 +101,21 @@ count3 = 0 # Down-hill moves # read MC parameter from file -if os.path.isfile(initial_pdb_id + '_ratio.dat') and os.stat(initial_pdb_id + '_ratio.dat').st_size != 0: - MCpara = loadtxt(initial_pdb_id + '_ratio.dat') - accept_para = MCpara[4] - if MCpara[1] > acceptance_ratio + 0.05: - accept_para *= 1.5 - elif MCpara[1] < acceptance_ratio - 0.05: - accept_para /= 1.5 - else: - savetxt(initial_pdb_id + '_status.dat',[1]) +#if os.path.isfile(initial_pdb_id + '_ratio.dat') and os.stat(initial_pdb_id + '_ratio.dat').st_size != 0: +# MCpara = loadtxt(initial_pdb_id + '_ratio.dat') +# accept_para = MCpara[4] +# if MCpara[1] > 0.95: +# accept_para *= 1.5 +# elif MCpara[1] < 0.85: +# accept_para /= 1.5 +# else: +# savetxt(initial_pdb_id + '_status.dat',[1]) #else: # accept_para = 0.1 -# MC parameter 1 is the acceptance ratio, which should converge on -# the selected value with a tolerance of 0.05 either side +# The best value for MC parameter 1 is around 0.9 +# so values less than 0.85 and greater than 0.95 are not preferred # and accept_para is adjusted to help bring it within these limits. -# This also happens every 5 steps during the run (lines 173 to 181). +# This also happens every 25 steps during the run (lines 144 to 150). if original_initial_pdb != original_final_pdb: # difference from the target structure is defined as the energy and the minimum is zero. @@ -144,17 +149,16 @@ dist = buildDistMatrix(pdb_ca_temp) En = sum((native_dist - dist)**2) - # Check whether you are heading the right way and accept uphill moves - # depending on the Metropolis criterion. Classically this depends on RT - # but this is subsumed by the unknown units from having a uniform - # spring constant that is set to 1. + # Check whether you are heading the right way and accept uphill moves depending on the Metropolis criterion. + # Classically this depends on RT but these are subsumed by the unknown units from having a uniform spring constant + # that is set to 1. if Ep > En: count3 += 1 pdb_ca = pdb_ca_temp.copy() Ep = En accepted = 1 - elif exp(-(En-Ep)/(Ep)) * accept_para > random(): + elif exp(-(En-Ep)/(Ep * accept_para)) > random(): pdb_ca = pdb_ca_temp.copy() count1 += 1 count2 += 1 @@ -170,15 +174,13 @@ else: f = float(count2)/float(count1) - if (mod(k,5)==0 and not(k==0)): + if (mod(k,25)==0 and not(k==0)): # Update of the accept_para to keep the MC para reasonable # See comment lines 82 to 85. if f > acceptance_ratio + 0.05: - accept_para /= 1.5; + accept_para *= 1.5; elif f < acceptance_ratio - 0.05: - accept_para *= 1.5 - - if accept_para < 0.001: accept_para = 0.001 + accept_para /= 1.5 else: # for exploration based on one structure (two runs) From 174568c60f4814aeb38d246db9ba79fe18c77346 Mon Sep 17 00:00:00 2001 From: James Krieger Date: Tue, 10 Apr 2018 11:27:26 -0400 Subject: [PATCH 3/7] bug fix for two PDBs and one GPU --- comd.tcl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/comd.tcl b/comd.tcl index c63775e..ae0cc23 100644 --- a/comd.tcl +++ b/comd.tcl @@ -1607,8 +1607,13 @@ if { $argc < 3 } { lappend selection1 [lindex $gpus_selected $i] lappend selection2 [lindex $gpus_selected [expr {${i} + [llength $gpus_selected]/2 }]] } - set ::comd::gpus_selection1 [join $selection1 ","] - set ::comd::gpus_selection2 [join $selection2 ","] + if {$i > 0} { + set ::comd::gpus_selection1 [join $selection1 ","] + set ::comd::gpus_selection2 [join $selection2 ","] + } else { + set ::comd::gpus_selection1 $::comd::gpus_selected + set ::comd::gpus_selection2 $::comd::gpus_selected + } } else { set ::comd::gpus_selection1 $::comd::gpus_selected set ::comd::gpus_selection2 $::comd::gpus_selected From 0857e08643f60226a971a7a04363decf0d35a51a Mon Sep 17 00:00:00 2001 From: Amaya Jimenez Date: Thu, 19 Apr 2018 10:29:19 +0200 Subject: [PATCH 4/7] new rms conditions version --- comd.tcl | 214 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 177 insertions(+), 37 deletions(-) diff --git a/comd.tcl b/comd.tcl index c63775e..f614823 100644 --- a/comd.tcl +++ b/comd.tcl @@ -824,6 +824,8 @@ proc ::comd::Prepare_system {} { if {$::comd::gpus_present} { set processes_per_run [expr {[llength [wsplit $::comd::gpus_selection1 ","]] + 1}] + set processes_per_run [expr {[llength [wsplit $::comd::gpus_selection2 ","]] + 1}] + if {[info exists ::comd::num_cores]} { set remainder [expr {$::comd::num_cores % $processes_per_run}] @@ -879,7 +881,11 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$namd_file \"reinitvels \\\$temperature\"" puts $tcl_file "close \$namd_file" puts $tcl_file "puts \$sh_file \"cd ${::comd::output_prefix}_walker1_min\"" - puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection1 \+ppn $processes_per_run min.conf > min0.log \&\"" + if {[expr [llength $::comd::gpus_selected] > 1]} { + puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection1 \+ppn $processes_per_run min.conf > min0.log \&\"" + } else { + puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection1 \+ppn $processes_per_run min.conf > min0.log \"" + } puts $tcl_file "puts \$sh_file \"cd ..\"" if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]} { @@ -927,7 +933,11 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$namd_file \"reinitvels \\\$temperature\"" puts $tcl_file "close \$namd_file" puts $tcl_file "puts \$sh_file \"cd ${::comd::output_prefix}_walker2_min\"" - puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection2 \+ppn $processes_per_run min.conf > min0.log \&\"" + if {[expr [llength $::comd::gpus_selected] > 1]} { + puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection2 \+ppn $processes_per_run min.conf > min0.log \&\"" + } else { + puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection2 \+ppn $processes_per_run min.conf > min0.log \"" + } puts $tcl_file "puts \$sh_file \"cd ..\"" } @@ -993,15 +1003,27 @@ proc ::comd::Prepare_system {} { puts $tcl_file "set all_rmsd(0) \$rmsd" puts $tcl_file "set rmsd_filename rmsd.txt" puts $tcl_file "set rmsd_file \[open \$rmsd_filename w\]" + puts $tcl_file "set rmsd_filename_new rmsd_new.txt" + puts $tcl_file "set rmsd_file_new \[open \$rmsd_filename_new w\]" + puts $tcl_file "set all_rmsd_fixA_walker2(0) \$rmsd" + puts $tcl_file "set all_rmsd_fixB_walker1(0) \$rmsd" puts $tcl_file "puts \$rmsd_file \"\$rmsd\"" + puts $tcl_file "puts \$rmsd_file_new \"\$rmsd, \$rmsd\"" puts $tcl_file "file mkdir ${::comd::output_prefix}_walker2_pro" } puts $tcl_file "file mkdir ${::comd::output_prefix}_walker1_pro" #loop start + puts $tcl_file "set repetition 0" + puts $tcl_file "set repetition_walker1 1" + puts $tcl_file "set repetition_walker2 1" puts $tcl_file "for {set cycle 1} {\$cycle < $::comd::comd_cycle} {incr cycle} {" puts $tcl_file "mol delete all" + + puts $tcl_file "if \{\(\$repetition > 9\)\} \{" + puts $tcl_file "break" + puts $tcl_file "\}" # Check if any files are missing and if so retry the previous cycle puts $tcl_file "if {\[catch {open ${::comd::output_prefix}_walker1_min/walker1_minimized\[expr \$\{cycle\}-1\].coor r} fid\]} {" @@ -1065,15 +1087,19 @@ proc ::comd::Prepare_system {} { if {[info exists ::comd::num_cores]} { puts $tcl_file "puts \$sh_file \"export MKL_NUM_THREADS=$::comd::num_cores\"" } + puts $tcl_file "if \{\(\[expr \$repetition_walker1 == 1\]\)\} \{" puts $tcl_file "puts \$sh_file \"\$python_path anmmc.py starting_walker1.pdb \ walker1_target.pdb $::comd::walker1_pdb $::comd::walker2_pdb \$cycle \$::comd::dev_mag \ \$::comd::step_cutoff \$::comd::accept_para \$::comd::anm_cutoff \$::comd::max_steps \ \>& cycle_\${cycle}_ini_anmmc_log.txt \&\"" + puts $tcl_file "\}" if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]} { + puts $tcl_file "if \{\(\[expr \$repetition_walker2 == 1\]\)\} \{" puts $tcl_file "puts \$sh_file \"\$python_path anmmc.py starting_walker2.pdb \ walker2_target.pdb $::comd::walker1_pdb $::comd::walker2_pdb \$cycle \$::comd::dev_mag \ \$::comd::step_cutoff \$::comd::accept_para \$::comd::anm_cutoff \$::comd::max_steps \ \>& cycle_\${cycle}_fin_anmmc_log.txt \&\"" + puts $tcl_file "\}" } puts $tcl_file "puts \$sh_file \"wait\"" puts $tcl_file "close \$sh_file" @@ -1154,6 +1180,7 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$sh_file \"NAMD=\\\"\$namd2path \\\"\"" # Walker 1 TMD + puts $tcl_file "if \{\(\[expr \$repetition_walker1 == 1\]\)\} \{" puts $tcl_file "set namd_file \[open \[file join \"${::comd::output_prefix}_walker1_pro\" \"pro.conf\"\] w\]" puts $tcl_file "puts \$namd_file \"coordinates ..\/walker1_ionized.pdb\"" puts $tcl_file "puts \$namd_file \"structure ..\/walker1_ionized.psf\"" @@ -1205,11 +1232,17 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$namd_file \"run [expr $::comd::tmd_len*5]\"" puts $tcl_file "close \$namd_file" puts $tcl_file "puts \$sh_file \"cd ${::comd::output_prefix}_walker1_pro\"" - puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection1 \+ppn $processes_per_run pro.conf > pro\$\{cycle\}.log \&\"" + if {[expr [llength $::comd::gpus_selected] > 1]} { + puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection1 \+ppn $processes_per_run pro.conf > pro\$\{cycle\}.log \&\"" + } else { + puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection1 \+ppn $processes_per_run pro.conf > pro\$\{cycle\}.log \"" + } puts $tcl_file "puts \$sh_file \"cd ..\"" + puts $tcl_file "\}" if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]} { # Walker 2 TMD + puts $tcl_file "if \{\(\[expr \$repetition_walker2 == 1\]\)\} \{" puts $tcl_file "set namd_file \[open \[file join \"${::comd::output_prefix}_walker2_pro\" \"pro.conf\"\] w\]" puts $tcl_file "puts \$namd_file \"coordinates ../walker2_ionized.pdb\"" puts $tcl_file "puts \$namd_file \"structure ../walker2_ionized.psf\"" @@ -1261,8 +1294,13 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$namd_file \"run [expr $::comd::tmd_len*5]\"" puts $tcl_file "close \$namd_file" puts $tcl_file "puts \$sh_file \"cd ${::comd::output_prefix}_walker2_pro\"" - puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection2 \+ppn $processes_per_run pro.conf > pro\$\{cycle\}.log \&\"" + if {[expr [llength $::comd::gpus_selected] > 1]} { + puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection2 \+ppn $processes_per_run pro.conf > pro\$\{cycle\}.log \&\"" + } else { + puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection2 \+ppn $processes_per_run pro.conf > pro\$\{cycle\}.log \"" + } puts $tcl_file "puts \$sh_file \"cd ..\"" + puts $tcl_file "\}" } puts $tcl_file "puts \$sh_file \"wait\"" puts $tcl_file "close \$sh_file" @@ -1294,6 +1332,7 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$sh_file \"NAMD=\\\"\$namd2path \\\"\"" # Walker 1 minimization + puts $tcl_file "if \{\(\[expr \$repetition_walker1 == 1\]\)\} \{" puts $tcl_file "set namd_file \[open \[file join \"${::comd::output_prefix}_walker1_min\" \"min.conf\"\] w\]" puts $tcl_file "puts \$namd_file \"coordinates ../walker1_ionized.pdb\"" puts $tcl_file "puts \$namd_file \"structure ../walker1_ionized.psf\"" @@ -1340,11 +1379,17 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$namd_file \"reinitvels \\\$temperature\"" puts $tcl_file "close \$namd_file" puts $tcl_file "puts \$sh_file \"cd ${::comd::output_prefix}_walker1_min\"" - puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection1 \+ppn $processes_per_run min.conf > min\$\{cycle\}.log \&\"" + if {[expr [llength $::comd::gpus_selected] > 1]} { + puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection1 \+ppn $processes_per_run min.conf > min\$\{cycle\}.log \&\"" + } else { + puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection1 \+ppn $processes_per_run min.conf > min\$\{cycle\}.log \"" + } puts $tcl_file "puts \$sh_file \"cd ..\"" + puts $tcl_file "\}" if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]} { # Walker 2 minimization + puts $tcl_file "if \{\(\[expr \$repetition_walker2 == 1\]\)\} \{" puts $tcl_file "set namd_file \[open \[file join \"${::comd::output_prefix}_walker2_min\" \"min.conf\"\] w\]" puts $tcl_file "puts \$namd_file \"coordinates ../walker2_ionized.pdb\"" puts $tcl_file "puts \$namd_file \"structure ../walker2_ionized.psf\"" @@ -1391,8 +1436,13 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$namd_file \"reinitvels \\\$temperature\"" puts $tcl_file "close \$namd_file" puts $tcl_file "puts \$sh_file \"cd ${::comd::output_prefix}_walker2_min\"" - puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection2 \+ppn $processes_per_run min.conf > min\$\{cycle\}.log \&\"" + if {[expr [llength $::comd::gpus_selected] > 1]} { + puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection2 \+ppn $processes_per_run min.conf > min\$\{cycle\}.log \&\"" + } else { + puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection2 \+ppn $processes_per_run min.conf > min\$\{cycle\}.log \"" + } puts $tcl_file "puts \$sh_file \"cd ..\"" + puts $tcl_file "\}" } puts $tcl_file "puts \$sh_file \"wait\"" @@ -1408,25 +1458,6 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \"Finished minimization \$\{cycle\}\"" - # Add the resulting PDBs to DCD files with the other ones from previous cycles - puts $tcl_file "set status \[catch \{exec prody catdcd initr.dcd ${::comd::output_prefix}_walker1_min\/walker1_minimized\$\{cycle\}.dcd -o walker1_trajectory.dcd\} output\]" - puts $tcl_file "set status \[catch \{exec mv walker1_trajectory.dcd initr.dcd\} output\]" - if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]} { - puts $tcl_file "set status \[catch \{exec prody catdcd fintr.dcd ${::comd::output_prefix}_walker2_min\/walker2_minimized\$\{cycle\}.dcd -o walker2_trajectory.dcd\} output\]" - puts $tcl_file "set status \[catch \{exec mv walker2_trajectory.dcd fintr.dcd\} output\]" - } - puts $tcl_file "puts \"Finished concatenating trajectories for cycle \$\{cycle\}\"" - - # If files are missing continue to the end of the loop and the next loop will retry this cycle - puts $tcl_file "if {\[catch {open ${::comd::output_prefix}_walker1_min/walker1_minimized\$\{cycle\}.coor r} fid\]} {" - puts $tcl_file "continue" - puts $tcl_file "}" - if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]} { - puts $tcl_file "if {\[catch {open ${::comd::output_prefix}_walker2_min/walker2_minimized\$\{cycle\}.coor r} fid\]} {" - puts $tcl_file "continue" - puts $tcl_file "}" - } - if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]} { # calculate and output RMSD between the two endpoints if transitioning puts $tcl_file "mol delete all" @@ -1443,7 +1474,112 @@ proc ::comd::Prepare_system {} { puts $tcl_file "set rmsd \[measure rmsd \$sel2 \$sel1\]" puts $tcl_file "set all_rmsd(\$\{cycle\}) \$rmsd" puts $tcl_file "puts \$rmsd_file \"\$rmsd\"" - puts $tcl_file "if \{\(\$rmsd < 1.5)\|\|(\[expr \$all_rmsd\(\[expr \$\{cycle\}\-1\]\) - \$rmsd]\ < 0.15 \)\} \{ break \}" + + puts $tcl_file "mol delete all" + puts $tcl_file "mol load psf walker1_ionized.psf" + puts $tcl_file "mol addfile ${::comd::output_prefix}_walker1_min/walker1_minimized0.coor" + puts $tcl_file "set sel1 \[atomselect top \"name CA\"\]" + puts $tcl_file "set sel1a \[atomselect top all\]" + puts $tcl_file "mol load psf walker2_ionized.psf" + puts $tcl_file "mol addfile ${::comd::output_prefix}_walker2_min/walker2_minimized\${cycle}.coor" + puts $tcl_file "set sel2 \[atomselect top \"name CA\"\]" + puts $tcl_file "set sel2a \[atomselect top all\]" + puts $tcl_file "set trans_mat \[measure fit \$sel2 \$sel1\]" + puts $tcl_file "\$sel2a move \$trans_mat" + puts $tcl_file "set rmsd_fixA_walker2 \[measure rmsd \$sel2 \$sel1\]" + puts $tcl_file "set all_rmsd_fixA_walker2(\$\{cycle\}) \$rmsd_fixA_walker2" + + puts $tcl_file "mol load psf walker1_ionized.psf" + puts $tcl_file "mol addfile ${::comd::output_prefix}_walker1_min/walker1_minimized\${cycle}.coor" + puts $tcl_file "set sel3 \[atomselect top \"name CA\"\]" + puts $tcl_file "set sel3a \[atomselect top all\]" + puts $tcl_file "mol load psf walker2_ionized.psf" + puts $tcl_file "mol addfile ${::comd::output_prefix}_walker2_min/walker2_minimized0.coor" + puts $tcl_file "set sel4 \[atomselect top \"name CA\"\]" + puts $tcl_file "set sel4a \[atomselect top all\]" + puts $tcl_file "set trans_mat \[measure fit \$sel4 \$sel3\]" + puts $tcl_file "\$sel4a move \$trans_mat" + puts $tcl_file "set rmsd_fixB_walker1 \[measure rmsd \$sel4 \$sel3\]" + puts $tcl_file "set all_rmsd_fixB_walker1(\$\{cycle\}) \$rmsd_fixB_walker1" + puts $tcl_file "puts \$rmsd_file_new \"\$rmsd_fixB_walker1, \$rmsd_fixA_walker2\"" + + puts $tcl_file "set repetition_walker1 1" + puts $tcl_file "set repetition_walker2 1" + puts $tcl_file "set repetition_flag 0" + + puts $tcl_file "if \{\(\(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\) < \$rmsd_fixB_walker1\]\) \&\& \(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\) > \$rmsd_fixA_walker2\]\)\)\} \{" + puts $tcl_file "puts \"WALKER1 NEEDS TO BE REPEATED\"" + puts $tcl_file "set repetition \[expr \{\$repetition + 1\}\]" + puts $tcl_file "set repetition_walker1 1" + puts $tcl_file "set repetition_walker2 0" + puts $tcl_file "set repetition_flag 1" + puts $tcl_file "\}" + + puts $tcl_file "if \{\(\(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\) < \$rmsd_fixA_walker2\]\) \&\& \(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\) > \$rmsd_fixB_walker1\]\)\)\} \{" + puts $tcl_file "puts \"WALKER2 NEEDS TO BE REPEATED\"" + puts $tcl_file "set repetition \[expr \{\$repetition + 1\}\]" + puts $tcl_file "set repetition_walker1 0" + puts $tcl_file "set repetition_walker2 1" + puts $tcl_file "set repetition_flag 1" + puts $tcl_file "\}" + + puts $tcl_file "if \{\(\(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\) < \$rmsd_fixA_walker2\]\) \&\& \(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\) < \$rmsd_fixB_walker1\]\)\)\} \{" + puts $tcl_file "puts \"WALKER1 AND WALKER2 NEEDS TO BE REPEATED\"" + puts $tcl_file "set repetition \[expr \{\$repetition + 1\}\]" + puts $tcl_file "set repetition_walker1 1" + puts $tcl_file "set repetition_walker2 1" + puts $tcl_file "set repetition_flag 1" + puts $tcl_file "\}" + + puts $tcl_file "if \{\(\[expr \$repetition_flag == 1\]\)\} \{" + puts $tcl_file "set cycle \[expr \$\{cycle\}-1\]" + puts $tcl_file "continue" + puts $tcl_file "\}" + + puts $tcl_file "if \{\(\$rmsd > \$all_rmsd\(\[expr 0\]\)\)\} \{" + puts $tcl_file "puts \"REPEATING CYCLE BECAUSE OF DIVERGENT CONFORMATIONS\"" + puts $tcl_file "set cycle \[expr \$\{cycle\}-1\]" + puts $tcl_file "set repetition \[expr \{\$repetition + 1\}\]" + puts $tcl_file "set repetition_walker1 1" + puts $tcl_file "set repetition_walker2 1" + puts $tcl_file "continue" + puts $tcl_file "\}" + + puts $tcl_file "set repetition 0" + + #AJ moving this after the continue conditions + # Add the resulting PDBs to DCD files with the other ones from previous cycles + puts $tcl_file "set status \[catch \{exec prody catdcd initr.dcd ${::comd::output_prefix}_walker1_min\/walker1_minimized\$\{cycle\}.dcd -o walker1_trajectory.dcd\} output\]" + puts $tcl_file "set status \[catch \{exec mv walker1_trajectory.dcd initr.dcd\} output\]" + puts $tcl_file "set status \[catch \{exec prody catdcd fintr.dcd ${::comd::output_prefix}_walker2_min\/walker2_minimized\$\{cycle\}.dcd -o walker2_trajectory.dcd\} output\]" + puts $tcl_file "set status \[catch \{exec mv walker2_trajectory.dcd fintr.dcd\} output\]" + puts $tcl_file "puts \"Finished concatenating trajectories for cycle \$\{cycle\}\"" + + # If files are missing continue to the end of the loop and the next loop will retry this cycle + puts $tcl_file "if {\[catch {open ${::comd::output_prefix}_walker1_min/walker1_minimized\$\{cycle\}.coor r} fid\]} {" + puts $tcl_file "continue" + puts $tcl_file "}" + puts $tcl_file "if {\[catch {open ${::comd::output_prefix}_walker2_min/walker2_minimized\$\{cycle\}.coor r} fid\]} {" + puts $tcl_file "continue" + puts $tcl_file "}" + + puts $tcl_file "if \{\(\(\$rmsd < 1.5)\&\&(\[expr \$all_rmsd\(\[expr \$\{cycle\}\-1\]\) - \$rmsd]\ < 0.15 \)\)\} \{ " + puts $tcl_file "puts \"FINISHED WITH CONVERGENT CONFORMATIONS\"" + puts $tcl_file "break" + puts $tcl_file "\}" + + } else { + + # Add the resulting PDBs to DCD files with the other ones from previous cycles + puts $tcl_file "set status \[catch \{exec prody catdcd initr.dcd ${::comd::output_prefix}_walker1_min\/walker1_minimized\$\{cycle\}.dcd -o walker1_trajectory.dcd\} output\]" + puts $tcl_file "set status \[catch \{exec mv walker1_trajectory.dcd initr.dcd\} output\]" + puts $tcl_file "puts \"Finished concatenating trajectories for cycle \$\{cycle\}\"" + + # If files are missing continue to the end of the loop and the next loop will retry this cycle + puts $tcl_file "if {\[catch {open ${::comd::output_prefix}_walker1_min/walker1_minimized\$\{cycle\}.coor r} fid\]} {" + puts $tcl_file "continue" + puts $tcl_file "}" + } # end loop @@ -1599,22 +1735,26 @@ if { $argc < 3 } { set ::comd::gpus_selected [join $::comd::gpus_selected ","] - if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}] || [expr [llength $::comd::gpus_selected] == 1]} { - set gpus_selected [wsplit $::comd::gpus_selected ","] - set selection1 [list] - set selection2 [list] - for {set i 0} {$i < [expr [llength $gpus_selected]/2]} {incr i} { - lappend selection1 [lindex $gpus_selected $i] - lappend selection2 [lindex $gpus_selected [expr {${i} + [llength $gpus_selected]/2 }]] + if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]} { + if {[expr [llength $::comd::gpus_selected] > 1]} { + set gpus_selected [wsplit $::comd::gpus_selected ","] + set selection1 [list] + set selection2 [list] + for {set i 0} {$i < [expr [llength $gpus_selected]/2]} {incr i} { + lappend selection1 [lindex $gpus_selected $i] + lappend selection2 [lindex $gpus_selected [expr {${i} + [llength $gpus_selected]/2 }]] + } + set ::comd::gpus_selection1 [join $selection1 ","] + set ::comd::gpus_selection2 [join $selection2 ","] + } + if {[expr [llength $::comd::gpus_selected] == 1]} { + set ::comd::gpus_selection1 $::comd::gpus_selected + set ::comd::gpus_selection2 $::comd::gpus_selected } - set ::comd::gpus_selection1 [join $selection1 ","] - set ::comd::gpus_selection2 [join $selection2 ","] } else { set ::comd::gpus_selection1 $::comd::gpus_selected set ::comd::gpus_selection2 $::comd::gpus_selected } - puts $::comd::gpus_selection1 - puts [llength [wsplit $::comd::gpus_selection1 ","]] }]} { set ::comd::gpus_present 0 } else { From 2c2af01da3379183d14cccf84e6b4372d297ad06 Mon Sep 17 00:00:00 2001 From: Amaya Jimenez Date: Fri, 20 Apr 2018 16:13:36 +0200 Subject: [PATCH 5/7] modifiying the rmsd conditions --- comd.tcl | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/comd.tcl b/comd.tcl index f614823..18d4a6f 100644 --- a/comd.tcl +++ b/comd.tcl @@ -1009,12 +1009,14 @@ proc ::comd::Prepare_system {} { puts $tcl_file "set all_rmsd_fixB_walker1(0) \$rmsd" puts $tcl_file "puts \$rmsd_file \"\$rmsd\"" puts $tcl_file "puts \$rmsd_file_new \"\$rmsd, \$rmsd\"" + puts $tcl_file "set rmsd_percent \[expr \$\{rmsd\}*0.05\]" puts $tcl_file "file mkdir ${::comd::output_prefix}_walker2_pro" } puts $tcl_file "file mkdir ${::comd::output_prefix}_walker1_pro" #loop start + puts $tcl_file "puts \"TESTING THE NEW COMD VERSION\"" puts $tcl_file "set repetition 0" puts $tcl_file "set repetition_walker1 1" puts $tcl_file "set repetition_walker2 1" @@ -1507,7 +1509,7 @@ proc ::comd::Prepare_system {} { puts $tcl_file "set repetition_walker2 1" puts $tcl_file "set repetition_flag 0" - puts $tcl_file "if \{\(\(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\) < \$rmsd_fixB_walker1\]\) \&\& \(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\) > \$rmsd_fixA_walker2\]\)\)\} \{" + puts $tcl_file "if \{\(\(\[expr \(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\)+\$rmsd_percent\]\) < \$rmsd_fixB_walker1\]\) \&\& \(\[expr \(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\)+\$rmsd_percent\]\) > \$rmsd_fixA_walker2\]\)\)\} \{" puts $tcl_file "puts \"WALKER1 NEEDS TO BE REPEATED\"" puts $tcl_file "set repetition \[expr \{\$repetition + 1\}\]" puts $tcl_file "set repetition_walker1 1" @@ -1515,7 +1517,7 @@ proc ::comd::Prepare_system {} { puts $tcl_file "set repetition_flag 1" puts $tcl_file "\}" - puts $tcl_file "if \{\(\(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\) < \$rmsd_fixA_walker2\]\) \&\& \(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\) > \$rmsd_fixB_walker1\]\)\)\} \{" + puts $tcl_file "if \{\(\(\[expr \(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\)+\$rmsd_percent\]\) < \$rmsd_fixA_walker2\]\) \&\& \(\[expr \(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\)+\$rmsd_percent\]\) > \$rmsd_fixB_walker1\]\)\)\} \{" puts $tcl_file "puts \"WALKER2 NEEDS TO BE REPEATED\"" puts $tcl_file "set repetition \[expr \{\$repetition + 1\}\]" puts $tcl_file "set repetition_walker1 0" @@ -1523,7 +1525,7 @@ proc ::comd::Prepare_system {} { puts $tcl_file "set repetition_flag 1" puts $tcl_file "\}" - puts $tcl_file "if \{\(\(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\) < \$rmsd_fixA_walker2\]\) \&\& \(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\) < \$rmsd_fixB_walker1\]\)\)\} \{" + puts $tcl_file "if \{\(\(\[expr \(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\)+\$rmsd_percent\]\) < \$rmsd_fixA_walker2\]\) \&\& \(\[expr \(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\)+\$rmsd_percent\)\] < \$rmsd_fixB_walker1\]\)\)\} \{" puts $tcl_file "puts \"WALKER1 AND WALKER2 NEEDS TO BE REPEATED\"" puts $tcl_file "set repetition \[expr \{\$repetition + 1\}\]" puts $tcl_file "set repetition_walker1 1" @@ -1536,14 +1538,6 @@ proc ::comd::Prepare_system {} { puts $tcl_file "continue" puts $tcl_file "\}" - puts $tcl_file "if \{\(\$rmsd > \$all_rmsd\(\[expr 0\]\)\)\} \{" - puts $tcl_file "puts \"REPEATING CYCLE BECAUSE OF DIVERGENT CONFORMATIONS\"" - puts $tcl_file "set cycle \[expr \$\{cycle\}-1\]" - puts $tcl_file "set repetition \[expr \{\$repetition + 1\}\]" - puts $tcl_file "set repetition_walker1 1" - puts $tcl_file "set repetition_walker2 1" - puts $tcl_file "continue" - puts $tcl_file "\}" puts $tcl_file "set repetition 0" @@ -1563,7 +1557,7 @@ proc ::comd::Prepare_system {} { puts $tcl_file "continue" puts $tcl_file "}" - puts $tcl_file "if \{\(\(\$rmsd < 1.5)\&\&(\[expr \$all_rmsd\(\[expr \$\{cycle\}\-1\]\) - \$rmsd]\ < 0.15 \)\)\} \{ " + puts $tcl_file "if \{\( \(\$rmsd < 1.5\)\|\| \(\[expr abs\(\$all_rmsd\(\[expr \$\{cycle\}\-1\]\) - \$rmsd\)\] < 0.05 \)\)\} \{ " puts $tcl_file "puts \"FINISHED WITH CONVERGENT CONFORMATIONS\"" puts $tcl_file "break" puts $tcl_file "\}" From 93f2691ee4d0c38e92d526a58202ebc442161c19 Mon Sep 17 00:00:00 2001 From: James Krieger Date: Fri, 20 Apr 2018 10:14:43 -0400 Subject: [PATCH 6/7] modifying the rmsd conditions --- comd.tcl | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/comd.tcl b/comd.tcl index f614823..f55cdbf 100644 --- a/comd.tcl +++ b/comd.tcl @@ -1009,12 +1009,14 @@ proc ::comd::Prepare_system {} { puts $tcl_file "set all_rmsd_fixB_walker1(0) \$rmsd" puts $tcl_file "puts \$rmsd_file \"\$rmsd\"" puts $tcl_file "puts \$rmsd_file_new \"\$rmsd, \$rmsd\"" + puts $tcl_file "set rmsd_percent \[expr \$\{rmsd\}*0.05\]" puts $tcl_file "file mkdir ${::comd::output_prefix}_walker2_pro" } puts $tcl_file "file mkdir ${::comd::output_prefix}_walker1_pro" #loop start + puts $tcl_file "puts \"TESTING THE NEW COMD VERSION\"" puts $tcl_file "set repetition 0" puts $tcl_file "set repetition_walker1 1" puts $tcl_file "set repetition_walker2 1" @@ -1507,7 +1509,7 @@ proc ::comd::Prepare_system {} { puts $tcl_file "set repetition_walker2 1" puts $tcl_file "set repetition_flag 0" - puts $tcl_file "if \{\(\(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\) < \$rmsd_fixB_walker1\]\) \&\& \(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\) > \$rmsd_fixA_walker2\]\)\)\} \{" + puts $tcl_file "if \{\(\(\[expr \(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\)+\$rmsd_percent\]\) < \$rmsd_fixB_walker1\]\) \&\& \(\[expr \(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\)+\$rmsd_percent\]\) > \$rmsd_fixA_walker2\]\)\)\} \{" puts $tcl_file "puts \"WALKER1 NEEDS TO BE REPEATED\"" puts $tcl_file "set repetition \[expr \{\$repetition + 1\}\]" puts $tcl_file "set repetition_walker1 1" @@ -1515,7 +1517,7 @@ proc ::comd::Prepare_system {} { puts $tcl_file "set repetition_flag 1" puts $tcl_file "\}" - puts $tcl_file "if \{\(\(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\) < \$rmsd_fixA_walker2\]\) \&\& \(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\) > \$rmsd_fixB_walker1\]\)\)\} \{" + puts $tcl_file "if \{\(\(\[expr \(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\)+\$rmsd_percent\]\) < \$rmsd_fixA_walker2\]\) \&\& \(\[expr \(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\)+\$rmsd_percent\]\) > \$rmsd_fixB_walker1\]\)\)\} \{" puts $tcl_file "puts \"WALKER2 NEEDS TO BE REPEATED\"" puts $tcl_file "set repetition \[expr \{\$repetition + 1\}\]" puts $tcl_file "set repetition_walker1 0" @@ -1523,7 +1525,7 @@ proc ::comd::Prepare_system {} { puts $tcl_file "set repetition_flag 1" puts $tcl_file "\}" - puts $tcl_file "if \{\(\(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\) < \$rmsd_fixA_walker2\]\) \&\& \(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\) < \$rmsd_fixB_walker1\]\)\)\} \{" + puts $tcl_file "if \{\(\(\[expr \(\[expr \$all_rmsd_fixA_walker2\(\[expr \$\{cycle\}-1\]\)+\$rmsd_percent\]\) < \$rmsd_fixA_walker2\]\) \&\& \(\[expr \(\[expr \$all_rmsd_fixB_walker1\(\[expr \$\{cycle\}-1\]\)+\$rmsd_percent\)\] < \$rmsd_fixB_walker1\]\)\)\} \{" puts $tcl_file "puts \"WALKER1 AND WALKER2 NEEDS TO BE REPEATED\"" puts $tcl_file "set repetition \[expr \{\$repetition + 1\}\]" puts $tcl_file "set repetition_walker1 1" @@ -1536,15 +1538,6 @@ proc ::comd::Prepare_system {} { puts $tcl_file "continue" puts $tcl_file "\}" - puts $tcl_file "if \{\(\$rmsd > \$all_rmsd\(\[expr 0\]\)\)\} \{" - puts $tcl_file "puts \"REPEATING CYCLE BECAUSE OF DIVERGENT CONFORMATIONS\"" - puts $tcl_file "set cycle \[expr \$\{cycle\}-1\]" - puts $tcl_file "set repetition \[expr \{\$repetition + 1\}\]" - puts $tcl_file "set repetition_walker1 1" - puts $tcl_file "set repetition_walker2 1" - puts $tcl_file "continue" - puts $tcl_file "\}" - puts $tcl_file "set repetition 0" #AJ moving this after the continue conditions @@ -1563,7 +1556,7 @@ proc ::comd::Prepare_system {} { puts $tcl_file "continue" puts $tcl_file "}" - puts $tcl_file "if \{\(\(\$rmsd < 1.5)\&\&(\[expr \$all_rmsd\(\[expr \$\{cycle\}\-1\]\) - \$rmsd]\ < 0.15 \)\)\} \{ " + puts $tcl_file "if \{\( \(\$rmsd < 1.5\)\|\| \(\[expr abs\(\$all_rmsd\(\[expr \$\{cycle\}\-1\]\) - \$rmsd\)\] < 0.05 \)\)\} \{ " puts $tcl_file "puts \"FINISHED WITH CONVERGENT CONFORMATIONS\"" puts $tcl_file "break" puts $tcl_file "\}" From c80e7b81ff7be4f2f81fdab0569ded1508d45118 Mon Sep 17 00:00:00 2001 From: James Krieger Date: Wed, 2 May 2018 11:11:50 -0400 Subject: [PATCH 7/7] added back neutralization to GUI and fixed tmd_len and min_length --- comd.tcl | 74 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/comd.tcl b/comd.tcl index f55cdbf..48ccfd6 100644 --- a/comd.tcl +++ b/comd.tcl @@ -285,6 +285,22 @@ constraint of preserving the ratio of 20 water molecules per probe molecule."}] grid [label $mfaio.separatpr_label -width 6] \ -row 1 -column 5 -sticky w + grid [button $mfaio.neutralize_help -text "?" -width 1 -padx 0 -pady 0 -command { + tk_messageBox -type ok -title "HELP" \ + -message "By default, counter ions will be added to neutralize a charged \ +system. A charged system (if the protein is charged) may be obtained by unchecking this option."}] \ + -row 0 -column 6 -sticky w + grid [label $mfaio.neutralize_label -text "Add counter ions: " -width 21] \ + -row 0 -column 7 -sticky w + grid [checkbutton $mfaio.neutralize_check -width 1 \ + -variable ::comd::neutralize] \ + -row 0 -column 8 -sticky e + grid [entry $mfaio.salt_conc_entry -width 13 \ + -textvariable ::comd::salt_concentration] \ + -row 0 -column 9 -columnspan 2 -sticky w + $mfaio.neutralize_check select + + pack $mfaio -side top -ipadx 0 -ipady 5 -fill x -expand 1 #Topology files @@ -351,7 +367,7 @@ based on topology parameters provided. Suggested file extension is .top but othe -message "After running targeted molecular dynamics simulations the walker2 structure needs to be equilibrated into a stable state. Longer minimization creates more stable structures which will guarantee users have a stable targeted molecular dynamics simulation. The units are in ps. "}] \ -row 0 -column 6 -sticky w - grid [label $mfamo.length_label -text "Minimization length (ps): " -width 21] \ + grid [label $mfamo.length_label -text "Minimization length (steps): " -width 21] \ -row 0 -column 7 -sticky w grid [entry $mfamo.length_entry -width 17 \ -textvariable ::comd::min_length] \ @@ -875,9 +891,9 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$namd_file \"outputEnergies $::comd::min_length\"" puts $tcl_file "puts \$namd_file \"outputPressure $::comd::min_length\"" puts $tcl_file "puts \$namd_file \"restartfreq $::comd::min_length\"" - puts $tcl_file "puts \$namd_file \"dcdfreq [expr $::comd::min_length*5]\"" - puts $tcl_file "puts \$namd_file \"xstfreq [expr $::comd::min_length*5]\"" - puts $tcl_file "puts \$namd_file \"minimize [expr $::comd::min_length*5]\"" + puts $tcl_file "puts \$namd_file \"dcdfreq $::comd::min_length\"" + puts $tcl_file "puts \$namd_file \"xstfreq $::comd::min_length\"" + puts $tcl_file "puts \$namd_file \"minimize $::comd::min_length\"" puts $tcl_file "puts \$namd_file \"reinitvels \\\$temperature\"" puts $tcl_file "close \$namd_file" puts $tcl_file "puts \$sh_file \"cd ${::comd::output_prefix}_walker1_min\"" @@ -927,9 +943,9 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$namd_file \"outputEnergies $::comd::min_length\"" puts $tcl_file "puts \$namd_file \"outputPressure $::comd::min_length\"" puts $tcl_file "puts \$namd_file \"restartfreq $::comd::min_length\"" - puts $tcl_file "puts \$namd_file \"dcdfreq [expr $::comd::min_length*5]\"" - puts $tcl_file "puts \$namd_file \"xstfreq [expr $::comd::min_length*5]\"" - puts $tcl_file "puts \$namd_file \"minimize [expr $::comd::min_length*5]\"" + puts $tcl_file "puts \$namd_file \"dcdfreq $::comd::min_length\"" + puts $tcl_file "puts \$namd_file \"xstfreq $::comd::min_length\"" + puts $tcl_file "puts \$namd_file \"minimize $::comd::min_length\"" puts $tcl_file "puts \$namd_file \"reinitvels \\\$temperature\"" puts $tcl_file "close \$namd_file" puts $tcl_file "puts \$sh_file \"cd ${::comd::output_prefix}_walker2_min\"" @@ -1220,18 +1236,18 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$namd_file \"langevinHydrogen on\"" puts $tcl_file "puts \$namd_file \"TMD on\"" puts $tcl_file "puts \$namd_file \"TMDk $::comd::spring_k\"" - puts $tcl_file "puts \$namd_file \"TMDOutputFreq [expr $::comd::tmd_len*1]\"" + puts $tcl_file "puts \$namd_file \"TMDOutputFreq [expr $::comd::tmd_len*100]\"" puts $tcl_file "puts \$namd_file \"TMDFile ..\/walker1_adjust.pdb\"" puts $tcl_file "puts \$namd_file \"TMDFirstStep 0\"" - puts $tcl_file "puts \$namd_file \"TMDLastStep [expr $::comd::tmd_len*5]\"" + puts $tcl_file "puts \$namd_file \"TMDLastStep [expr $::comd::tmd_len*500]\"" puts $tcl_file "puts \$namd_file \"outputname \\\$outputname\"" puts $tcl_file "puts \$namd_file \"restartname \\\$restartname\"" - puts $tcl_file "puts \$namd_file \"outputEnergies [expr $::comd::tmd_len*1]\"" - puts $tcl_file "puts \$namd_file \"outputPressure [expr $::comd::tmd_len*1]\"" - puts $tcl_file "puts \$namd_file \"restartfreq [expr $::comd::tmd_len*1]\"" - puts $tcl_file "puts \$namd_file \"dcdfreq [expr $::comd::tmd_len*1]\"" - puts $tcl_file "puts \$namd_file \"xstfreq [expr $::comd::tmd_len*1]\"" - puts $tcl_file "puts \$namd_file \"run [expr $::comd::tmd_len*5]\"" + puts $tcl_file "puts \$namd_file \"outputEnergies [expr $::comd::tmd_len*100]\"" + puts $tcl_file "puts \$namd_file \"outputPressure [expr $::comd::tmd_len*100]\"" + puts $tcl_file "puts \$namd_file \"restartfreq [expr $::comd::tmd_len*100]\"" + puts $tcl_file "puts \$namd_file \"dcdfreq [expr $::comd::tmd_len*100]\"" + puts $tcl_file "puts \$namd_file \"xstfreq [expr $::comd::tmd_len*100]\"" + puts $tcl_file "puts \$namd_file \"run [expr $::comd::tmd_len*500]\"" puts $tcl_file "close \$namd_file" puts $tcl_file "puts \$sh_file \"cd ${::comd::output_prefix}_walker1_pro\"" if {[expr [llength $::comd::gpus_selected] > 1]} { @@ -1282,18 +1298,18 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$namd_file \"langevinHydrogen on\"" puts $tcl_file "puts \$namd_file \"TMD on\"" puts $tcl_file "puts \$namd_file \"TMDk $::comd::spring_k\"" - puts $tcl_file "puts \$namd_file \"TMDOutputFreq [expr $::comd::tmd_len*1]\"" + puts $tcl_file "puts \$namd_file \"TMDOutputFreq [expr $::comd::tmd_len*100]\"" puts $tcl_file "puts \$namd_file \"TMDFile ..\/walker2_adjust.pdb\"" puts $tcl_file "puts \$namd_file \"TMDFirstStep 0\"" - puts $tcl_file "puts \$namd_file \"TMDLastStep [expr $::comd::tmd_len*5]\"" + puts $tcl_file "puts \$namd_file \"TMDLastStep [expr $::comd::tmd_len*500]\"" puts $tcl_file "puts \$namd_file \"outputname \\\$outputname\"" puts $tcl_file "puts \$namd_file \"restartname \\\$restartname\"" - puts $tcl_file "puts \$namd_file \"outputEnergies [expr $::comd::tmd_len*1]\"" - puts $tcl_file "puts \$namd_file \"outputPressure [expr $::comd::tmd_len*1]\"" - puts $tcl_file "puts \$namd_file \"restartfreq [expr $::comd::tmd_len*1]\"" - puts $tcl_file "puts \$namd_file \"dcdfreq [expr $::comd::tmd_len*1]\"" - puts $tcl_file "puts \$namd_file \"xstfreq [expr $::comd::tmd_len*1]\"" - puts $tcl_file "puts \$namd_file \"run [expr $::comd::tmd_len*5]\"" + puts $tcl_file "puts \$namd_file \"outputEnergies [expr $::comd::tmd_len*100]\"" + puts $tcl_file "puts \$namd_file \"outputPressure [expr $::comd::tmd_len*100]\"" + puts $tcl_file "puts \$namd_file \"restartfreq [expr $::comd::tmd_len*100]\"" + puts $tcl_file "puts \$namd_file \"dcdfreq [expr $::comd::tmd_len*100]\"" + puts $tcl_file "puts \$namd_file \"xstfreq [expr $::comd::tmd_len*100]\"" + puts $tcl_file "puts \$namd_file \"run [expr $::comd::tmd_len*500]\"" puts $tcl_file "close \$namd_file" puts $tcl_file "puts \$sh_file \"cd ${::comd::output_prefix}_walker2_pro\"" if {[expr [llength $::comd::gpus_selected] > 1]} { @@ -1432,9 +1448,9 @@ proc ::comd::Prepare_system {} { puts $tcl_file "puts \$namd_file \"outputEnergies $::comd::min_length\"" puts $tcl_file "puts \$namd_file \"outputPressure $::comd::min_length\"" puts $tcl_file "puts \$namd_file \"restartfreq $::comd::min_length\"" - puts $tcl_file "puts \$namd_file \"dcdfreq [expr $::comd::min_length*5]\"" - puts $tcl_file "puts \$namd_file \"xstfreq [expr $::comd::min_length*5]\"" - puts $tcl_file "puts \$namd_file \"minimize [expr $::comd::min_length*5]\"" + puts $tcl_file "puts \$namd_file \"dcdfreq $::comd::min_length\"" + puts $tcl_file "puts \$namd_file \"xstfreq $::comd::min_length\"" + puts $tcl_file "puts \$namd_file \"minimize $::comd::min_length\"" puts $tcl_file "puts \$namd_file \"reinitvels \\\$temperature\"" puts $tcl_file "close \$namd_file" puts $tcl_file "puts \$sh_file \"cd ${::comd::output_prefix}_walker2_min\"" @@ -1650,11 +1666,11 @@ if { $argc < 3 } { } if {$index eq 8} { set ::comd::min_length [lindex $argv $index] - set ::comd::min_length [expr int($::comd::min_length * 100)] + set ::comd::min_length [expr int($::comd::min_length)] } if {$index eq 9} { set ::comd::tmd_len [lindex $argv $index] - set ::comd::tmd_len [expr int($::comd::tmd_len * 100)] + set ::comd::tmd_len [expr int($::comd::tmd_len)] } if {$index eq 10} {set ::comd::anm_cutoff [lindex $argv $index]} if {$index eq 11} {set ::comd::max_steps [lindex $argv $index]} @@ -1682,7 +1698,7 @@ if { $argc < 3 } { if {$index eq 5} {set ::comd::dev_mag 0} if {$index eq 6} {set ::comd::accept_para ""} if {$index eq 7} {set ::comd::step_cutoff 0} - if {$index eq 8} {set ::comd::min_length 100} + if {$index eq 8} {set ::comd::min_length 500} if {$index eq 9} {set ::comd::tmd_len 10} if {$index eq 10} {set ::comd::anm_cutoff ""} if {$index eq 11} {set ::comd::max_steps [lindex $argv $index]}