コード例 #1
0
import sys, re
from lnx_util import parseInput, print_help
import subprocess


inputP= parseInput(sys.argv[1:])
paraOpt = '-flog -h'.split()

helpdoc=\
'''
Usage! ./prog.py
        -flog run1_0.log  ; log file from any replica
        -h   ; print help information 
'''

print_help(inputP, paraOpt, helpdoc)
finm = inputP['-flog']

rate = 0.25

exe = 'grep \'Repl  fake T\' run1_0.log '
p= subprocess.Popen( exe,  shell=True, stdout=subprocess.PIPE)
temperature = [ float(i) for i in   re.findall('\d*\.*\d*', p.stdout.readline() ) if len(i) >0 ]

exe = 'grep  -A 2 \'Repl  average probabilities:\' run1_0.log  | tail -n 1 '
p= subprocess.Popen( exe,  shell=True, stdout=subprocess.PIPE)
prob = [ float(i) for i in   re.findall('\d*\.*\d*', p.stdout.readline() ) if len(i) >0 ]

new_temp = [ 0 for i in range(len(temperature))  ]
new_temp[0]= 323.0
コード例 #2
0
ファイル: rest_main.py プロジェクト: harryhk/MD-tools
    "Usage! ./prog.py \n"
    "       -top           top1  ; topology file for solutes that need rescale\n"
    "       -bondedTop     top2  ; force field file that contains bonded and non_boned interactions\n"
    "       -nonbondedTop  top3  ;\n"
    "       -otop          outTop1 ; topology modified from top1\n"
    "       -obonded       outTopbonded ; topology modified for bonded\n"
    "       -ononbonded    outTopnonbonded ; topology modified for nonbonded\n"
    "       -T1            323 k  ; \n"
    "       -T2            600 k  ; gamma = beta_2 / beta_1      \n"
    "                              ; charge: q_i = sqrt(gamma) *q_i ;\n"
    "                              ; vdw   : epsilon_i = epsilon_i * gamma  ; i belongs to solute  ;\n"
    "       -sep                  ; when sep flag is set, we print the topology as an individual top rather than free energy format \n"
    "        -h                    ; print help doc \n"
)

lnx_util.print_help(inputP, paraOpt, helpdoc)

t1 = float(inputP["-T1"])
t2 = float(inputP["-T2"])
gamma = t1 / t2
print "gamma: %5.3f" % gamma

solute_top = rest_lipid_top.Topology(inputP["-top"], gamma)
bondedff = rest_force_field_top.BondedForceField(inputP["-bondedTop"], solute_top.bondMap, gamma)
nonbondedff = rest_force_field_top.NoneBondedForceField(inputP["-nonbondedTop"], solute_top.nameMap, gamma)

if inputP.has_key("-sep"):
    solute_top.lambda_display(open(inputP["-otop"], "w"))
else:
    solute_top.display(open(inputP["-otop"], "w"))