[Bio] / FigKernelScripts / process_new_sims.pl Repository:
ViewVC logotype

View of /FigKernelScripts/process_new_sims.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Mon Dec 1 20:46:40 2003 UTC (16 years, 7 months ago) by efrank
Branch: MAIN
CVS Tags: V00-00-01, delong-01, delong-02, V00-00-00

Makefile:
	get it to work with the release tools

All the rest:
	had to rename foo to foo.pl so that makefiles could recognize
	perl source from, say, Makefiles and READMEs

use FIG;

$usage = "usage: process_new_sims NR SimsDir Prefix EnhancedSimsDir";

(($nr = shift @ARGV) && (-s $nr) &&
 ($from_dir = shift @ARGV) &&
 ($prefix = shift @ARGV) &&
 ($to_dir = shift @ARGV)
 ) || die $usage;

opendir(FROM,$from_dir) || die "could not open $from_dir";
@to_process = grep { $_ !~ /^\./ } readdir(FROM);
closedir(FROM);

(-d $to_dir) || mkdir($to_dir,0777) || die "could not make $to_dir";

foreach $file (@to_process)
{
    print STDERR "processing $file\n";
    my $base = ($file =~ /^(\S+).gz$/) ? $1 : $file;

    if (-e "$to_dir/$prefix.$base")
    {
	print STDERR "$to_dir/$base already exists - skipping\n";
    }
    else
    {
	if ($file =~ /^(\S+)\.gz$/)
	{
	    &FIG::run("zcat $from_dir/$file | reduce_sims | reformat_sims $nr > $to_dir/$prefix.$base");
	}
	else
	{
	    &FIG::run("reduce_sims < $from_dir/$file | reformat_sims $nr > $to_dir/$prefix.$file");
	}
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3