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

View of /FortyEight/rp_subsystem_coverage_plasmid.pl

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.1 - (download) (as text) (annotate)
Thu Aug 20 15:53:11 2009 UTC (10 years, 6 months ago) by arodri7
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, rast_rel_2014_0912, mgrast_dev_05262011, mgrast_dev_04082011, rast_rel_2010_0928, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, rast_rel_2009_0925, rast_rel_2010_0526, rast_rel_2014_0729, mgrast_dev_02212011, rast_rel_2010_1206, mgrast_release_3_0, mgrast_dev_03252011, rast_rel_2010_0118, rast_rel_2011_0119, 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, rast_rel_2010_0827, myrast_33, rast_rel_2011_0928, mgrast_dev_04052011, mgrast_dev_02222011, mgrast_dev_10262011, HEAD
added subsystem coverage after auto assign

# Perform subsystem coverage.

use strict;
use FIG;
use FIG_Config;
use File::Basename;
use GenomeMeta;
use Carp 'croak';

@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 $hostname = `hostname`;
chomp $hostname;

my $genome = &FIG::file_head("$jobdir/GENOME_ID");
chomp $genome;
$genome =~ /^\d+\.\d+/ or die "$0: Cannnot find genome ID for jobdir $jobdir\n";

my $job = basename($jobdir);

my $meta_file = "$jobdir/meta.xml";
my $meta = new GenomeMeta($genome, $meta_file);

my $raw_dir = "$jobdir/raw/$genome";
my $rp_dir = "$jobdir/rp/$genome";

my $errdir = "$jobdir/rp.errors";

if (! -d $raw_dir)
    &fatal("raw genome directory $raw_dir does not exist");

$meta->set_metadata("rp.hostname", $hostname);

# Do the subsytem coverage.

my $tmp = "tmprp.job$job.$$";
my $tmpdir = "/scratch/$tmp";


#my $reformat_log = "$errdir/subsytem_coverage.stderr";

my $cmd = "cat $rp_dir/proposed*functions | $FIG_Config::bin/rapid_subsystem_inference $rp_dir/Subsystems 2> $errdir/rapid_subsystem_inference.stderr";

print "Run $cmd\n";
$meta->add_log_entry($0, ['running', $cmd]);

$rc = system($cmd);
if ($rc != 0)
    &fatal("rapid_propagation_plasmid command failed with rc=$rc: $cmd\n");

$meta->add_log_entry($0, "rapid_subsystem_coverage completed\n");
$meta->set_metadata("rp.subsystem_coverage", "no");
$meta->set_metadata("status.subsystem_coverage", "complete");


sub fatal
    my($msg) = @_;

    $meta->add_log_entry($0, ['fatal error', $msg]);
    $meta->set_metadata("rp.error", $msg);
    $meta->set_metadata("rp.running", "no");
    $meta->set_metadata("status.rp", "error");

    croak "$0: $msg";

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3