[BioPython] Bio.PDB rotate/translate
Christian Meesters
meesters at uni-mainz.de
Thu Aug 16 18:50:15 UTC 2007
Hi,
As you can see from my previous mail, I only just started to work with
BioPython today, again.
Still, I dare to ask back a few question.
Actually, I don't understand your question:
> I would like to rotate a specific H and N vector in my structure
> file
Guess, this is a mistake and you don't want to rotate the vector itself.
I presume your structure looks like this:
H N
\/
c1
|
c2
right?
And you want to turn around the axis defined by c1-c2? Then, if I
understand the 'PDB FAQ' correctly the code before the rotaxis line
should read:
c1 = residue[c1-identifier].get_vector()
c2 = residue[c2-identifier].get_vector()
rotation = rotaxis(angle, c1-c2)
Of course, your residue won't look like my sketch ...
>
> rotation = Bio.PDB.rotaxis( math.pi/2.0, Bio.PDB.Vector(1,0,0) )
> translation = Numeric.array( (1,0,0), 'f' )
Here, you would shift the atoms by 1 Å along 'x'. Applied on only two
atoms, bonds would be stretched.
BTW, did you save the altered structure after applying the
rotation/translation?
If this was all wrong, please excuse a newbie answering this question.
But the mail was left unanswered for a while and it is still possible to
correct me ;-).
HTH
Christian
More information about the Biopython
mailing list