#!/bin/bash

MOLPROB_DIR=/local/CASP13/RESULTS/MOLPROBITY_ALL
MODEL_DIR=/local/CASP13/MODELS

for tt in $MODEL_DIR/T0???-D? ; 
   do 
     t=${tt##*/}
     if [ -f $MOLPROB_DIR/$t.molprb ] ; 
       then n=$(ls -1 $tt | wc -l); 
            m=$(grep "^T" $MOLPROB_DIR/$t.molprb -c ); 
            (( m = m - 1 )); 
            if [ $m -ne $n ] ; 
               then echo $t  $m  $n ; 
            fi; 
     fi; 
   done
