Re: [PyMOL] Embedding pymol

2005-10-04 Thread Filipe Maia

While I've got your attention

Is it possible to embed a pymol window into a bigger independent
application?



I've written a PymolQt C++ class that tries to put pymol inside a QWidget
and replaced the glut input functions by Qt stuff. I had to do some  
changes to

pymol to make this work and the whole thing is very inelegant.
The source code is in  
http://xray.bmc.uu.se/~filipe/files/gmxg-src-0.12.tar.gz,
and linux binaries in  
http://xray.bmc.uu.se/~filipe/files/gmxg-linux-0.12.tar.gz

(i don't really know if they work).
Here is the result http://xray.bmc.uu.se/~filipe/files/pymolGL.png.
To find for the modification in pymol grep for "EMB C". The relevant
c++ files are pymolGL.cpp and pymolGL.h.
In any case this might help as a starting point.

Filipe



--
All generalizations are false, including this one.
 -- Mark Twain



Re: [PyMOL] question abut loading xplor map

2005-01-15 Thread Filipe Maia

On Fri, 14 Jan 2005 11:53:00 -0500, Qun Wan  wrote:


Hi, everyone:
I have a simple question about loading the electron density map. I
have generated x-plor format map and try to load it into pymol.
However, pymol only shows me the unit cell, not the map.
Does anyone know how can I "see" the map, not just the unit cell?


There are several representations for maps, the most common one is isomesh.
To view an isomesh of the map do something like this:

isomesh mesh,

You can then change the level of the map with isolevel (help isolevel).
Hope it helps.

Cheers.



--
All generalizations are false, including this one.
 -- Mark Twain



Re: [PyMOL] rendering pictures to publish

2004-12-06 Thread Filipe Maia


For OpenGL-based images, you're limited by the maximum dimensions of your
display.  Hopefully that restriction will be eliminated before too much
longer...


Actually the restriction is how big a window your window manager supports,
which can be bigger than your display. The png commands still captures the
entire window even if it's not entirely visible.
I was able to get some big pictures using this trick in window maker.

--
All generalizations are false, including this one.
 -- Mark Twain



Re: [PyMOL] List participation commentary......

2004-11-19 Thread Filipe Maia
On Wed, 17 Nov 2004 10:48:49 -0800 (PST), Thomas Stout  
 wrote:




Hi All --

Recently I've noticed a growing number of questions
being posed to the PyMOL mailing list that never seem
to get responses.  I infer from this that one or both
of two things are happening: either 1) list members
that know the answers to these questions are not
responding to the questions, or 2) the responses are
happening off-list...either way I would like to
appeal to everyone to use the list fully.  There are
many "lurkers" (myself included) that would very much
like to see and learn from the answers to many of
these questions.  Other mailing lists (eg, CCP4) have
adopted an additional SOP where the original poser of
a question ultimately follows-up with a summary of the
responses - this seems like a good idea to me for this
list as well.  Ultimately the mailing list serves as a
form of living manual to the program, so it would be
nice to preserve as many of these insights as
possible!


I agree entirely. It would also be nice if the default reply
was to the list and not only to the individual that asked the question.



--
All generalizations are false, including this one.
 -- Mark Twain



Re: [PyMOL] Swissprot

2004-10-18 Thread Filipe Maia


Is there a PDB parser class somewhere for reading in the PDB files?
layer2/ObjectMolecule2.c:ObjectMoleculePDBStr2CoordSet() is probably a  
good place to start.





--
All generalizations are false, including this one.
 -- Mark Twain



[PyMOL] Hidden files in file browser

2004-09-08 Thread Filipe Maia
I think it would be nice if pymol didn't show the hidden files in the file  
browser,

as there are usually quite a lot of those in a user home.


--
All generalizations are false, including this one.
-- Mark Twain



Re: [PyMOL] electron density maps

2004-08-08 Thread Filipe Maia
On Sun, 08 Aug 2004 17:57:00 -0400, christopher faehnle  
 wrote:


I am a new pymol user and am trying to load an electron density map  
(ccp4 format).  When I do this nothing happens.  Any suggestions, tips,  
etc would be appreciated.


