Re: [PyMOL] New to PyMol. Want to extract sequence from .pse file w/ colors.

2012-02-27 Thread Thomas Holder

Hi Shane,

I have a script which saves a colored sequence in HTML format. See 
attachment.


Example usage:

run save_colored_fasta.py
save_colored_fasta seq.html

It should be possible to copypaste the colored sequence from your 
browser to excel.


Cheers,
  Thomas

Shane Neeley wrote, On 02/27/12 01:45:

Hi Pymol Network,

I would appreciate someones help in extracting the sequence in the
viewer above the protein. I have gone through the sequence and
changed AAs to different colors based on their position. I would
ideally like to be able to copy that sequence with the colors that
they are coded so that I could export it to an excel file. Is this
possible? 


Thanks very much.

Shane


--
Thomas Holder
MPI for Developmental Biology
Spemannstr. 35
D-72076 Tübingen
'''
(c) 2012 Thomas Holder, MPI for Developmental Biology

License: BSD-2-Clause
'''

from pymol import cmd

def save_colored_fasta(filename, selection='(all)', gapped=1, quiet=1):
'''
DESCRIPTION

Save a html file with colored (by C-alpha atoms) fasta sequence.

USAGE

save_colored_fasta filename [, selection [, gapped ]]
'''
from pymol.exporting import _resn_to_aa as one_letter
from pymol import Scratch_Storage
gapped = int(gapped)
selection = '(%s) and guide' % (selection)
html = []
stored = Scratch_Storage()
def callback(resv, resn, color):
if stored.resv is None:
stored.resv = resv - (resv % 70)
if gapped:
while stored.resv+1  resv:
callback(stored.resv+1, '-', 25)
stored.resv += 1
if stored.resv % 70 == 1:
html.append(('/font\nbr%4d font' % (resv)).replace(' ', 'nbsp;'))
stored.color = None
c = cmd.get_color_tuple(color)
color = '#%02x%02x%02x' % (c[0]*255, c[1]*255, c[2]*255)
aa = one_letter.get(resn, '-')
if color != stored.color:
html.append('/fontfont color=' + color + '')
stored.color = color
html.append(aa)
for obj in cmd.get_object_list(selection):
for chain in cmd.get_chains('model %s and (%s)' % (obj, selection)):
sele = 'model %s and chain %s and (%s)' % (obj, chain, selection)
html.append('\nbrgt;%s_%sfont' % (obj, chain))
stored.resv = None if gapped else 0
stored.color = None
cmd.iterate(sele, 'callback(resv, resn, color)', space=locals())
html.append('/font')
handle = open(filename, 'w')
print  handle, 'htmlbody style=font-family:monospace'
print  handle, ''.join(html)
print  handle, '/body/html'
handle.close()

cmd.extend('save_colored_fasta', save_colored_fasta)

cmd.auto_arg[1].update([
('save_colored_fasta', cmd.auto_arg[0]['zoom']),
])

# vi: ts=4:sw=4:smarttab:expandtab
--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
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] Little coordinate cross in Pymol?

2012-02-27 Thread Gudrun Lotze
Dear all,

is it possible to show in Pymol a little coordinate cross with axes x,y,z, for 
example like in VMD, please?
I have a protein made from dummy atoms and there is no unit cell.
I just want to show clearly which plane is shown when presenting the model in 
my document.

Thank you for your help.
Kind regards
Gudrun Lotze


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
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


Re: [PyMOL] Little coordinate cross in Pymol?

2012-02-27 Thread David Hall
http://pymolwiki.org/index.php/Axes

-David

