#!/usr/bin/perl
# $Id: pblocks2,v 1.3 1993/01/07 19:53:16 schwartz Exp $ 

$usage="usage: pblocks [S=sig] [K=num] seq1 seq2 ...\n";
if ($#ARGV <= 1) {
  print STDERR $usage;
  exit 1;
}

$TMP="t.$$";
$S='';
$K=30;

@args=();
foreach $arg (@ARGV) {
  if ($arg =~ /^S=/) { $S=$arg; }
  elsif ($arg =~ /^K=(.*)/) { $K=$1; }
  else {unshift(@args,$arg);}
}
@ARGV = @args;

$cmd = "";
for ($s = 0; $s <= $#ARGV; $s++) {
  for ($t = $s+1; $t <= $#ARGV; $t++) {
    $cmd .= "sim $K $ARGV[$s] $ARGV[$t] | pstrip $S >$TMP.$s.$t ; ";
  }
}
system "$cmd";
system "ptbc $TMP.*";
system "rm $TMP.*";