The map probably loads just fine (there should be a new object showing up  
on the right side panel), but it's doesn't show anything you can see, it  
simply reads the map to memory. To actual create a representation of the  
map do something like


isomesh ,

So if for example you had a ccp4 map called foo.ccp4, when you load it, it  
will create a foo object. To get the mesh simply do:


isomesh mesh,foo

If this is not the problem, then please describe pymol version/platform  
and give an example map where it doesn't work.



Filipe
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/



Re: [PyMOL] Pymol segmentation fault - fedora core 1

2004-07-26 Thread Filipe Maia
On Mon, 26 Jul 2004 10:40:47 +0100, Roger Dodd   
wrote:



Hi everyone,

I've recently updated to the 0.97 release of pymol and although it ran  
fine to start with, it's now generating a segmentation fault. I  
installed from the * pymol-0_97-bin-linux-libc6-i386.tgz*  
  
file into /usr/local/pymol and ran setup.sh. Then when running the  
pymol.com script I get the following:


./pymol.com: line 14: 31156 Segmentation fault   
$PYMOL_PATH/pymol.exe $*


I'm not sure exactly what's causing this and any help would be  
appreciated. I've tried completely removing the pymol directory and  
reinstalling but I still get the same error.


$PYMOL_PATH/pymol.exe $* <- this looks suspicious.

Did you tried to compile pymol as a monolythic thing? I don't beleive that  
still works.

I use $PYMOL_PATH/ext/bin/python $PYMOL_PATH/modules/pymol/__init__.py $*

I'll send you my Rules.make and pymol.com.
I was able to build it simply with a symlink from ext to /usr




Cheers

Roger


---
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
___
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users





--
Don't go around saying the world owes you a living.
The world owes you nothing.  It was here first.
 -- Mark Twain



Re: [PyMOL] code for calculating surface area

2004-07-20 Thread Filipe Maia
On Mon, 19 Jul 2004 18:27:18 +0930, Michael Sorich  
 wrote:



Hi,

Could someone point me to the code used to calculate surface area (i.e.
code to calculate surface dots and the code to find the area of the
dots)? I presume that it is somewhere in the PyMOL\modules\pymol or
PyMOL\modules\chempy modules.



RepDotDoNew in layer2/RepDot.c might be what you want.

Cheers,
Filipe

--
Don't go around saying the world owes you a living.
The world owes you nothing.  It was here first.
 -- Mark Twain



[PyMOL] Problem with Save Session

2004-04-20 Thread Filipe Maia
If you open a session, then open another session and do "Save Session" it 
will overwrite the file of
the first session with the second session and it won't even issue a 
warning, which was really not what
was i expected to when i did the Save Session. I think something like a 
variable
that indicates the current working session is not being updated. The same 
problem happens when you
open a session and then hit the reinitialize button. For me the expected 
behaviour would for the
Save Session to do the same as a Save As after the reinitialization. 
Instead it also overwrites the

file you were previously working on.

All this was tested on pymol-0.93 linux version.

--
Don't go around saying the world owes you a living.
The world owes you nothing.  It was here first.
 -- Mark Twain



Re: [PyMOL] Delete atoms out of unit cell box

2004-04-07 Thread Filipe Maia
I have tweaked a script by Tsjerk Wassenaar that can remove atoms out of a 
unit cell.
I have encountered 2 problems. First is even though i knew the Atom i 
wanted to remove from the model
i had no easy way to do it because i didn't found any unique identifier 
for an Atom in the atom class.

So what i did was to treat each object separately. This seems to work.
The other problem is that pymol segfaults with big selections. I think the 
problem is the number of

logical operations in the selection and not the string size.

Here is the script:

from pymol import cmd
import math

## Determining the determinant of matrix a 
##


def det(a):
return 
a[0][0]*(a[1][1]*a[2][2]-a[2][1]*a[1][2])-a[1][0]*(a[0][1]*a[2][2]-a[2][1]*a[0][2])+a[2][0]*(a[0][1]*a[1][2]-


a[1][1]*a[0][2])

   ## Basic inversion of a 3x3-matrix a 