On Feb 27, 2012, at 5:38 AM, Gudrun Lotze gudrun.lo...@gmx.net wrote:

 Dear all,
 
 is it possible to show in Pymol a little coordinate cross with axes x,y,z, 
 for example like in VMD, please?
 I have a protein made from dummy atoms and there is no unit cell.
 I just want to show clearly which plane is shown when presenting the model in 
 my document.
 
 Thank you for your help.
 Kind regards
 Gudrun Lotze
 
 
 --
 Try before you buy = See our experts in action!
 The most comprehensive online learning library for Microsoft developers
 is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
 Metro Style Apps, more. Free future releases when you subscribe now!
 http://p.sf.net/sfu/learndevnow-dev2
 ___
 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

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
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


Re: [PyMOL] Little coordinate cross in Pymol?

2012-02-27 Thread Gudrun Lotze
Dear all,

I used the following script David pointed out:

from pymol.cgo import *
from pymol import cmd
 
w = 0.06 # cylinder width 
l = 0.75 # cylinder length
h = 0.25 # cone hight
d = w * 1.618 # cone base diameter
 
obj = [CYLINDER, 0.0, 0.0, 0.0,   l, 0.0, 0.0, w, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0,
   CYLINDER, 0.0, 0.0, 0.0, 0.0,   l, 0.0, w, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0,
   CYLINDER, 0.0, 0.0, 0.0, 0.0, 0.0,   l, w, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0,
   CONE,   l, 0.0, 0.0, h+l, 0.0, 0.0, d, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 
0.0, 1.0, 1.0, 
   CONE, 0.0,   l, 0.0, 0.0, h+l, 0.0, d, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 
0.0, 1.0, 1.0, 
   CONE, 0.0, 0.0,   l, 0.0, 0.0, h+l, d, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 
1.0, 1.0, 1.0]
 
cmd.load_cgo(obj, 'axes')


The axes appear, but the screen in pymol is now split into two sections with 
the cross covering one part. Is there a chance to move the cross closer to the 
model in one screen section?
A bit like shown in picture on page http://pymolwiki.org/index.php/Axes .

Kind regards
Gudrun 





Am 27.02.2012 um 12:01 schrieb David Hall:

 http://pymolwiki.org/index.php/Axes
 
 -David
 
 On Feb 27, 2012, at 5:38 AM, Gudrun Lotze gudrun.lo...@gmx.net wrote:
 
 Dear all,
 
 is it possible to show in Pymol a little coordinate cross with axes x,y,z, 
 for example like in VMD, please?
 I have a protein made from dummy atoms and there is no unit cell.
 I just want to show clearly which plane is shown when presenting the model 
 in my document.
 
 Thank you for your help.
 Kind regards
 Gudrun Lotze
 
 
 --
 Try before you buy = See our experts in action!
 The most comprehensive online learning library for Microsoft developers
 is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
 Metro Style Apps, more. Free future releases when you subscribe now!
 http://p.sf.net/sfu/learndevnow-dev2
 ___
 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

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
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

Re: [PyMOL] pymol 1.4.1 (incentive), segfault upon help-about

2012-02-27 Thread Greipel.Joachim
Hi Jason,

I just installed pymol 1.5.0.3 on our linux machines and the segfault in
libtcl8.5.so upon help-about is still present. Do you have any hint when
this will be fixed?

Best regards,
Joachim 
--
Dr. rer. nat. Joachim Greipel
Med. Hochschule Hannover
Biophys. Chem. OE 4350
Carl-Neuberg-Str. 1
30625 Hannover
Germany
 
