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

Diff of /FigKernelScripts/make_calls.pl

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

revision 1.2, Thu Aug 12 18:24:14 2004 UTC revision 1.4, Mon Dec 5 18:56:37 2005 UTC
# Line 1  Line 1 
1  # -*- perl -*-  # -*- perl -*-
2    #
3    # Copyright (c) 2003-2006 University of Chicago and Fellowship
4    # for Interpretations of Genomes. All Rights Reserved.
5    #
6    # This file is part of the SEED Toolkit.
7    #
8    # The SEED Toolkit is free software. You can redistribute
9    # it and/or modify it under the terms of the SEED Toolkit
10    # Public License.
11    #
12    # You should have received a copy of the SEED Toolkit Public License
13    # along with this program; if not write to the University of Chicago
14    # at info@ci.uchicago.edu or the Fellowship for Interpretation of
15    # Genomes at veronika@thefig.info or download a copy from
16    # http://www.theseed.org/LICENSE.TXT.
17    #
18    
19    
20  use FIG;  use FIG;
21    my($id,$func);
22    
23  # usage:  make_calls < auto_assign.out > assignments  # usage:  make_calls < auto_assign.out > assignments
24    
25  if (@ARGV && ($ARGV[0] =~ m/^-no_hypos/)) { $no_hypos = 1; }  if (@ARGV && ($ARGV[0] =~ m/^-no_hypos/)) { $no_hypos = 1; }
26    
 $/ = "\n\n";  
27  while (defined($_ = <STDIN>))  while (defined($_ = <STDIN>))
28  {  {
29      if ($_ =~ /(\S+)[^\n]*\n((\s+[0-9\.]+\s+\S[^\n]+\n)+)/s)      if ($_ =~ /^(\S+)\t(\S[^\t]*\S)/)
30      {      {
31          $id = $1;          $id = $1;
32          @calls = map { $_ =~ /^\s+([0-9\.]+)\s+(\S.*\S)/; ($1 && $2) ? [$1,$2] : () } split(/\n/,$2);          $func = $2;
33          if (@calls > 0)          if ((! $no_hypos) || (! &FIG::hypo($func)))
         {  
             $hypo1 = &FIG::hypo($calls[0]->[1]);  
             if ((! $hypo1) &&  
                 ((@calls < 2) || ($calls[0]->[0] > $calls[1]->[0])))  
34              {              {
35                  print "$id\t$calls[0]->[1]\n" unless ($hypo1 && $no_hypos);              print $_;
             }  
             elsif ($hypo1 &&  
                    (@calls > 1) && (! &FIG::hypo($calls[1]->[1])) &&  
                    ((@calls == 2) || ($calls[1]->[0] > (1.1 * $calls[2]->[0]))))  
             {  
                 print "$id\t$calls[1]->[1]\tW\n" unless ($hypo1 && $no_hypos);  
             }  
             elsif ($calls[0]->[1] =~ /hypothetical/)  
             {  
                 print "$id\t$calls[0]->[1]\n" unless ($no_hypos);  
             }  
             else  
             {  
                 print "$id\thypothetical protein\n" unless ($no_hypos);  
             }  
36          }          }
37      }      }
38  }  }

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3