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

View of /FigKernelScripts/clean_subsystems.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Sun May 1 03:40:52 2005 UTC (15 years, 2 months ago) by overbeek
Branch: MAIN
CVS Tags: merge-trunktag-bobdev_news-2, Root-bobdev_news, merge-bobdev_news-1, caBIG-dataload-0, merge-trunktag-bobdev_news-1, merge-bodev_news-3, caBIG-00-00-00, merge-bobdev_news-2, merge-trunktag-bodev_news-3
Branch point for: Branch-bobdev_news
add clean_subsystems

#
# Input to this tool is usually produced using something like
#
#    pegs_in_conflict trusted.subsystems | peg_to_subsystems > conflicted.pegs
#
# Then running
#
#    clean_subsystems < conflicted.pegs; index_subsystems
#
# should remove the offending PEGs from their subsystems.
#


use FIG;
my $fig = new FIG;

use Subsystem;

while (defined($_ = <STDIN>))
{
    chop;
    ($peg,$func,$ssa,$role) = split(/\t/,$_);
    @roles = $fig->roles_of_function($func);
    for ($i=0; ($i < @roles) && ($roles[$i] ne $role); $i++) {}
    if ($i == @roles)
    {
        my $subsystem = new Subsystem($ssa,$fig,0);
        $genome = &FIG::genome_of($peg);
        @pegs1 = sort $subsystem->get_pegs_from_cell($genome,$role);
        @pegs2 = grep { $_ ne $peg } @pegs1;
        if (@pegs2 == @pegs1)
        {
            print STDERR "BAD: ",&Dumper(\@pegs1,\@pegs2,$ssa,$peg,$role,$func);
        }
        else
        {
            $subsystem->set_pegs_in_cell($genome,$role,\@pegs2);
            $subsystem->write_subsystem();
        }
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3