#!/usr/bin/perl

my $path="$ARGV[0]";
$path=~s/[\/]$//;
opendir(DIR, $path) or die "can't open $path: $!\n";
my @files=readdir(DIR);
closedir(DIR);
foreach my $file (@files){
	next if $file=~/^\.\.?$/;
	my $patron="NA-".$file;
	my $patron3="NPN-".$file;
	my $patron2="NN-".$file;
	$patron=~s/cnr$/txt/;
	$patron2=~s/cnr$/txt/;
	$patron3=~s/cnr$/txt/;
	$file=$path."/".$file;
	#print "$patron\n";
	system("perl BAO3-JMD.pl $file patron-PerlBrut_NA.txt > $patron");
	#print "$patron2\n";
	system("perl BAO3-JMD.pl $file patron-PerlBrut_NN.txt > $patron2");
	#print "$patron3\n";
	system("perl BAO3-JMD.pl $file patron-PerlBrut_NPN.txt > $patron3");
} 