| 1 |
#!/usr/bin/perl -wd |
| 2 |
$pi = 3.141592674; |
| 3 |
# Grossfield's code uses this conversion |
| 4 |
$kJpkcal = 4.1868; |
| 5 |
@datafiles = <../data/p*dihed.xvg>; |
| 6 |
|
| 7 |
# make new datafiles |
| 8 |
@locations = (); |
| 9 |
foreach $f (@datafiles) { |
| 10 |
open(IN,"$f");@lines =<IN>;close(IN); |
| 11 |
@v = split(/\//,$f); |
| 12 |
$fl = $v[$#v]; |
| 13 |
push(@locations,$fl); |
| 14 |
open(OUT,">data/$fl"); |
| 15 |
foreach $l (@lines) { |
| 16 |
|
| 17 |
if ($l =~ /^@/) { |
| 18 |
$l = "#".$l; |
| 19 |
} |
| 20 |
if ($l =~ /xtc/) { |
| 21 |
chomp($l); |
| 22 |
} |
| 23 |
print OUT "$l"; |
| 24 |
} |
| 25 |
close(OUT); |
| 26 |
} |
| 27 |
|
| 28 |
open(IN, "centers.dat");@lines =<IN>;close(IN); |
| 29 |
open(OUT,">metadata.dat"); |
| 30 |
for ($i=0;$i<=$#lines;$i++) { |
| 31 |
$fname = "data/prod$i"."_dihed.xvg"; |
| 32 |
($loc,$spring) = split(/\s+/,$lines[$i]); |
| 33 |
$spring *= (($pi/180)**2)/($kJpkcal); |
| 34 |
print OUT "$fname $loc $spring\n"; |
| 35 |
} |
| 36 |
close(OUT); |
| 37 |
|