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

Annotation of /FigKernelScripts/clean_subsystems.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 :     #
20 :     # Input to this tool is usually produced using something like
21 :     #
22 :     # pegs_in_conflict trusted.subsystems | peg_to_subsystems > conflicted.pegs
23 :     #
24 :     # Then running
25 :     #
26 :     # clean_subsystems < conflicted.pegs; index_subsystems
27 :     #
28 :     # should remove the offending PEGs from their subsystems.
29 :     #
30 :    
31 :    
32 :     use FIG;
33 :     my $fig = new FIG;
34 :    
35 :     use Subsystem;
36 :    
37 :     while (defined($_ = <STDIN>))
38 :     {
39 :     chop;
40 :     ($peg,$func,$ssa,$role) = split(/\t/,$_);
41 :     @roles = $fig->roles_of_function($func);
42 :     for ($i=0; ($i < @roles) && ($roles[$i] ne $role); $i++) {}
43 :     if ($i == @roles)
44 :     {
45 :     my $subsystem = new Subsystem($ssa,$fig,0);
46 :     $genome = &FIG::genome_of($peg);
47 :     @pegs1 = sort $subsystem->get_pegs_from_cell($genome,$role);
48 :     @pegs2 = grep { $_ ne $peg } @pegs1;
49 :     if (@pegs2 == @pegs1)
50 :     {
51 :     print STDERR "BAD: ",&Dumper(\@pegs1,\@pegs2,$ssa,$peg,$role,$func);
52 :     }
53 :     else
54 :     {
55 :     $subsystem->set_pegs_in_cell($genome,$role,\@pegs2);
56 :     $subsystem->write_subsystem();
57 :     }
58 :     }
59 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3