Fon: +49-511-532-3718
Fax: +49-511-532-16-3718
 
 

 -Ursprüngliche Nachricht-
 Von: Jason Vertrees [mailto:jason.vertr...@schrodinger.com] 
 Gesendet: Donnerstag, 19. Mai 2011 17:53
 An: Greipel, Joachim Dr.
 Cc: pymol-users@lists.sourceforge.net; h...@schrodinger.com
 Betreff: Re: [PyMOL] pymol 1.4.1 (incentive), segfault upon 
 help-about
 
 Hi Joachim,
 
  I always get a segmentation fault, when I click 
 help-about to see the
  version details of pymol. The respective entry in 
 /var/log/messages is:
 
  pymol.exe[4991]: segfault at 3e0019b ip f74857a0 sp 
 f3bab9a8
  error 4 in libtcl8.5.so[f741+ed0
  00]
 
 Indeed on a few Linux distros, there is a crash when selecting Help 
 About.  We're trying to track down the cause.  The error happens in
 our pure Python code and the segfault happens in the libtcl8.5 shared
 library.
 
 If you're checking for the PyMOL version number, please use
 get_version in the meantime.
 
 Cheers,
 
 -- Jason
 
 -- 
 Jason Vertrees, PhD
 PyMOL Product Manager
 Schrodinger, LLC
 
 (e) jason.vertr...@schrodinger.com
 (o) +1 (603) 374-7120
 


smime.p7s
Description: S/MIME cryptographic signature
--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
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

Re: [PyMOL] Little coordinate cross in Pymol?

2012-02-27 Thread Thomas Holder
Hi Gudrun,

On 02/27/2012 01:36 PM, Gudrun Lotze wrote:
 The axes appear, but the screen in pymol is now split into two sections
 with the cross covering one part. Is there a chance to move the cross
 closer to the model in one screen section?
 A bit like shown in picture on page http://pymolwiki.org/index.php/Axes .

You can drag the axes object with the mouse. In the right panel, click 
on A  drag and then use Shift+MiddleMouseButton to drag it.

If you prefer the command line over mouse, you could use translate and 
rotate commands:
http://pymolwiki.org/index.php/Translate
http://pymolwiki.org/index.php/Rotate

Cheers,
   Thomas

-- 
Thomas Holder
MPI for Developmental Biology
Spemannstr. 35
D-72076 Tübingen

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
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


Re: [PyMOL] pymol 1.4.1 (incentive), segfault upon help-about

2012-02-27 Thread Troels Emtekær Linnet
Try install tkinter

Tkinter uses tcl 8.4 (something...)



Troels Emtekær Linnet
Lyongade 24. 4.mf, 2300 København S
Mobil: +45 60210234



2012/2/27 greipel.joac...@mh-hannover.de

 Hi Jason,

 I just installed pymol 1.5.0.3 on our linux machines and the segfault in
 libtcl8.5.so upon help-about is still present. Do you have any hint when
 this will be fixed?

 Best regards,
 Joachim
 --
 Dr. rer. nat. Joachim Greipel
 Med. Hochschule Hannover
 Biophys. Chem. OE 4350
 Carl-Neuberg-Str. 1
 30625 Hannover
 Germany

 Fon: +49-511-532-3718
 Fax: +49-511-532-16-3718



  -Ursprüngliche Nachricht-
  Von: Jason Vertrees [mailto:jason.vertr...@schrodinger.com]
  Gesendet: Donnerstag, 19. Mai 2011 17:53
  An: Greipel, Joachim Dr.
  Cc: pymol-users@lists.sourceforge.net; h...@schrodinger.com
  Betreff: Re: [PyMOL] pymol 1.4.1 (incentive), segfault upon
  help-about
 
  Hi Joachim,
 
   I always get a segmentation fault, when I click
  help-about to see the
   version details of pymol. The respective entry in
  /var/log/messages is:
  
   pymol.exe[4991]: segfault at 3e0019b ip f74857a0 sp
  f3bab9a8
   error 4 in libtcl8.5.so[f741+ed0
   00]
 
  Indeed on a few Linux distros, there is a crash when selecting Help 
  About.  We're trying to track down the cause.  The error happens in
  our pure Python code and the segfault happens in the libtcl8.5 shared
  library.
 
  If you're checking for the PyMOL version number, please use
  get_version in the meantime.
 
  Cheers,
 
  -- Jason
 
  --
  Jason Vertrees, PhD
  PyMOL Product Manager
  Schrodinger, LLC
 
  (e) jason.vertr...@schrodinger.com
  (o) +1 (603) 374-7120
 


 --
 Try before you buy = See our experts in action!
 The most comprehensive online learning library for Microsoft developers
 is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
 Metro Style Apps, more. Free future releases when you subscribe now!
 http://p.sf.net/sfu/learndevnow-dev2
 ___
 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

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
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

