-
Notifications
You must be signed in to change notification settings - Fork 1
/
make_pca_files.sh
29 lines (22 loc) · 1.04 KB
/
make_pca_files.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
#this will take a list of pca files with their last frame corresponding to the most extreme of the desired pca vector. it will then cat them together and make them readable to plumed. the occ and beta stuff is to fix plumed's hacky indexing rules.
#second argument $2 is the reference system
#usage
# bash plumed_scripts/make_pca_files.sh list_pcas.txt ref_average_struct.pdb md_start_struct.pdb
count=1
for i in $(cat $1);
do
echo "making vec files"
vmd -dispdev text $i -f $3 -e ./plumed_scripts/mark_reference_atoms.tcl
echo "REMARK TYPE=OPTIMAL" > vec_struct.pdb
cat marked.pdb | grep -E "^.{62}1\.00\s" > file.pdb
cat file.pdb >> vec_struct.pdb
echo "END" >> vec_struct.pdb
echo "making ref files"
vmd -dispdev text $2 -f $3 -e ./plumed_scripts/mark_reference_atoms.tcl
echo "REMARK TYPE=OPTIMAL" > reference_struct.pdb
cat marked.pdb | grep -E "^.{62}1\.00\s" > file.pdb
cat file.pdb >> reference_struct.pdb
echo "END" >> reference_struct.pdb
cat reference_struct.pdb vec_struct.pdb > plumed_pca_$count.pdb
count=$(($count + 1 ))
done