[Bio] / RegSubMa / rp_compute_pchs.pl Repository:
ViewVC logotype

View of /RegSubMa/rp_compute_pchs.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (download) (as text) (annotate) (vendor branch)
Wed Apr 4 17:08:51 2007 UTC (13 years, 3 months ago) by mkubal
Branch: MAIN, fig
CVS Tags: v_1_0_0, HEAD
Changes since 1.1: +0 -0 lines
initial checkin

#
# Compute Pchs from expanded sims.
#

use DB_File;

use Data::Dumper;
use Carp;
use strict;
use FIG;
use FIG_Config;
use File::Basename;
use GenomeMeta;
use Sim;

@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 $meta = new GenomeMeta($genome, "$jobdir/meta.xml");

my $sims_file = "$jobdir/rp/$genome/expanded_similarities";
my $pchs_file = "$jobdir/rp/$genome/pchs";
my $err_file = "$jobdir/rp/$genome/pchs.stderr";

$meta->add_log_entry($0, "start PCH processing on $hostname in $jobdir");

my $rc = system("$FIG_Config::bin/compute_pchs_from_sims $sims_file $pchs_file 2>&1 >$err_file");
if ($rc != 0)
{
    &fatal("pchs computation failed with rc=$rc");
}

$meta->add_log_entry($0, "finish PCH computation on $jobdir");
$meta->set_metadata("status.pchs", "complete");
exit(0);

sub fatal
{
    my($msg) = @_;

    if ($meta)
    {
	$meta->add_log_entry($0, ['fatal error', $msg]);
	$meta->set_metadata("status.pchs", "error");
    }

    croak "$0: $msg";
}
    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3