forked from sysucs/SPROF
-
Notifications
You must be signed in to change notification settings - Fork 2
/
process_pdb.sh
executable file
·36 lines (26 loc) · 1.62 KB
/
process_pdb.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
#!/bin/bash
#infile=$1
#id=$2
# Change directory
#cd results/$id || exit 1
# Make copy of input file
cp raw_pdbs/$1 _tmp.pdb || exit 2
# Extract backbone
export DATADIR="raw_feature_generate/SPIN2/"
raw_feature_generate/SPIN2/bin/get_ala_backbone.pl _tmp || exit 3
# Generate fragments
echo -e "\"_tmp.ALA.pdb\"\\t`grep CA _tmp.ALA.pdb | wc -l`" > _tmp.list
raw_feature_generate/SPIN2/bin/featuregen_fragments raw_feature_generate/SPIN2/data/db/ raw_feature_generate/SPIN2/data/list ./ ./_tmp.list || exit 4
raw_feature_generate/SPIN2/bin/get_SP.pl _tmp || exit 5
# Generate rotomers
raw_feature_generate/SPIN2/bin/featuregen_rotomers raw_feature_generate/SPIN2/data/lib/dfirelib1 ./ _tmp.ALA.pdb > _tmp.sc || exit 6
raw_feature_generate/SPIN2/bin/get_SC.pl _tmp || exit 7
\cat _tmp.sc.nml | tr -s " " | cut -d " " -f 2-27,29-114 > _tmp.features.rotomers || exit 8
# Extract atom positions
# Print file extract columns separate squashed fields del spaces remove CB del start spaces del trailing sp replace N replace CA replace C replace O write to file
cat _tmp.ALA.pdb | cut -c 13-16,23-26,31-54 | sed 's:^\(.\{4\}\)\(.\{4\}\)\(.\{8\}\)\(.\{8\}\)\(.\{8\}\).*$:\1 \2 \3 \4 \5:' | tr -s " " | grep -v CB | sed 's:^[ ]*::' | sed 's:[ ]*$::' | sed 's:N:0:' | sed 's:CA:1:' | sed 's:C:2:' | sed 's:O:3:' > _tmp.positions || exit 9
# Run classifier
#/home/cs/SPROF/run/SPIN2/bin/spin2.py _tmp.positions _tmp.features.fragments _tmp.features.rotomers > $1.txt || exit 10
# Clean things up
mv _tmp.features.fragments raw_features/$1.frag
rm _tmp* || exit 11