[Bio] / FortyEightMeta / reload_job_sims.pl Repository:
ViewVC logotype

View of /FortyEightMeta/reload_job_sims.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Wed Oct 8 19:55:11 2008 UTC (11 years, 5 months ago) by olson
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, mgrast_dev_05262011, mgrast_dev_04082011, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, mgrast_dev_10262011, mgrast_dev_02212011, mgrast_release_3_0, mgrast_dev_03252011, mgrast_rel_2008_1110_v2, mgrast_release_3_0_4, mgrast_release_3_0_2, mgrast_release_3_0_3, mgrast_release_3_0_1, mgrast_dev_03312011, mgrast_release_3_1_2, mgrast_release_3_1_1, mgrast_release_3_1_0, mgrast_dev_04132011, mgrast_dev_04012011, mgrast_rel_2008_1110, myrast_33, mgrast_dev_04052011, mgrast_dev_02222011, HEAD
script to reload all sims for a mgrast job.

#
# Reload all the sims for a job.
#

use strict;
use File::Basename;
use GenomeMeta;
use Job48;
use JobStage;
use SGE;
use FileHandle;

STDOUT->autoflush(1);

@ARGV == 1 or die "Usage: $0 job-dir\n";

my $jobdir = shift;

-d $jobdir or die "$0: job dir $jobdir does not exist\n";

my $STAGE = "reload_sims";
my $stage = new JobStage('Job48', $STAGE, $jobdir);
$stage or die "Cannot create job for $jobdir\n";

my $job_id = basename($jobdir);
my $job = $stage->job();

my $meta = $job->meta;

print "Reloading sims for $jobdir\n";

my $proc = "$jobdir/proc";
chdir($proc) or $stage->fatal("cannot chdir $proc: $!");

for my $taskfile (<$proc/*/task.list>)
{
    my $simdir = dirname($taskfile);
    open(TF, "<", $taskfile) or die "cannot open $taskfile: $!";
    print "$taskfile\n";
    while (<TF>)
    {
	chomp;
	my($id, @rest) = split(/\t/);
	print "$id ";
	my @cmd = ("$FIG_Config::bin/mg_load_sims", $jobdir, $simdir, $id);
	my $rc = system(@cmd);
	$rc == 0 or die "failed with $rc: $@cmd\n";
    }
    print "\n";
    close(TF);
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3