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

View of /FortyEight/rp_PHOBIUS_attribute_generation.pl

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.1 - (download) (as text) (annotate)
Thu Oct 11 17:04:11 2007 UTC (12 years, 9 months ago) by mkubal
Branch: MAIN

# Compute signal peptides and transmembrane domains of proteins using PHOBIUS server and create attribute data.

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 $genome_dir = "$jobdir/rp/$genome";

my @apps = qw(rp_PHOBIUS_search

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

for my $app (@apps)
    $meta->add_log_entry($0, "start $app on $hostname in $jobdir");
    my $cmd = "$FIG_Config::bin/$app $jobdir $genome > $jobdir/rp.errors/$app.stderr 2>&1";
    warn "Compute: $cmd\n";
    my $rc = system($cmd);
    if ($rc != 0)
	&fatal("$app computation failed with rc=$rc");

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

sub fatal
    my($msg) = @_;

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

    croak "$0: $msg";

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3