Re: [PyMOL] Little coordinate cross in Pymol?

2012-02-27 Thread Thomas Holder
Dear Gudrun,

I have no experience with PyMOL on Mac. Maybe this helps:
http://pymolwiki.org/index.php/Mouse_Controls

Deselecting objects does not help, because by default you transform in 
camera space, which affects all objects. What you need is transformation 
in model space, which is achieved by A  drag or A  drag matrix for 
a particular object.

Here an example to use the command line:
translate [10,0,0], object=axes

Hope that helps.

Cheers,
   Thomas

On 02/27/2012 03:21 PM, Gudrun Lotze wrote:
 Dear Thomas Thank you for your reply. The mouse dragging does not
 work because the Mac starts to move windows in a very beautiful way
 which I never came across. :-) So I used a 2-button mouse. But there
 is still a problem. The dummy atom model and the three axes object
 are always moving together when dragging around. Even when I deselect
 the model, drag the cross, and re-select the model, the model has
 moved as well. May I have to shift the cross within the script?

 Kind regards Gudrun

 Am 27.02.2012 um 12:50 schrieb Thomas Holder:

 Hi Gudrun,

 On 02/27/2012 01:36 PM, Gudrun Lotze wrote:
 The axes appear, but the screen in pymol is now split into two
 sections with the cross covering one part. Is there a chance to
 move the cross closer to the model in one screen section? A bit
 like shown in picture on page http://pymolwiki.org/index.php/Axes
 .

 You can drag the axes object with the mouse. In the right panel,
 click on A  drag and then use Shift+MiddleMouseButton to drag
 it.

 If you prefer the command line over mouse, you could use translate
 and rotate commands: http://pymolwiki.org/index.php/Translate
 http://pymolwiki.org/index.php/Rotate

 Cheers, Thomas

-- 
Thomas Holder
MPI for Developmental Biology
Spemannstr. 35
D-72076 Tübingen

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
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] Question about ray tracing, set_view, surface smoothness

2012-02-27 Thread Gudrun Lotze
Dear all,

I wish to ray trace my object so it looks nice. I have chosen a mesh as surface 
representation.

I did 
viewport 1024, 768
ray 1024, 768

But the mesh is black afterwards and not anymore blue.
Is there a chance to keep the color and have less dominant lines for the mesh?

Is there a chance to view the object in question for example in the XY, YZ 
plane? Are there somewhere easy rotation matrix available?
I tried to bring my object manually into the YZ plane view, for example, but it 
works only halfhearted. 
It would be nice to be able to tell pymol in a very easy way which view I would 
like to see the object.

Thank you for your patience.
Kind regards
Gudrun

 
--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
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


Re: [PyMOL] Question about ray tracing, set_view, surface smoothness

2012-02-27 Thread Pete Meyer
Hi Gudrun,

 But the mesh is black afterwards and not anymore blue.

You may want to check your light position, or try a slighter blue.

 Is there a chance to keep the color and have less dominant lines for the mesh?

I'm not artistically skilled enough to know about less dominant lines, 
but the mesh_width setting can be used to make thinner (or thicker) lines.

 Is there a chance to view the object in question for example in the XY, YZ 
 plane? Are there somewhere easy rotation matrix available?
 I tried to bring my object manually into the YZ plane view, for example, but 
 it works only halfhearted. 
 It would be nice to be able to tell pymol in a very easy way which view I 
 would like to see the object.

The turn/rotate commands can be used fairly easily for 90 degree turns; 
but I'm not sure if that's what you're asking about.

Pete


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
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