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

View of /FigKernelScripts/run_all_inference.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Mon Aug 1 20:05:13 2011 UTC (8 years, 3 months ago) by olson
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, rast_rel_2014_0912, rast_rel_2014_0729, mgrast_release_3_1_2, mgrast_release_3_1_1, rast_rel_2011_0928, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_10262011, HEAD
Changes since 1.1: +9 -2 lines
Run on all genomes; update anything either missing a subsystems file or that haven't been updated in 2 days.

#
# Run rapid_subsystem_inference_batch across all complete genomes.
#

use strict;
use FIG;
use FIG_Config;

my $fig = new FIG;

@ARGV == 1 or @ARGV == 2 or die "Usage: run_all_inference missing-in-subsystems-file [evidence.log]\n";

my $missing = shift;
my $evidence = shift;

my $tmp = "$FIG_Config::temp/runall.$$";
open(TMP, ">", $tmp) or die "Cannot write $tmp: $!";

my $now = time;
for my $genome (sort { &FIG::by_genome_id($a, $b) } $fig->genomes())
{
    my $dir = $fig->organism_directory($genome);
    my @s = stat("$dir/Subsystems/subsystems");
    if (!@s || ($now - $s[9] > 2 * 86400))
    {
	print "process $dir\n";
	&FIG::verify_dir("$dir/Subsystems");
	print TMP join("\t", "$dir/assigned_functions", "$dir/Subsystems/subsystems", "$dir/Subsystems/bindings"), "\n";
    }
}
close(TMP);

my $cmd = "$FIG_Config::bin/rapid_subsystem_inference_batch --missing $missing $evidence < $tmp";
print "$cmd\n";
my $rc = system($cmd);
if ($rc != 0)
{
    die "fail: $rc\n";
}

unlink($tmp);
    

    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3