[Bio] / FigTutorial / batch_assignments.pl Repository:
ViewVC logotype

Annotation of /FigTutorial/batch_assignments.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (view) (download) (as text)

1 : overbeek 1.1 use FIG;
2 :     my $fig = new FIG;
3 :    
4 :     use strict;
5 :     my($usage,$user,$annotation,$text,$peg,$func,$conf,$user_name,$funcO);
6 :    
7 :     $usage = "usage: batch_assignments User [AnnotationFile] < Assignments";
8 :    
9 :     ($user = shift @ARGV)
10 :     || die $usage;
11 :    
12 :     if ($annotation = shift @ARGV)
13 :     {
14 :     $text = join("",`cat $annotation`);
15 :     }
16 :     else
17 :     {
18 :     $text = "";
19 :     }
20 :    
21 :     while (defined($_ = <STDIN>))
22 :     {
23 :     chop;
24 :     ($peg,$func,$conf) = split(/\t/,$_);
25 :     if (! $conf) { $conf = "" }
26 :     if ($user =~ /master:(.*)/)
27 :     {
28 :     $user_name = $1;
29 :     $funcO = $fig->function_of($peg);
30 :     if ($funcO ne $func)
31 :     {
32 :     $fig->assign_function($peg,"master",$func,$conf);
33 :     $fig->add_annotation($peg,$user_name,"Set master function to\n$func\n$text");
34 :     }
35 :     }
36 :     else
37 :     {
38 :     $funcO = $fig->function_of($peg,$user);
39 :     if ($funcO ne $func)
40 :     {
41 :     $fig->assign_function($peg,$user,$func,$conf);
42 :     $fig->add_annotation($peg,$user,"Set function to\n$func\n$text");
43 :     }
44 :     }
45 :     }
46 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3