#!/usr/local/bin/perl -w
#takes all the .res files in the current directory one for each pdb file and reformats them
#into 1 tab delimited results file in tab delimited file with each line: 
# pdb file name shellforCA1 shellforca2 ....

open (REPORT, ">report.txt")||die "could not create report file";

@files=qw(`ls *.res`);

while (<@files>){
	#print $_ ."\n";
	(/(.*)\.res/);
	print REPORT $1."\t";
	open (STRUCRESULT, $_);
	while(<STRUCRESULT>){
		#the individual res files have name of intermediate pdb file that each CA 
		#fails to get included in  starting from 0
		#ie  something in the first convex hull has num 0

		#print $_."\n";
		/(\d+).pdb/;
		#print $1;
		print REPORT $1."\t";
	}
	close STRUCRESULT;
	print REPORT "\n";
}

close REPORT;
