[Bio] / FortyEight / batch_rast.pl Repository:
ViewVC logotype

View of /FortyEight/batch_rast.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Mon Oct 26 21:23:37 2009 UTC (10 years, 2 months ago) by olson
Branch: MAIN
New batch script

use strict;
use Carp;
use Job48;
use FIG_Config;
use FIG;

#
# Run a jobdirectory in one shot. For batch offload to a remote cluster that
# doesn't have our scheduler, etc available.
#

#
# Stages are as follows; for now this is a copy and paste exercise from
# FortyEight/check_jobs.pl. Use caution, don't run with scissors.
#

#
# upload
# rp
# Check status of keep_genecalls, then qc
# Check status of correction, then correction
# preprocess_sims
# sims
# bbhs
# auto_assign
# glue_contigs
# pchs
# scenario
# export
#

@ARGV == 1 or die "Usage: $0 jobdir\n";

my $job_dir = shift;

my $job = new Job48($job_dir);

&do_upload($job);
&do_rp($job);
&do_qc($job);
&do_correction($job);
&do_sims_preprocess($job);
&do_sims($job);
&do_bbhs($job);
&do_auto_assign($job);
&do_glue_contigs($job);
&do_pchs($job);
&do_scenario($job);
&do_export($job);

sub do_upload
{
    my($job) = @_;
    return;
}

sub do_rp
{
    my($job) = @_;
    &run("$FIG_Config::bin/rp_rapid_propagation", $job->dir);
}

sub do_qc
{
    my($job) = @_;

    if ($job->meta->get_metadata("keep_genecalls"))
    {
	$job->meta->add_log_entry($0, "keep_genecalls is enabled: marking qc as complete");
	$job->meta->set_metadata("status.qc", "complete");
	return;
    }

    &run("$FIG_Config::bin/rp_quality_check", $job->dir);
}

sub do_correction
{
    my($job) = @_;

    if ($job->meta->get_metadata("keep_genecalls"))
    {
	$job->meta->add_log_entry($0, "keep_genecalls is enabled: marking correction as complete");
	$job->meta->set_metadata("status.correction", "complete");
	return;
    }

    my $correction_list = $job->meta->get_metadata("correction.request");
    
    my $correction_str = join(",", @$correction_list);
    &run("$FIG_Config::bin/rp_correction", $job->dir, $correction_str);
}

sub do_sims_preprocess
{
    my($job) = @_;
}

sub do_sims
{
    my($job) = @_;
}

sub do_bbhs
{
    my($job) = @_;
}

sub do_auto_assign
{
    my($job) = @_;
}

sub do_glue_contigs
{
    my($job) = @_;
}

sub do_pchs
{
    my($job) = @_;
}

sub do_scenario
{
    my($job) = @_;
}

sub do_export
{
    my($job) = @_;
}


sub run
{
    my(@cmd) = @_;

    print "Start: @cmd\n";
    my $rc = system(@cmd);
    if ($rc != 0)
    {
	confess "Cmd failed with rc=$rc: @cmd\n";
    }
    print "Done: @cmd\n";
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3