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

Annotation of /FigKernelScripts/FFB2_make_subsys_based_families.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : overbeek 1.1 ########################################################################
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 :    
21 :     use FIG;
22 :     my $fig = new FIG;
23 :    
24 :     # usage: FFB2_make_subsys_based_families > subsys.based.families
25 :    
26 :     my $pairsF = "$FIG_Config::temp/peg-func.$$";
27 :     open(TMP1,"pegs_in_subsystems | cut -f2,3 | sort -u | function_of |")
28 :     || die "could not get pegs";
29 :     open(TMP2,"| sort -u > $pairsF") || die "could not open $pairsF";
30 :    
31 :     while (defined($_ = <TMP1>))
32 :     {
33 :     chomp;
34 :     my($role,$peg,$func) = split(/\t/,$_);
35 :     next if ((! $func) || (length($func) < 2));
36 :     my @roles = $fig->roles_of_function($func);
37 :     my $i;
38 :     for ($i=0; ($i < @roles) && ($roles[$i] ne $role); $i++) {}
39 :     if ($i < @roles)
40 :     {
41 :     if ($func !~ /\#.*((trunca)|(framesh)|(fragment))/)
42 :     {
43 :     $func =~ s/\s*\#.*$//;
44 :     print TMP2 "$func\t$peg\n";
45 :     }
46 :     }
47 :     }
48 :     close(TMP1);
49 :     close(TMP2);
50 :    
51 :     my $n = 1;
52 :     open(TMP2,"<$pairsF") || die "could not open $pairsF";
53 :     my $x = <TMP2>;
54 :     while ($x && ($x =~ /(\S.*\S)\t(fig\|\d+\.\d+\.peg\.\d+)/))
55 :     {
56 :     my $func = $1;
57 :     my @set = ();
58 :     while ($x && ($x =~ /(\S.*\S)\t(fig\|\d+\.\d+\.peg\.\d+)/) && ($1 eq $func))
59 :     {
60 :     push(@set,$2);
61 :     $x = <TMP2>;
62 :     }
63 :    
64 :     if (@set > 1)
65 :     {
66 :     foreach $_ (@set)
67 :     {
68 :     print "$n\t$_\n";
69 :     }
70 :     $n++;
71 :     }
72 :     }
73 :     unlink($pairsF);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3