Tuesday, February 22, 2011

scripts

for extracting particular frame from a trajectory

shootingextract.py
#!/usr/bin/env python

import os

# loop trjconv command - extract pdb from each traj, write to a file
infile = open('default.dat', 'r')

while 1:
line = infile.readline()
val = line[:-1].split()
print val[0],val[1]
m=val[0]
n =val[1]
print m,n
if not line:
break
line=line[:-1]
# print "Processing configuration "line+"...\n";

os.system("trjconv -f beta_md"+m+".trr -o shootin"+n+".pdb -s beta_md"+m+".tpr -b "+n+" -e "+n+" -n index.ndx -sep <>/dev/null " )

No comments:

Post a Comment