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

Diff of /FortyEight/rp_auto_assign.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4, Fri Jun 8 19:20:20 2007 UTC revision 1.12, Thu Aug 19 15:51:08 2010 UTC
# Line 8  Line 8 
8  use FIG_Config;  use FIG_Config;
9  use File::Basename;  use File::Basename;
10  use GenomeMeta;  use GenomeMeta;
11    use Carp 'croak';
12    use Job48;
13    
14  @ARGV == 1 or die "Usage: $0 job-dir\n";  @ARGV == 1 or die "Usage: $0 job-dir\n";
15    
# Line 48  Line 50 
50    
51  open(TBL, "<$tbl") or &fatal("Cannot open tbl file $tbl: $!");  open(TBL, "<$tbl") or &fatal("Cannot open tbl file $tbl: $!");
52    
53  my $cmd = "$FIG_Config::bin/auto_assign sims=$simfile > $jobdir/rp/$genome/proposed_non_ff_functions";  my $cmd = "$FIG_Config::bin/auto_assign -orgdir $jobdir/rp/$genome > $jobdir/rp/$genome/proposed_non_ff_functions";
54  print "running $cmd\n";  print "running $cmd\n";
55  open(AA, "| $cmd")  open(AA, "| $cmd")
56          or &fatal("aa failed: $!");          or &fatal("aa failed: $!");
# Line 73  Line 75 
75      &fatal("error on close \$?=$? \$!=$!");      &fatal("error on close \$?=$? \$!=$!");
76  }  }
77    
78    #
79    # When auto assign is complete, we are able to submit the model computation.
80    #
81    
82    if ($meta->get_metadata("model_build.enabled"))
83    {
84        my $userid;
85        my $link;
86        eval {
87            my $job = Job48->new($jobdir);
88            my $uo = $job->getUserObject;
89            if ($uo)
90            {
91                $userid = $uo->_id;
92            }
93        };
94    
95        if (defined($userid))
96        {
97            $link = "http://seed-viewer.theseed.org/seedviewer.cgi?model=Seed${genome}.${userid}&page=ModelView";
98        }
99        else
100        {
101            $meta->add_log_entry($0, "Could not get user id");
102        }
103    
104    
105        my $user = &FIG::file_head("$jobdir/USER", 1);
106        chomp $user;
107        my $cmd = ("/vol/model-prod/FIGdisk/bin/ModelDriver.sh 'createmodelfile?$genome?1?$user' > $jobdir/rp.errors/create_model.stderr 2>&1");
108        my $rc = system($cmd);
109        if ($rc != 0)
110        {
111            $meta->add_log_entry($0, ['error creating model', $rc]);
112        }
113        else
114        {
115            $meta->add_log_entry($0, ['model submitted']);
116    
117            if (defined($link))
118            {
119                $meta->set_metadata("model_build.viewing_link", $link) ;
120            }
121        }
122    }
123    
124    
125  $meta->add_log_entry($0, "auto_assign completed\n");  $meta->add_log_entry($0, "auto_assign completed\n");
126  $meta->set_metadata("status.auto_assign", "complete");  $meta->set_metadata("status.auto_assign", "complete");
127    $meta->set_metadata("auto_assign.running", "no");
128    
129  sub fatal  sub fatal
130  {  {

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.12

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3