#!/bin/sh

# pipsa 3.0 script
# Computes similarity matrix and post-processes it
# Uses 2potsim_skin program - similarity on complete "skins" of proteins
#
# - needs 2 parameters: 
# $1 = pipsa_distr_dir = pipsa distribution directory
# $2 = pipsa_sim_dir   = directory, where similarity matrix should be computed 
#
# - assumes grid files to be in pipsa_sim_dir and pdb files in  pipsa_sim_dir/../pdbs/
# - will go to pipsa_sim_dir/ and calculate similarity matrix and its derivatives

# calculate similarity matrix
cd $2
$1/bin/npotsim -pg $1/bin/2potsim_skin -fn names -lg sims.log -pr 3 -sk 4 

$1/aux/pipsa2R.pl -s sims.log -g -m sims.mat -t h
# make kinemage and distance matrix
$1/bin/mkkin 1 1 < sims.log > sims.kin
$1/bin/mkdismx 1 1 < sims.log > sims.mat

