[Chimera-users] Problem with a script calculating distance between residues in a single pdb file with several models
goddard at sonic.net
Fri Aug 5 10:04:12 PDT 2011
Python uses indentation for "for" loops and other code blocks. So
you just need to indent the rc(...) line in the for loop by one or more
spaces. If you end up adding more lines inside the "for" loop they all
have to be indented by the same number of spaces.
> Dear all,
> Here is a single pdb file called modetest_14.pdb. It contains 6
> structures: 1 protein MutS (only chain B) with 5 different
> conformations + another protein MutL (chains A and B).
> In Chimera, the protein with the 5 different conformations is
> displayed as model 0.1 to 0.5. The other protein is model 0.6.
> I would like to calculate the distance between the residue 239 of MutS
> chain B (for the 5 conformations) and the residue 169 of MutL chain A.
> I wrote this script which reports this error message: expected an
> indented block (scriptdistance.py, line 4)
> *from chimera import runCommand as rc
> rc(r"open C:\Program Files (x86)\Hex 6.3\examples\New Hex
> for i in range(1, 6):
> rc("distance #0.%d:239.B at N #0.6:169.A at N" % i)*
> May you tell me what is wrong? the script correctly opens the file so
> I suppose it is the python string #0.%d (intended to specify 0.1,
> 0.2,... 0.5)!?
> Thanks for your help
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Chimera-users