On Tue, 2012-06-19 at 17:31 +0200, Robbie Joosten wrote:
> What if the displacement is a translation and a rotation?
Excellent point. A slight modification of this
http://strucbio.biologie.uni-konstanz.de/ccp4wiki/index.php/Print_the_shifts_in_individual_atom_positions
will do as follows
grep 'ATOM\|HETATM' file1.pdb file2.pdb | grep -v REMARK | cut -d: -f
2 | cut -c 13-54 | sort | awk 'BEGIN {FIELDWIDTHS = "14 28"; pt=""}
{if(pt==$1) print pr,$2; pt=$1; pr=$0;}' | awk 'BEGIN {FIELDWIDTHS =
"14 4 8 8 8 5 8 8 8"} {printf "%s %8.4f\n",$1,sqrt(($3-$7)^2+($4-$8)^2
+($5-$9)^2);}' | awk 'BEGIN {FIELDWIDTHS = "4 1 3 1 1 5 9"} {s2+=$7^2;}
END {print sqrt(s2/NR);}'
Word of caution - this uses rather recent version of awk, some older
versions won't support the fixed width argument splitting.
Naturally, a simple python script would be even more straightforward.
Hope you don't mind that I posted this back to the whole bb
--
After much deep and profound brain things inside my head,
I have decided to thank you for bringing peace to our home.
Julian, King of Lemurs
|