[Bio] / FigTutorial / batch_assignments.pl Repository:
ViewVC logotype

View of /FigTutorial/batch_assignments.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Thu Jun 10 13:39:16 2004 UTC (15 years, 5 months ago) by olson
Branch: MAIN
CVS Tags: merge-bodev_news-3, rast_rel_2008_06_18, rast_rel_2008_06_16, rast_rel_2008_07_21, Root-bobdev_news, caBIG-13Feb06-00, merge-trunktag-bobdev_news-1, caBIG-05Apr06-00, caBIG-00-00-00, merge-trunktag-bodev_news-3, merge-bobdev_news-2, merge-bobdev_news-1, rast_rel_2008_04_23, rast_rel_2008_08_07, merge-trunktag-bobdev_news-2
Branch point for: Branch-bobdev_news
Changes since 1.1: +0 -14 lines
clean up tutorial code

use FIG;
my $fig = new FIG;

use strict;
my($usage,$user,$annotation,$text,$peg,$func,$conf,$user_name,$funcO);

$usage = "usage: batch_assignments User [AnnotationFile] < Assignments";

($user = shift @ARGV)
    || die $usage;

if ($annotation = shift @ARGV)
{
    $text = join("",`cat $annotation`);
}
else
{
    $text = "";
}

while (defined($_ = <STDIN>))
{
    chop;
    ($peg,$func,$conf) = split(/\t/,$_);
    if (! $conf) { $conf = "" }
    if ($user =~ /master:(.*)/)
    {
	$user_name = $1;
	$funcO = $fig->function_of($peg);
	if ($funcO ne $func)
	{
	    $fig->assign_function($peg,"master",$func,$conf);
	    $fig->add_annotation($peg,$user_name,"Set master function to\n$func\n$text");
	}
    }
    else
    {
	$funcO = $fig->function_of($peg,$user);
	if ($funcO ne $func)
	{
	    $fig->assign_function($peg,$user,$func,$conf);
	    $fig->add_annotation($peg,$user,"Set function to\n$func\n$text");
	}
    }
}
    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3