gde_linux/bin/newDATASET.pl~
2022-03-07 20:43:05 +00:00

37 lines
815 B
Perl
Executable file

#!/usr/bin/perl
my $name = shift;
my $file = shift;
open(MENUFILE, "/usr/local/biotools/GDE/CORE/.GDEmenus")
or die "cannot open menu file, sorry\n";
$newFileName = "/usr/local/biotools/GDE/CORE/.GDEmenusNew";
open(NEWFILE, ">$newFileName");
READLOOP:
while (<MENUFILE>){
print NEWFILE;
if (/^menu:seq. datasets/){
print "FOUND\n";
print NEWFILE "item:$name\n";
print NEWFILE "itemmethod:readseq /usr/local/biotools/GDE/db/$file -a -f2 > OUTPUTFILE;/bin/rm -f OUTFILE.tmp\n";
print NEWFILE "out:OUTPUTFILE\n";
print NEWFILE "outformat:genbank\n\n";\
last READLOOP;
}
}
while (<MENUFILE>){
print NEWFILE;
}
close(NEWFILE);
close(MENUFILE);
system("cp $newFileName /usr/local/biotools/GDE/CORE/.GDEmenus")
or die "cannot replace old menu file\n";