Re: [PyMOL] Drawing grid of cubes

2015-12-13 Thread Tsjerk Wassenaar
Hi Damien,

The following code bins particles and makes a grid of pseudoatoms, putting
the count in the b-factor field and as radius. You should be able to
convert these to cubes using the script (but doing scaled spheres, and
coloring according to count is nifty too).

import numpy

def griddify(selection='all', bins=24, name="gid"):
"""Count particles in grid cells and generate pseudatoms for cell
centers"""
X=numpy.array(cmd.get_model().get_coord_list())
lo = X.min()
up = X.max()
rng = up-lo
bins2 = bins*bins
Y = ((bins-1e-8)*(X-lo)/rng).astype('int')
Y[:,1] *= bins
Y[:,2] *= bins2
B = numpy.bincount( Y.sum(axis=1) )
for a,b in enumerate(B):
if b:
x = l + rng*(a%bins+0.5)/bins
y = l + rng*((a%(bins2))/bins+0.5)/bins
z = l + rng*(a/(bins2)+0.5)/bins
cmd.pseudoatom(name,pos=(x,y,z), b=b,vdw=b)


Hope it helps,

Tsjerk


On Fri, Dec 11, 2015 at 6:50 PM, Damien Clavel  wrote:

> Hi Tsjerk,
>
> As a matter of fact the replacement of atoms by cubes is possible with
> cubes.py. However, this applet doesn't suit my project.
> Indeed, I would like to get a script that describe your second guess!
>
> D
> Le 11/12/15 17:12, Tsjerk Wassenaar a écrit :
>
>
> Hi Damien,
>
> Do you mean replacing the atoms by cubes, or by binning the atoms on a 3D
> grid and show these cubes if filled?
>
> Cheers,
>
> Tsjerk
>
> On Fri, Dec 11, 2015 at 4:51 PM, Damien Clavel  wrote:
>
>> Good evening pymol users,
>>
>> I would like to represent a protein with a superimposed 3D grid of cubes.
>> I tried the applet cubes.py but it is not appropriate for me...
>>
>> So my goal is to control the size of the cubes that will be part of such
>> grid.
>> In addition, it will be really great if I could even control the color
>> (shaded) of each cubes.
>>
>> Does anyone could help me?
>>
>> --
>> *Damien CLAVEL*
>> Cellphone +33 7 81 66 61 70
>> Landline   +33 4 57 42 87 35
>> PhD student at Laboratoire Chimie Physique (UP Sud)
>> and Institut de Biologie Structurale (EPN Campus)
>> --
>> Laboratoire de Chimie Physique
>> Institut de
>> Biologie Structurale 
>> Bul. 350 Campus Orsay EPN Campus
>> 15, Av. Jean Perrin 6, rue Jules Horowitz
>> F-91405 ORSAY Cedex F-38000 GRENOBLE
>>
>>[image: Image and video hosting by TinyPic]
>> 
>>
>>
>> --
>>
>> ___
>> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>>
>
>
>
> --
> Tsjerk A. Wassenaar, Ph.D.
>
>
> --
> *Damien CLAVEL*
> Cellphone +33 7 81 66 61 70
> Landline   +33 4 57 42 87 35
> PhD student at Laboratoire Chimie Physique (UP Sud)
> and Institut de Biologie Structurale (EPN Campus)
> --
> Laboratoire de Chimie Physique
> Institut de
> Biologie Structurale 
> Bul. 350 Campus Orsay EPN Campus
> 15, Av. Jean Perrin 6, rue Jules Horowitz
> F-91405 ORSAY Cedex F-38000 GRENOBLE
>
>[image: Image and video hosting by TinyPic]
> 
>



-- 
Tsjerk A. Wassenaar, Ph.D.
--
___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

[PyMOL] pymol crashed reading any structure file

2015-12-13 Thread Albert
Dear:

I've compiled pymol-1.8.0 under my Linux X64 OS. I found that Pymol can 
start by command:

pymol

without any complaints or erros. However, when I try to load a .pdb file 
into pymol, pymol always failed with following messages:


---
stephen@linux:~/tmp> pymol 4eiy.pdb
  PyMOL(TM) Molecular Graphics System, Version 1.8.0.0.
  Copyright (c) Schrodinger, LLC.
  All Rights Reserved.

 Created by Warren L. DeLano, Ph.D.

 PyMOL is user-supported open-source software.  Although some versions
 are freely available, PyMOL is not in the public domain.

 If PyMOL is helpful in your work or study, then please volunteer
 support for our ongoing efforts to create open and affordable 
scientific
 software by purchasing a PyMOL Maintenance and/or Support subscription.

 More information can be found at "http://www.pymol.org;.

 Enter "help" for a list of commands.
 Enter "help " for information on a specific command.

  Hit ESC anytime to toggle between text and graphics.

  Detected OpenGL version 2.0 or greater. Shaders available.
  Detected GLSL version 1.30.
  OpenGL graphics engine:
   GL_VENDOR:   VMware, Inc.
   GL_RENDERER: Gallium 0.4 on llvmpipe (LLVM 3.4, 256 bits)
   GL_VERSION:  2.1 Mesa 10.0.3
  Detected 4 CPU cores.  Enabled multithreaded rendering.
HEADERMEMBRANE PROTEIN06-APR-12   4EIY
TITLE CRYSTAL STRUCTURE OF THE CHIMERIC PROTEIN OF A2AAR-BRIL IN COMPLEX
TITLE2 WITH ZM241385 AT 1.8A RESOLUTION
COMPNDMOL_ID: 1;
COMPND   2 MOLECULE: ADENOSINE RECEPTOR A2A/SOLUBLE CYTOCHROME B562 CHIMERA;
COMPND   3 CHAIN: A;
COMPND   4 SYNONYM: CYTOCHROME B-562;
COMPND   5 ENGINEERED: YES;
COMPND   6 MUTATION: YES
  ObjectMolecule: Read secondary structure assignments.
  ObjectMolecule: Read crystal symmetry information.
  CmdLoad: "4eiy.pdb" loaded as "4eiy".
/home/stephen/install/pymol-1.8.0/pymol: line 3: 10490 Segmentation 
fault  "/usr/bin/python" 
"/home/stephen/install/pymol-1.8.0/modules/pymol/__init__.py" "$@"
-

I am just wondering what's the problem? I also tried .cif, .mol2 files, 
and all of them failed.

thx a lot

--
___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net