#!/usr/bin/perl -w
###########################################################
#
#ModelEvaluator: Evaluate Model Quality Using SVM and 1D and 2D 
#Structural Features
#
#Author: Jianlin Cheng
#Email: jianlin.cheng@gmail.com
#All rights reserved.
##########################################################

#######Customize settings here#############################
#
#set installation directory of SVMcon 
$install_dir = "/exports/store1/tool/model_eva1.0/";

######End of Customization#################################


################Don't Change the code below##############

$bin_dir = "${install_dir}bin/";
$model_dir = "${install_dir}model/";
$script_dir = "${install_dir}script/";

if ( ! -d $bin_dir || ! -d $model_dir || ! -d $script_dir
   )
{
	die "some sub directories don't exist. check the installation tar ball.\n";
}

print "generate script...\n";
open(SERVER_SH, ">$bin_dir/model_eval.sh") || die "can't write a shell script.\n";
print SERVER_SH "#!/bin/sh\n#evaluate protein model.\n";
print SERVER_SH "if [ \$# -ne 3 ]\n";
print SERVER_SH "then\n\techo \"need 3 parameters: potein fasta sequence file, 1d and 2d feature dir, model file in pdb format.\"\n\texit 1\nfi\n";
print SERVER_SH "${script_dir}model_eval.pl $install_dir \$1 \$2 \$3 \n"; 
close SERVER_SH;

`chmod 755 $bin_dir/model_eval.sh`; 


