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

View of /FigKernelScripts/make_binary.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Mon Dec 1 20:46:40 2003 UTC (16 years, 7 months ago) by efrank
Branch: MAIN
CVS Tags: V00-00-01, 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, delong-01, delong-02, caBIG-00-00-00, merge-bobdev_news-2, V00-00-00, merge-trunktag-bodev_news-3
Branch point for: Branch-bobdev_news

Makefile:
	get it to work with the release tools

All the rest:
	had to rename foo to foo.pl so that makefiles could recognize
	perl source from, say, Makefiles and READMEs

use FIG;
# Takes an input file of "pins" and turns it into a set of binary connections (that
# can be glued together with cluster_objects)
#

$usage = "usage: make_binary File > binary";

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

open(IN,"<$file") || die "aborted";
while (defined($_ = <IN>))
{
    if (substr($_,-1) eq "\n")
    {
	while ($_ =~ /(\S+),(\S+)/g)
	{
	    $restrict{$1} = $restrict{$2} = 1;
	}
    }
}
close(IN);

open(IN,"<$file") || die "aborted";
while (defined($line = <IN>))
{
    if (substr($line,-1) eq "\n")
    {
	chop $line;
	@ids = sort { &FIG::by_fig_id($a,$b) } grep { ! $restrict{$_} } split(/[\t]+/,$line);
	for ($i=0; ($i < $#ids); $i++)
	{
	    $key = "$ids[$i]\t$ids[$i+1]";
	    if (! $seen{$key})
	    {
		print "$key\n";
		$seen{$key} = 1;
	    }
	}
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3