#!/usr/bin/perl
#usage: ala_get_ref *.pxyz

$molinfo="molinfo.ala";
die "be sure the molinfo file exists here.\n" unless ( -e $molinfo);

foreach $file (@ARGV)
{
$basename=substr $file,0,-5;
@base_path=split(/\//, $basename);
$pxyzname=@base_path[@base_path-1].".pxyz";
$gradname=@base_path[@base_path-1].".grad";
$d3grad=@base_path[@base_path-1].".d3.xyz.d3grad";
$refname=@base_path[@base_path-1].".d3.ref";

$cmd1="pxyz_2vxyz $pxyzname |grep -v MW3| grep -v MW2 |chunk 2 10000|ref_gen_step1_cord $molinfo|ref_upd_pqs_frc $gradname|ref_upd_d3_frc $d3grad |ref_upd_net |xyz_add_msite Ow Hw Hw Mw|ref_fix_msite Mw |xyz_fix_linenu > $refname";

system($cmd1);
}


