#!/bin/bash

echo "Running mscore to get scores of alignments ..."

# verbose flag - set this flag to have verbose output (cannot be plotted!)
verbflag=-v

# root dir for data + programs
rootdir=/home/goetz/multal

# dir where the reference alignments are stored
refdir=$rootdir/alcompar/BAliBASE

# location of mscore program
mscore=$rootdir/mscore/mscore

# dir containing all data
datadir=`pwd`

# scoredir
testscores=`pwd`/testscores

for prgname in clustalx TCOFFEE dialign2 hmmer msa; do
    for msffile in ref1/test1/1csy_ref1.msf ref2/test/1aboA_ref2.msf ref3/test/1wit_ref3.msf ref4/test/1pysA_ref4.msf ref5/test/1eft_ref5.msf; do

	    cd $datadir/$prgname
	    # set some local variables for convenience:
	    reffile=$refdir/$msffile;
	    ftbfile=$refdir/`echo $msffile | sed -e "s/msf/ftb/"`;
	    
	    # now do different scoring types
	    $mscore -V -d -r $reffile $msffile &> $testscores/$prgname/`basename $msffile .msf`.dis
	    # distance score with simple secstructure weighting
	    $mscore -V -d -f $ftbfile -r $reffile -s 2 -t 2 $msffile &> $testscores/$prgname/`basename $msffile .msf`.sdis

	    # distance score with simple secstructure weighting
	    $mscore -V -d -f $ftbfile -r $reffile -s 4 -t 4 $msffile &> $testscores/$prgname/`basename $msffile .msf`.sdis2
	    
	    # distance score with progressive secstructure weighting and
	    # pairwise sequence dist weighting (pam250)
	    $mscore -V -d -f $ftbfile -r $reffile -s 2 -t 2 -q pam250 -P 2 $msffile  &> $testscores/$prgname/`basename $msffile .msf`.wdis
	    
	    # distance score with progressive secstructure weighting and
	    # pairwise sequence dist weighting (blosum62)
	    $mscore -V -d -f $ftbfile -r $reffile -s 2 -t 2 -q blosum62 -P 2 $msffile &> $testscores/$prgname/`basename $msffile .msf`.blwdis

    done;

done;
