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

View of /FigKernelScripts/get_class_examples.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Sun Oct 17 17:53:55 2004 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
add program to generate class challenge problems

use FIG;
$fig = new FIG;

$usage = "usage: get_class_examples fc_output MinNonHypo MaxNonHypo MinHypo MaxHypo > examples";

(
 ($fc_out = shift @ARGV) &&
 ($minN   = shift @ARGV) &&
 ($maxN   = shift @ARGV) &&
 ($minH   = shift @ARGV) &&
 ($maxH   = shift @ARGV)
)
    || die $usage;

open(CLUSTERS,"cut -f1,3 $fc_out | cluster_objects |") 
    || die $usage;

while (defined($_ = <CLUSTERS>))
{
    @fids = ($_ =~ /fig\|\d+\.\d+\.peg\.\d+/g);
    @hypo = ();
    @non = ();
    foreach $peg (@fids)
    {
	$func = $fig->function_of($peg);
	if (&FIG::hypo($func))
	{
	    push(@hypo,[$peg,$func]);
	}
	else
	{
	    push(@non,[$peg,$func]);
	}
    }

    if (&FIG::between($minN,scalar @non,$maxN) &&
	&FIG::between($minH,scalar @hypo,$maxH))
    {
	foreach $x (@non)
	{
	    ($peg,$func) = @$x;
	    print "$peg\t$func\n";
	}
	print "\n";

	foreach $x (@hypo)
	{
	    ($peg,$func) = @$x;
	    print "$peg\t$func\n";
	}
	print "======\n\n";
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3