##

def minv(a):
c = 1/det(a)
return [[ c*(a[1][1]*a[2][2]-a[2][1]*a[1][2]),
  -c*(a[0][1]*a[2][2]-a[2][1]*a[0][2]),
  c*(a[0][1]*a[1][2]-a[1][1]*a[0][2]) ],
[ -c*(a[1][0]*a[2][2]-a[2][0]*a[1][2]),
  c*(a[0][0]*a[2][2]-a[2][0]*a[0][2]),
  -c*(a[0][0]*a[1][2]-a[1][0]*a[0][2]) ],
[ c*(a[1][0]*a[2][1]-a[2][0]*a[1][1]),
  -c*(a[0][0]*a[2][1]-a[2][0]*a[0][1]),
  c*(a[0][0]*a[1][1]-a[1][0]*a[0][1]) ]]

## Multiplying a vector b by matrix a 
##

def mvmult(a, b):
return [ a[0][0]*b[0]+a[0][1]*b[1]+a[0][2]*b[2],
 a[1][0]*b[0]+a[1][1]*b[1]+a[1][2]*b[2],
 a[2][0]*b[0]+a[2][1]*b[1]+a[2][2]*b[2] ]

##
## Protein / image operations 


##
# p should be the pdb molecule from which 
the
# unit cell information will be 
derived


def rmoutside(p = None):
if p == None:
print '# Error: No box specified! #'
return
objects = cmd.get_names("objects")
cmd.select("out_of_box","none")
for j in range(len(objects)):
print objects[j]
if(cmd.get_type(objects[j]) == "object:molecule"):
sel = "("+str(objects[j])+")"
sel = cmd.get_model(sel)
par = cmd.get_symmetry(p)
par[3] = par[3]/360*2*math.pi
par[4] = par[4]/360*2*math.pi
par[5] = par[5]/360*2*math.pi

v_a = [par[0],0,0]
v_b = [math.cos(par[5])*par[1],math.sin(par[5])*par[1],0]
v_c = [par[2]*math.cos(par[4]),
   
par[1]*par[2]*math.cos(par[3])-par[2]*math.cos(par[4])*v_b[0],
   
math.sqrt(par[2]*par[2]-par[2]*math.cos(par[4])*par[2]*math.cos(par[4])-
 
par[1]*par[2]*math.cos(par[3])-par[2]*math.cos(par[4])*v_b[0]*par[1]*par[2]*math.cos(par[3])-par[2]*math.cos(par[4])*v_b[0])]
b = [ v_a,v_b,v_c ]

# b should now be a box-matrix: [ [ x1, y1, z1 ], [ x2, y2, z2 
], [ x3, y3, z3 ] 
]

S = [ [b[0][0], b[1][0], b[2][0]],
  [b[0][1], b[1][1], b[2][1]],
  [b[0][2], b[1][2], b[2][2]] ]
T = minv(S)
list = "out_of_box";
for i in range(len(sel.atom)):
sel.atom[i].coord = mvmult(T, sel.atom[i].coord)
if sel.atom[i].coord[0] < 0 or sel.atom[i].coord[0] > 1 or 
sel.atom[i].coord[1] < 0 or sel.atom[i].coord[1] > 1 or 
sel.atom[i].coord[2] < 0 or se\

l.atom[i].coord[2] > 1:
list = "(index "+str(sel.atom[i].index)+" and 
"+str(objects[j])+") or " + list


# this is to try to make sure pymol doesn't seg 
fault
# so when we already have a big list for selection 
make the selection and empty the list

if(len(list) > 2000):
cmd.select("out_of_box", list)
list = "out_of_box"
else:
sel.atom[i].coord = mvmult(S, sel.atom[i].coord)
cmd.select("out_of_box", list)




[PyMOL] Delete atoms out of unit cell box

2004-04-06 Thread Filipe Maia
Is there an easy way to delete all atoms that fall outside of the unit 
cell after doing a symexp?

I'm doing it by hand which takes too long and is error prone...
Thanks in advance.