-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_AF2Multimer_reports.openfold.sh
62 lines (53 loc) · 1.96 KB
/
generate_AF2Multimer_reports.openfold.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
base_path=$1
base_path_name=$(basename ${base_path})
echo "running on base path: $base_path"
echo "generating ${base_path_name}.interfaces.csv..."
for f in ${base_path}/*/predictions/*_analysis/interfaces.csv
do
t=$(dirname $f)
tt=$(dirname $t)
name=$(basename $tt)
# echo "$f --> $name"
perl -ne '
chomp($_);
if($_ !~ /^complex_name/){
print "'${name}'," . $_ . "\n";
}
' $f > ${f}.foldname.csv
done
echo "fold_name,complex_name,model_num,pdockq,ncontacts,plddt_min,plddt_avg,plddt_max,pae_min,pae_avg,pae_max,distance_avg" > ${base_path}/${base_path_name}.interfaces.csv
cat ${base_path}/*/predictions/*_analysis/interfaces.csv.foldname.csv >> ${base_path}/${base_path_name}.interfaces.csv
echo "generating ${base_path_name}.summary.csv..."
for f in ${base_path}/*/predictions/*_analysis/summary.csv
do
t=$(dirname $f)
tt=$(dirname $t)
name=$(basename $tt)
# echo "$f --> $name"
perl -ne '
chomp($_);
if($_ !~ /^complex_name/){
print "'${name}'," . $_ . "\n";
}
' $f > ${f}.foldname.csv
done
echo "fold_name,complex_name,avg_n_models,max_n_models,num_contacts_with_max_n_models,num_unique_contacts,best_model_num,best_pdockq,best_plddt_avg,best_pae_avg" > ${base_path}/${base_path_name}.summary.csv
cat ${base_path}/*/predictions/*_analysis/summary.csv.foldname.csv >> ${base_path}/${base_path_name}.summary.csv
echo "generating ${base_path_name}.contacts.csv..."
for f in ${base_path}/*/predictions/*_analysis/contacts.csv
do
t=$(dirname $f)
tt=$(dirname $t)
name=$(basename $tt)
# echo "$f --> $name"
perl -ne '
chomp($_);
if($_ !~ /^complex_name/){
print "'${name}'," . $_ . "\n";
}
' $f > ${f}.foldname.csv
done
echo "fold_name,complex_name,model_num,aa1_chain,aa1_index,aa1_type,aa1_plddt,aa2_chain,aa2_index,aa2_type,aa2_plddt,pae,min_distance" > ${base_path}/${base_path_name}.contacts.csv
cat ${base_path}/*/predictions/*_analysis/contacts.csv.foldname.csv >> ${base_path}/${base_path_name}.contacts.csv
echo "done!"