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

View of /FigKernelScripts/similar_to.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Thu Aug 5 17:00:40 2004 UTC (15 years, 10 months ago) by overbeek
Branch: MAIN
Changes since 1.1: +8 -6 lines
added upstream command

use FIG;
my $fig = new FIG;

use Sim;

my $usage = "usage: similar_to [CutOff] < PEG > PEG1-Sc-PEG";

my($cutoff,$pair,$peg);
$cutoff = shift @ARGV;
$cutoff = defined($cutoff) ? $cutoff : 1.0e-10;

my $id;
@pegs = map { chop; $_ =~ /(\S+)$/; 
	      $id = $1;  
	      if ($id =~ /^fig\|/)
	      {
		  $id;
	      }
	      else
	      {
		  if ($peg = $fig->by_alias($id))
		  {
		      $peg;
		  }
		  else
		  {
		      ();
		  }
	      }
            } <STDIN>;

foreach $peg (@pegs)
{
    if (! $seen{$peg})
    {
	$seen{$peg} = 1;
	foreach $sim ($fig->sims($peg,1000,$cutoff,"fig"))
	{
	    push(@hits,[$peg,$sim->psc,$sim->id2]);
	}
    }
}

foreach $x (sort { $a->[1] <=> $b->[1] } @hits)
{
    print join("\t",@$x),"\n";
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3