From: Lieven B. <li...@ul...> - 2003-11-18 08:11:06
|
On Monday 17 November 2003 14:06, Laurence Pearl wrote: > I should add that I don't actually know > how to program in python and have no idea how its 'tuples' work, so > this is a very FORTRAN-like routine - feel free to improve it. I have attached a "Pythonized" version of the code. It uses docstrings for the functions, try...except blocks to check some of the parameters, and things like ("%8.3f" * 17) to save some repetition of format specifiers. Python is cool! I have also changed the script to add two commands to PyMol using cmd.extend: "camtrav first,nframes,selection,zoom,buffer" and "seqfly object,firstres,lastres". Usage examples: #--------------------------------- load protein.pdb run camera_travel.py mset 1 x150 zoom all camtrav 1,100,(resi 50),1,4 mplay # This will zoom in from the complete molecule to residue 50. #--------------------------------- #--------------------------------- load protein.pdb run camera_travel.py mset 1 x150 seqfly protein,1,8 mplay # This will visit the sequence from residue 1 to 8 #--------------------------------- Finally, I ran into some trouble in a lysozyme structure (PDB 103L). At residue 139, cosom becomes slightly larger than 1 (1.0008 or so) and acos(cosom) fails. Also, omega and sinom become zero in this case, so the divisions by sinom fail. I added some checks to normalize this situation and stop the code from crashing, but we should look into what's causing this. -- Lieven Buts Department of Ultrastructure Vrije Universiteit Brussel |