[PyMOL] Get Protein Dimension

2011-04-26 Thread Martin Hediger
Dear all I found that PyMOL offer the cmd.get_extent('protein') function, which returns the dimensions of the selection. Is it complicated to make this function available from within an ordinary Pythonscript? Thanks for hints. Martin

Re: [PyMOL] Get Protein Dimension

2011-04-26 Thread Thomas Holder
On 04/26/2011 01:40 PM, Martin Hediger wrote: Dear all I found that PyMOL offer the cmd.get_extent('protein') function, which returns the dimensions of the selection. Is it complicated to make this function available from within an ordinary Pythonscript? what do you mean with ordinary

Re: [PyMOL] Get Protein Dimension

2011-04-26 Thread Michael Lerner
Hi Martin, The following works for me, although I needed to change 'protein' to 'polymer'. Is 'protein' normally supported as a selection? It doesn't seem to be in 1.4.1. from pymol import cmd cmd.fetch('1rx1') a = cmd.get_extent('polymer') print a is,a Hope that helps, -Michael On Tue, Apr

Re: [PyMOL] Get Protein Dimension

2011-04-26 Thread Hongbo Zhu
you can write your own loop in python to implement the function. fh = open(pdbfilename) coords = numpy.array([[float(line[30:38]),float(line[38:46]),float(line[46:54])] for line in fh.readlines() if line.startswith('ATOM ') or line.startswith('HETATM')]) fh.close() extent =

Re: [PyMOL] Get Protein Dimension

2011-04-26 Thread Martin Hediger
Thanks for the feedback. Yes, the idea was to expose the PyMOL function to Python. I'll check out the relevant pages mentioned. On 26.04.11 14:52, Hongbo Zhu wrote: you can write your own loop in python to implement the function. fh = open(pdbfilename) coords =