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

Annotation of /FigKernelScripts/make_calls.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : overbeek 1.2 # -*- perl -*-
2 :    
3 : efrank 1.1 use FIG;
4 :    
5 : overbeek 1.2 # usage: make_calls < auto_assign.out > assignments
6 :    
7 :     if (@ARGV && ($ARGV[0] =~ m/^-no_hypos/)) { $no_hypos = 1; }
8 :    
9 : efrank 1.1 $/ = "\n\n";
10 :     while (defined($_ = <STDIN>))
11 :     {
12 :     if ($_ =~ /(\S+)[^\n]*\n((\s+[0-9\.]+\s+\S[^\n]+\n)+)/s)
13 :     {
14 :     $id = $1;
15 :     @calls = map { $_ =~ /^\s+([0-9\.]+)\s+(\S.*\S)/; ($1 && $2) ? [$1,$2] : () } split(/\n/,$2);
16 :     if (@calls > 0)
17 :     {
18 :     $hypo1 = &FIG::hypo($calls[0]->[1]);
19 :     if ((! $hypo1) &&
20 :     ((@calls < 2) || ($calls[0]->[0] > $calls[1]->[0])))
21 :     {
22 : overbeek 1.2 print "$id\t$calls[0]->[1]\n" unless ($hypo1 && $no_hypos);
23 : efrank 1.1 }
24 :     elsif ($hypo1 &&
25 :     (@calls > 1) && (! &FIG::hypo($calls[1]->[1])) &&
26 :     ((@calls == 2) || ($calls[1]->[0] > (1.1 * $calls[2]->[0]))))
27 :     {
28 : overbeek 1.2 print "$id\t$calls[1]->[1]\tW\n" unless ($hypo1 && $no_hypos);
29 : efrank 1.1 }
30 :     elsif ($calls[0]->[1] =~ /hypothetical/)
31 :     {
32 : overbeek 1.2 print "$id\t$calls[0]->[1]\n" unless ($no_hypos);
33 : efrank 1.1 }
34 :     else
35 :     {
36 : overbeek 1.2 print "$id\thypothetical protein\n" unless ($no_hypos);
37 : efrank 1.1 }
38 :     }
39 :     }
40 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3