Statistics
| Branch: | Tag: | Revision:

dockonsurf / modules / fe_change.sh @ 2137c2de

History | View | Annotate | Download (624 Bytes)

1
#!/bin/bash
2

    
3
molec=$1
4
surf=$2
5

    
6
clean_surf=$Surface_path/$surf.xyz
7

    
8
surf_num_atoms=$(head -n1 $clean_surf)
9
for candidate in $MolOnSurf_results_path/$molec/*; do
10
	if [ -d $candidate ]; then
11
		if [ ! -f $candidate/coord.xyz.old ]; then
12
			cp $candidate/coord.xyz $candidate/coord.xyz.old
13
		fi
14
 		head -n$((surf_num_atoms+2)) $clean_surf > $candidate/coord.xyz
15
		tail -n +$((surf_num_atoms+3)) $candidate/coord.xyz.old >> $candidate/coord.xyz
16
		molec_num_atoms=$(tail -n +$((surf_num_atoms+3)) $candidate/coord.xyz.old | wc -l)
17
		sed -i "s/$surf_num_atoms/$(($surf_num_atoms+$molec_num_atoms))/g" $candidate/coord.xyz
18
	fi
19
done
20