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

View of /FigKernelScripts/conditionally_assign.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (download) (as text) (annotate)
Sun Dec 4 18:19:04 2011 UTC (8 years ago) by golsen
Branch: MAIN
CVS Tags: rast_rel_2014_0912, mgrast_version_3_2, mgrast_dev_12152011, rast_rel_2014_0729, mgrast_release_3_1_2, HEAD
Changes since 1.5: +12 -7 lines
Just a little more testing and nicer useage info.

#
# Copyright (c) 2003-2011 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;

(
 ( @ARGV == 2 ) &&             # Just in case "Annotation" is not quoted
 ( $user  = shift @ARGV ) &&
 ( $annot = shift @ARGV )
)
    or print STDERR "\nUsage: conditionally_assign User 'Annotation' < fid_tab_oldfunc_tab_newfunc\n\n"
        and die 'Bad args';

while ( $_ = <STDIN> )
{
    chomp;
    my( $peg, $old, $new ) = split(/\t/,$_);
    next unless $peg && $new;   #  old could be empty string

    my $current = $fig->function_of( $peg );
    if ( $old eq $current && $current ne $new )
    {
        $fig->assign_function( $peg, $user, $new, "" );
        $fig->add_annotation( $peg, $user, $annot );
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3