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

Annotation of /FigKernelScripts/conditionally_assign.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : olson 1.3 #
2 : golsen 1.6 # Copyright (c) 2003-2011 University of Chicago and Fellowship
3 : olson 1.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 : overbeek 1.5 (
22 : golsen 1.6 ( @ARGV == 2 ) && # Just in case "Annotation" is not quoted
23 :     ( $user = shift @ARGV ) &&
24 :     ( $annot = shift @ARGV )
25 : overbeek 1.5 )
26 : golsen 1.6 or print STDERR "\nUsage: conditionally_assign User 'Annotation' < fid_tab_oldfunc_tab_newfunc\n\n"
27 :     and die 'Bad args';
28 : overbeek 1.1
29 : golsen 1.6 while ( $_ = <STDIN> )
30 : overbeek 1.1 {
31 : golsen 1.4 chomp;
32 : overbeek 1.5 my( $peg, $old, $new ) = split(/\t/,$_);
33 : golsen 1.6 next unless $peg && $new; # old could be empty string
34 :    
35 :     my $current = $fig->function_of( $peg );
36 :     if ( $old eq $current && $current ne $new )
37 : overbeek 1.1 {
38 : golsen 1.4 $fig->assign_function( $peg, $user, $new, "" );
39 : golsen 1.6 $fig->add_annotation( $peg, $user, $annot );
40 : overbeek 1.1 }
41 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3