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

View of /FigKernelScripts/conditionally_assign.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Fri Aug 6 16:13:00 2004 UTC (15 years, 5 months ago) by overbeek
Branch: MAIN
add conditionally_assign

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))
    {
	$fig->assign_function($peg,$userR,$new,"");
	if ($annotations)
	{
	    $who = ($user ne $userR) ? "master" : $userR;
	    $fig->add_annotation($peg,$userR,"Set $who function to\n$new\n");
	}
    }
}


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3