[Bio] / FigKernelScripts / conditionally_assign.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/conditionally_assign.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : olson 1.3 #
2 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
3 :     # for Interpretations of Genomes. All Rights Reserved.
4 :     #
5 :     # This file is part of the SEED Toolkit.
6 :     #
7 :     # The SEED Toolkit is free software. You can redistribute
8 :     # it and/or modify it under the terms of the SEED Toolkit
9 :     # Public License.
10 :     #
11 :     # You should have received a copy of the SEED Toolkit Public License
12 :     # along with this program; if not write to the University of Chicago
13 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14 :     # Genomes at veronika@thefig.info or download a copy from
15 :     # http://www.theseed.org/LICENSE.TXT.
16 :     #
17 :    
18 : overbeek 1.1 use FIG;
19 :     my $fig = new FIG;
20 :    
21 :     # usage: conditionally_assign [User] [no_annotations] < 3-column-assignments [PEG,Old,New]
22 :    
23 :     $user = "master";
24 :     $annotations = 1;
25 :    
26 :     foreach $arg (@ARGV)
27 :     {
28 :     if ($arg eq "no_annotations")
29 :     {
30 :     $annotations = 0;
31 :     }
32 :     else
33 :     {
34 :     $user = $arg;
35 :     }
36 :     }
37 :    
38 :     if ($user =~ /master:(.*)/)
39 :     {
40 :     $userR = $1;
41 :     }
42 :     else
43 :     {
44 :     $userR = $user;
45 :     }
46 :    
47 :     while ($_ = <STDIN>)
48 :     {
49 :     chop;
50 :     ($peg,$old,$new) = split(/\t/,$_);
51 :     if ($old eq $fig->function_of($peg,$userR))
52 :     {
53 : overbeek 1.2 if ($user =~ /master:(.*)/)
54 :     {
55 :     $fig->assign_function($peg,"master",$new,"");
56 :     $fig->add_annotation($peg,$userR,"Set master function to\n$new\n");
57 :     }
58 :     else
59 :     {
60 :     $fig->assign_function($peg,$user,$new,"");
61 :     $fig->add_annotation($peg,$user,"Set function to\n$new\n");
62 :     }
63 : overbeek 1.1 }
64 :     }
65 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3