On 27/06/12 10:03, Froehlich, Chris wrote:
Dear colleagues,
I want to apply a given x-y-z-rotation/transformation matrix on a pdb
file, save the new pdb file and apply the same matrix again on the new
pdb file and repeat this e.g. 100 times, thereby saving all pdb files
(i.e. 01.pdb, 02.pdb, 03.pdb etc.).
With pdbset this is very easy, but I'm wondering if there is any
script to do so because I don't want to manually change file names all
the time...
I am not very familiar with scripting, but I found something in the
internet.
Can anybody help please with this i.e. is this a reasonable script to
do so?
# repeat a spatial transformation on a pdb file n times.
#!/bin/csh -f
start n=1 until n=x.
pdbset xyzin mypdbfile($n).pdb xyzout mypdbfile($n+1).pdb <<eof-1
transform -
0.87831 0.47808 0 0 0 -1. -0.47808 0.87831 0 0.0
-2.713 0.0
eof-1
In coot, you'd do it like this:
(define m (list 0.87831 0.47808 0 0 0 -1. -0.47808 0.87831 0
0.0 -2.713 0.0))
(let ((orig (read-pdb "start.pdb")))
(for-each (lambda (n)
(apply transform-molecule-by (cons orig m))
(write-pdb-file orig (string-append (number->string n) ".pdb")))
(range 100)))