########
#	Ahmet R. Ozturk
# 	Emili Lab, University of Toronto, Canada
#	August 28, 2006
#	e-mail: ahmetrasit@gmail.com
########
#	This file transforms given BIND XML files into PSI MI 1.0 format.
#	You need to give the name of files to be converted. XSLT file should be in the same directory.
#	Resulting file will have a trailler string as '.psimi10_v1.16.xml' and a 'BIND' tag in front of the file name.


use strict;

while (<>){
	chomp;
	if ($_){
		print "Starting $_ .. \n";

		# uncomment the following line if you are running this script for the same list multiple times and want to skip the already converted ones
		#next if (-e "$_.psimi10_v1.16.xml");

		`xsltproc --timing BindXml_To_PsiMi1.0_converter.xslt $_ > BIND_$_.psimi10.xml`;
		print "$_ is done! \n";
	}
}
print "\nAll files are tried to be converted\nPlease check if there are some errors.\n";
print "It took " . (time - $^T) . " seconds\n";