[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.3, Fri May 27 14:42:19 2005 UTC
# Line 1  Line 1 
1  # -*- perl -*-  # -*- perl -*-
2    
3  use FIG;  use FIG;
4    my($id,$func);
5    
6  # usage:  make_calls < auto_assign.out > assignments  # usage:  make_calls < auto_assign.out > assignments
7    
8  if (@ARGV && ($ARGV[0] =~ m/^-no_hypos/)) { $no_hypos = 1; }  if (@ARGV && ($ARGV[0] =~ m/^-no_hypos/)) { $no_hypos = 1; }
9    
 $/ = "\n\n";  
10  while (defined($_ = <STDIN>))  while (defined($_ = <STDIN>))
11  {  {
12      if ($_ =~ /(\S+)[^\n]*\n((\s+[0-9\.]+\s+\S[^\n]+\n)+)/s)      if ($_ =~ /^(\S+)\t(\S[^\t]*\S)/)
13      {      {
14          $id = $1;          $id = $1;
15          @calls = map { $_ =~ /^\s+([0-9\.]+)\s+(\S.*\S)/; ($1 && $2) ? [$1,$2] : () } split(/\n/,$2);          $func = $2;
16          if (@calls > 0)          if ((! $no_hypos) || (! &FIG::hypo($func)))
17          {          {
18              $hypo1 = &FIG::hypo($calls[0]->[1]);              print $_;
             if ((! $hypo1) &&  
                 ((@calls < 2) || ($calls[0]->[0] > $calls[1]->[0])))  
             {  
                 print "$id\t$calls[0]->[1]\n" unless ($hypo1 && $no_hypos);  
             }  
             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);  
             }  
19          }          }
20      }      }
21  }  }

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3