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

View of /FigKernelScripts/conditionally_assign.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Sat Jan 8 18:22:01 2005 UTC (15 years, 3 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, efrank-preMakefileToStandardMk, caBIG-00-00-00, merge-bobdev_news-2, merge-trunktag-bodev_news-3
Branch point for: Branch-bobdev_news
Changes since 1.1: +10 -6 lines
add check to assign_function

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