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

View of /FigKernelScripts/conditionally_assign.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (download) (as text) (annotate)
Mon Dec 5 18:56:37 2005 UTC (14 years, 1 month ago) by olson
Branch: MAIN
CVS Tags: rast_rel_2008_06_18, rast_rel_2008_06_16, rast_rel_2008_07_21, rast_rel_2008_04_23, caBIG-05Apr06-00, caBIG-13Feb06-00, rast_rel_2008_08_07
Changes since 1.2: +17 -0 lines
Add license words.

#
# Copyright (c) 2003-2006 University of Chicago and Fellowship
# for Interpretations of Genomes. All Rights Reserved.
#
# This file is part of the SEED Toolkit.
# 
# The SEED Toolkit is free software. You can redistribute
# it and/or modify it under the terms of the SEED Toolkit
# Public License. 
#
# You should have received a copy of the SEED Toolkit Public License
# along with this program; if not write to the University of Chicago
# at info@ci.uchicago.edu or the Fellowship for Interpretation of
# Genomes at veronika@thefig.info or download a copy from
# http://www.theseed.org/LICENSE.TXT.
#

use FIG;
my $fig = new FIG;

# usage: conditionally_assign [User] [no_annotations] < 3-column-assignments [PEG,Old,New]

$user = "master";
$annotations = 1;

foreach $arg (@ARGV)
{
    if ($arg eq "no_annotations")
    {
	$annotations = 0;
    }
    else
    {
	$user = $arg;
    }
}

if ($user =~ /master:(.*)/)
{
    $userR = $1;
}
else
{
    $userR = $user;
}

while ($_ = <STDIN>)
{
    chop;
    ($peg,$old,$new) = split(/\t/,$_);
    if ($old eq $fig->function_of($peg,$userR))
    {
        if ($user =~ /master:(.*)/)
        {
            $fig->assign_function($peg,"master",$new,"");
            $fig->add_annotation($peg,$userR,"Set master function to\n$new\n");
        }
        else
        {
            $fig->assign_function($peg,$user,$new,"");
            $fig->add_annotation($peg,$user,"Set function to\n$new\n");
        }
    }
}


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3