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

View of /FigKernelScripts/make_calls.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Thu Aug 12 18:24:14 2004 UTC (15 years, 4 months ago) by overbeek
Branch: MAIN
CVS Tags: efrank-preMakefileToStandardMk
Changes since 1.1: +10 -4 lines
Added '-no_hypos' flag to supress function-assignments of "hypotheticals." -- /gdp

# -*- perl -*-

use FIG;

# usage:  make_calls < auto_assign.out > assignments

if (@ARGV && ($ARGV[0] =~ m/^-no_hypos/)) { $no_hypos = 1; }

$/ = "\n\n";
while (defined($_ = <STDIN>))
{
    if ($_ =~ /(\S+)[^\n]*\n((\s+[0-9\.]+\s+\S[^\n]+\n)+)/s)
    {
	$id = $1;
	@calls = map { $_ =~ /^\s+([0-9\.]+)\s+(\S.*\S)/; ($1 && $2) ? [$1,$2] : () } split(/\n/,$2);
	if (@calls > 0)
	{
	    $hypo1 = &FIG::hypo($calls[0]->[1]);
	    if ((! $hypo1) &&
		((@calls < 2) || ($calls[0]->[0] > $calls[1]->[0])))
	    {
		print "$id\t$calls[0]->[1]\n" unless ($hypo1 && $no_hypos);
	    }
	    elsif ($hypo1 &&
		   (@calls > 1) && (! &FIG::hypo($calls[1]->[1])) && 
		   ((@calls == 2) || ($calls[1]->[0] > (1.1 * $calls[2]->[0]))))
	    {
		print "$id\t$calls[1]->[1]\tW\n" unless ($hypo1 && $no_hypos);
	    }
	    elsif ($calls[0]->[1] =~ /hypothetical/)
	    {
		print "$id\t$calls[0]->[1]\n" unless ($no_hypos);
	    }
	    else
	    {
		print "$id\thypothetical protein\n" unless ($no_hypos);
	    }
	}
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3