forked from psipred/DeepCov
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextract_results_from_benchmark.sh
executable file
·45 lines (34 loc) · 1.27 KB
/
extract_results_from_benchmark.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
if [ -z "$5" ]; then
echo "usage: $0 <dir with .results files> <dir for output> <min seq separation> <max seq separation> <target list file>" >&2
exit 1
fi
#results_dir=${PWD}/psicov150/results
#out_dir=${PWD}/bench_results_aggregated
results_dir=$1
out_dir=$2
topomin=$3
topomax=$4
target_list=$5
out_master_file=${out_dir}/aggregate_results_min${topomin}_max${topomax}.txt
mkdir -p $out_dir
# print a header to the master file.
## TODO would be nice to have length in residues. It appears the pdbs are all generated by Modeller; this allows us to make some helpful assumptions.
## for n in *.pdb; do printf "$n "; grep ' CA ' $n | wc -l; done
echo "pdbid actual_obs precL precL2 precL5 precL10 precLeq100 Lmax_prec_gt_0.5" > $out_master_file
for n in $(cat $target_list)
do
tmp_file=$out_dir/${n}.tmp
results_file=${results_dir}/${n}.results
if [ ! -s $results_file ]
then
echo "$0: WARNING: $results_file not found or is empty. Skipping." >&2
continue
fi
tail -n 7 $results_file > $tmp_file
printf "$n " >> $out_master_file
#extract various bits and put them in separate files.
awk 'BEGIN {ORS=" "} { if (NF==5) {print $5} else {print $4} }' $tmp_file >> $out_master_file
echo '' >> $out_master_file
done
rm $out_dir/*.tmp