Statistics
| Branch: | Tag: | Revision:

dockonsurf / modules / fe_change.sh @ 2137c2de

History | View | Annotate | Download (624 Bytes)

1 86112fec Marti Aliod Carles
#!/bin/bash
2 86112fec Marti Aliod Carles
3 86112fec Marti Aliod Carles
molec=$1
4 86112fec Marti Aliod Carles
surf=$2
5 86112fec Marti Aliod Carles
6 86112fec Marti Aliod Carles
clean_surf=$Surface_path/$surf.xyz
7 86112fec Marti Aliod Carles
8 86112fec Marti Aliod Carles
surf_num_atoms=$(head -n1 $clean_surf)
9 86112fec Marti Aliod Carles
for candidate in $MolOnSurf_results_path/$molec/*; do
10 86112fec Marti Aliod Carles
	if [ -d $candidate ]; then
11 86112fec Marti Aliod Carles
		if [ ! -f $candidate/coord.xyz.old ]; then
12 86112fec Marti Aliod Carles
			cp $candidate/coord.xyz $candidate/coord.xyz.old
13 86112fec Marti Aliod Carles
		fi
14 2137c2de Carles Martí
 		head -n$((surf_num_atoms+2)) $clean_surf > $candidate/coord.xyz
15 86112fec Marti Aliod Carles
		tail -n +$((surf_num_atoms+3)) $candidate/coord.xyz.old >> $candidate/coord.xyz
16 86112fec Marti Aliod Carles
		molec_num_atoms=$(tail -n +$((surf_num_atoms+3)) $candidate/coord.xyz.old | wc -l)
17 86112fec Marti Aliod Carles
		sed -i "s/$surf_num_atoms/$(($surf_num_atoms+$molec_num_atoms))/g" $candidate/coord.xyz
18 86112fec Marti Aliod Carles
	fi
19 86112fec Marti Aliod Carles
done