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

Diff of /FigKernelScripts/conditionally_assign.pl

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

revision 1.3, Mon Dec 5 18:56:37 2005 UTC revision 1.4, Sat Aug 23 23:39:22 2008 UTC
# Line 1  Line 1 
1  #  #
2  # Copyright (c) 2003-2006 University of Chicago and Fellowship  # Copyright (c) 2003-2008 University of Chicago and Fellowship
3  # for Interpretations of Genomes. All Rights Reserved.  # for Interpretations of Genomes. All Rights Reserved.
4  #  #
5  # This file is part of the SEED Toolkit.  # This file is part of the SEED Toolkit.
# Line 18  Line 18 
18  use FIG;  use FIG;
19  my $fig = new FIG;  my $fig = new FIG;
20    
21  # usage: conditionally_assign [User] [no_annotations] < 3-column-assignments [PEG,Old,New]  # usage: conditionally_assign [User] < 3-column-assignments [PEG,Old,New]
22    
23  $user = "master";  $user = "master";
24  $annotations = 1;  $annotations = 1;
# Line 35  Line 35 
35      }      }
36  }  }
37    
 if ($user =~ /master:(.*)/)  
 {  
     $userR = $1;  
 }  
 else  
 {  
     $userR = $user;  
 }  
   
38  while ($_ = <STDIN>)  while ($_ = <STDIN>)
39  {  {
40      chop;      chomp;
41      ($peg,$old,$new) = split(/\t/,$_);      ($peg,$old,$new) = split(/\t/,$_);
42      if ($old eq $fig->function_of($peg,$userR))      if ( $peg && $new && $old eq $fig->function_of( $peg ) )
     {  
         if ($user =~ /master:(.*)/)  
         {  
             $fig->assign_function($peg,"master",$new,"");  
             $fig->add_annotation($peg,$userR,"Set master function to\n$new\n");  
         }  
         else  
43          {          {
44              $fig->assign_function($peg,$user,$new,"");              $fig->assign_function($peg,$user,$new,"");
             $fig->add_annotation($peg,$user,"Set function to\n$new\n");  
         }  
45      }      }
46  }  }
47    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3