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

Annotation of /FigKernelScripts/get_class_examples.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : olson 1.2 #
2 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
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
19 :     use FIG;
20 :     $fig = new FIG;
21 :    
22 :     $usage = "usage: get_class_examples fc_output MinNonHypo MaxNonHypo MinHypo MaxHypo > examples";
23 :    
24 :     (
25 :     ($fc_out = shift @ARGV) &&
26 :     ($minN = shift @ARGV) &&
27 :     ($maxN = shift @ARGV) &&
28 :     ($minH = shift @ARGV) &&
29 :     ($maxH = shift @ARGV)
30 :     )
31 :     || die $usage;
32 :    
33 :     open(CLUSTERS,"cut -f1,3 $fc_out | cluster_objects |")
34 :     || die $usage;
35 :    
36 :     while (defined($_ = <CLUSTERS>))
37 :     {
38 :     @fids = ($_ =~ /fig\|\d+\.\d+\.peg\.\d+/g);
39 :     @hypo = ();
40 :     @non = ();
41 :     foreach $peg (@fids)
42 :     {
43 :     $func = $fig->function_of($peg);
44 :     if (&FIG::hypo($func))
45 :     {
46 :     push(@hypo,[$peg,$func]);
47 :     }
48 :     else
49 :     {
50 :     push(@non,[$peg,$func]);
51 :     }
52 :     }
53 :    
54 :     if (&FIG::between($minN,scalar @non,$maxN) &&
55 :     &FIG::between($minH,scalar @hypo,$maxH))
56 :     {
57 :     foreach $x (@non)
58 :     {
59 :     ($peg,$func) = @$x;
60 :     print "$peg\t$func\n";
61 :     }
62 :     print "\n";
63 :    
64 :     foreach $x (@hypo)
65 :     {
66 :     ($peg,$func) = @$x;
67 :     print "$peg\t$func\n";
68 :     }
69 :     print "======\n\n";
70 :     }
71 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3