From: Tsjerk W. <ts...@gm...> - 2011-10-27 16:02:19
|
Hey :) Does the script pasted below do what you want? It does not move the molecule(s), but it returns a list of occupied bins with the ids, names and chains of residues in it. Hope it helps, Tsjerk ### from pymol import cmd def _bin(x,d): d = float(d) a,b,n = min(x),(1-1e-16)/(max(x)-min(x)),int((max(x)-min(x))/d+0.5) return [ int(b*(i-a)*n)*d for i in x ] def bin(sele="all",d=5): m = cmd.get_model(sele) b = zip(*[ _bin(i,5) for i in zip(*m.get_coord_list()) ]) print b d = dict() for i,j in zip(b,m.atom): d[i] = d.get(i,[]) + [(j.resi, j.resn, j.chain)] return d.items() On Thu, Oct 27, 2011 at 4:25 PM, Thomas Holder <sp...@us...> wrote: > Hi Anasuya, > >> how do i put a protein molecule inside a cube with x-axis spanning till the >> largest x-coordinate, y-axis spanning till the largest y-coordinate, and z-axis >> spanning till the largest z-coordinate? >> >> Once i do this, can i divide the larger cube(i.e. the one holding the entire >> protein) into smaller ones of lesser dimensions? Say, 5A x 5A x 5A? > > I'm not aware of any straightforward solution for this. You could write > a python script that creates selections for each (sub)cube, but I guess > it will be a quite complex script. Have a look at > http://pymolwiki.org/index.php/SelInside which should cover all > necessary API functions. > >> Once i generate these smaller cubes, is there a way via pymol, by which i can >> navigate through the protein molecule, (smaller)cube by (smaller)cube? >> As in, can pymol be used to tell me which residues are lying in which (smaller) >> cube and so on? > > If you have selections for each cube, try this to lookup cubes that > contain atoms of residue number 10: > > print cmd.get_names('public_selections', 0, 'resi 10') > >> Can all this be done in a single pymol window/script? >> please let me know. >> >> Thanks >> -Anasuya > > Cheers, > Thomas > > -- > Thomas Holder > MPI for Developmental Biology > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Cisco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > PyMOL-users mailing list (PyM...@li...) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pym...@li... > -- Tsjerk A. Wassenaar, Ph.D. post-doctoral researcher Molecular Dynamics Group * Groningen Institute for Biomolecular Research and Biotechnology * Zernike Institute for Advanced Materials University of Groningen The Netherlands |