Discussion:
[PyMOL] Ploting coordinates
Suzanne Scott
2015-09-21 19:06:21 UTC
Permalink
Hi everyone,

I hope this isn’t a silly question, but I’m not sure how to do it: I want to plot some coordinates in PyMOL. Not atoms, just coordinates - they’re the output of HOLE implemented in Coot, and have the following format:

145.32307 113.91329 116.36907 0.44800 0.47168 0.80000 #7278cc
147.35472 113.65778 116.36907 0.44800 0.47168 0.80000 #7278cc
149.39126 113.87088 116.36907 0.44800 0.47168 0.80000 #7278cc
141.61303 115.28156 115.56962 0.44800 0.47168 0.80000 #7278cc

Where the first three columns are the x, y and z coordinates, the next three are the size of the object, and the last is the colour (which isn’t so important - neither is the size, really). I can’t work out how to import them into PyMOL. If anybody has any ideas, I’d be really grateful!

Thanks,
Suzanne
Tsjerk Wassenaar
2015-09-22 09:34:26 UTC
Permalink
Hi Suzanne,

I'll make the guess that it's position and color. Are there any lines to be
ignored? Probably this will work anyway... Save this in a script called
holecgo.py:


def holecgo(filename,radius=0.1,name="hole"):
data = [ i.split() for i in open(filename) ]
data = [ [ float(i) for i in k[:6] ] if len(k) == 7 and
k[6].startswith("#") ]
cmd.load_cgo([u for x,y,z,r,g,b in data for u in
[6.0,r,g,b,7.0,x,y,z,radius]],name)


Then in Pymol, do:

run holecgo.py
holecgo("yourfilename")

You can add radius=0.25 or something else to make the spheres larger.

Hope it helps,

Tsjerk



On Mon, Sep 21, 2015 at 9:06 PM, Suzanne Scott <
Post by Suzanne Scott
Hi everyone,
I hope this isn’t a silly question, but I’m not sure how to do it: I want
to plot some coordinates in PyMOL. Not atoms, just coordinates - they’re
145.32307 113.91329 116.36907 0.44800 0.47168 0.80000
#7278cc
147.35472 113.65778 116.36907 0.44800 0.47168 0.80000
#7278cc
149.39126 113.87088 116.36907 0.44800 0.47168 0.80000
#7278cc
141.61303 115.28156 115.56962 0.44800 0.47168 0.80000
#7278cc
Where the first three columns are the x, y and z coordinates, the next
three are the size of the object, and the last is the colour (which isn’t
so important - neither is the size, really). I can’t work out how to
import them into PyMOL. If anybody has any ideas, I’d be really grateful!
Thanks,
Suzanne
------------------------------------------------------------------------------
_______________________________________________
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
--
Tsjerk A. Wassenaar, Ph.D.
Thomas Holder
2015-09-22 14:40:33 UTC
Permalink
Hi Suzanne & Tsjerk,

To get those points in as pseudoatoms, you could also simply place a CIF atom site header above the data and load it as a .cif file.

data_foo
loop_
_atom_site.Cartn_x
_atom_site.Cartn_y
_atom_site.Cartn_z
_atom_site.ignore_size_a
_atom_site.ignore_size_b
_atom_site.ignore_size_c
145.32307 113.91329 116.36907 0.44800 0.47168 0.80000 #7278cc
147.35472 113.65778 116.36907 0.44800 0.47168 0.80000 #7278cc
149.39126 113.87088 116.36907 0.44800 0.47168 0.80000 #7278cc
141.61303 115.28156 115.56962 0.44800 0.47168 0.80000 #7278cc

The color will be ignored because # is the comment delimiter.

The only issue is that all atoms will have the same (empty) identifiers, so in order to select individual atoms, run something like this:

PyMOL> alter all, resi=index

Cheers,
Thomas
Post by Tsjerk Wassenaar
Hi Suzanne,
data = [ i.split() for i in open(filename) ]
data = [ [ float(i) for i in k[:6] ] if len(k) == 7 and k[6].startswith("#") ]
cmd.load_cgo([u for x,y,z,r,g,b in data for u in [6.0,r,g,b,7.0,x,y,z,radius]],name)
run holecgo.py
holecgo("yourfilename")
You can add radius=0.25 or something else to make the spheres larger.
Hope it helps,
Tsjerk
Hi everyone,
145.32307 113.91329 116.36907 0.44800 0.47168 0.80000 #7278cc
147.35472 113.65778 116.36907 0.44800 0.47168 0.80000 #7278cc
149.39126 113.87088 116.36907 0.44800 0.47168 0.80000 #7278cc
141.61303 115.28156 115.56962 0.44800 0.47168 0.80000 #7278cc
Where the first three columns are the x, y and z coordinates, the next three are the size of the object, and the last is the colour (which isn’t so important - neither is the size, really). I can’t work out how to import them into PyMOL. If anybody has any ideas, I’d be really grateful!
Thanks,
Suzanne
--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.
Suzanne Scott
2015-09-22 14:54:18 UTC
Permalink
The code threw up a syntax error for me and I don’t know enough python to figure out why, but the CIF approach worked well, thanks very much!


On 22 Sep 2015, at 15:40, Thomas Holder <***@schrodinger.com<mailto:***@schrodinger.com>> wrote:

Hi Suzanne & Tsjerk,

To get those points in as pseudoatoms, you could also simply place a CIF atom site header above the data and load it as a .cif file.

data_foo
loop_
_atom_site.Cartn_x
_atom_site.Cartn_y
_atom_site.Cartn_z
_atom_site.ignore_size_a
_atom_site.ignore_size_b
_atom_site.ignore_size_c
145.32307 113.91329 116.36907 0.44800 0.47168 0.80000 #7278cc
147.35472 113.65778 116.36907 0.44800 0.47168 0.80000 #7278cc
149.39126 113.87088 116.36907 0.44800 0.47168 0.80000 #7278cc
141.61303 115.28156 115.56962 0.44800 0.47168 0.80000 #7278cc

The color will be ignored because # is the comment delimiter.

The only issue is that all atoms will have the same (empty) identifiers, so in order to select individual atoms, run something like this:

PyMOL> alter all, resi=index

Cheers,
Thomas

On 22 Sep 2015, at 05:34, Tsjerk Wassenaar <***@gmail.com<mailto:***@gmail.com>> wrote:

Hi Suzanne,

I'll make the guess that it's position and color. Are there any lines to be ignored? Probably this will work anyway... Save this in a script called holecgo.py:


def holecgo(filename,radius=0.1,name="hole"):
data = [ i.split() for i in open(filename) ]
data = [ [ float(i) for i in k[:6] ] if len(k) == 7 and k[6].startswith("#") ]
cmd.load_cgo([u for x,y,z,r,g,b in data for u in [6.0,r,g,b,7.0,x,y,z,radius]],name)


Then in Pymol, do:

run holecgo.py
holecgo("yourfilename")

You can add radius=0.25 or something else to make the spheres larger.

Hope it helps,

Tsjerk



On Mon, Sep 21, 2015 at 9:06 PM, Suzanne Scott <***@merton.ox.ac.uk<mailto:***@merton.ox.ac.uk>> wrote:
Hi everyone,

I hope this isn’t a silly question, but I’m not sure how to do it: I want to plot some coordinates in PyMOL. Not atoms, just coordinates - they’re the output of HOLE implemented in Coot, and have the following format:

145.32307 113.91329 116.36907 0.44800 0.47168 0.80000 #7278cc
147.35472 113.65778 116.36907 0.44800 0.47168 0.80000 #7278cc
149.39126 113.87088 116.36907 0.44800 0.47168 0.80000 #7278cc
141.61303 115.28156 115.56962 0.44800 0.47168 0.80000 #7278cc

Where the first three columns are the x, y and z coordinates, the next three are the size of the object, and the last is the colour (which isn’t so important - neither is the size, really). I can’t work out how to import them into PyMOL. If anybody has any ideas, I’d be really grateful!

Thanks,
Suzanne

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.
Clavel
2015-10-05 09:42:38 UTC
Permalink
Hello everyone,

I would like to create my own command within the pymol environement.

I have currently a set of points in a pdb files with b-factors that i
would like to represent as the /cartoon putty/ command is doing.(ie pdb
file)
The main problem is that I don't precisely know what /cartoon putty/ is
doing.

So I would like to know where the code of cartoon putty is hidden in
pymol and how the code could be modify in order to work on all atoms
rather than CA.

Many thanks,
--
*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
<http://www.lcp.u-psud.fr/rubrique.php3?id_rubrique=266/> Institut de
Biologie Structurale <http://www.ibs.fr/spip.php?lang=en>
Bul. 350 Campus Orsay EPN Campus
15, Av. Jean Perrin 6, rue Jules Horowitz
F-91405 ORSAY Cedex F-38000 GRENOBLE

Image and video hosting by TinyPic <http://tinypic.com?ref=28s7yvd>
João M. Damas
2015-10-05 14:08:19 UTC
Permalink
I am not really sure what you are trying to do, but understanding cartoon
putty may be too much for what you are trying to achieve. But I think that
changing all you atoms to "CA" and using:

set cartoon_trace_atoms, 1

would do the trick.

Cheers,
João
Post by Clavel
Hello everyone,
I would like to create my own command within the pymol environement.
I have currently a set of points in a pdb files with b-factors that i
would like to represent as the *cartoon putty* command is doing.(ie pdb
file)
The main problem is that I don't precisely know what *cartoon putty* is
doing.
So I would like to know where the code of cartoon putty is hidden in pymol
and how the code could be modify in order to work on all atoms rather than
CA.
Many thanks,
--
*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
<http://www.lcp.u-psud.fr/rubrique.php3?id_rubrique=266/> Institut de
Biologie Structurale <http://www.ibs.fr/spip.php?lang=en>
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]
<http://tinypic.com?ref=28s7yvd>
------------------------------------------------------------------------------
_______________________________________________
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
--
João M. Damas
PhD Student
Protein Modelling Group
ITQB-UNL, Oeiras, Portugal
Tel:+351-214469613
David Hall
2015-10-05 17:23:21 UTC
Permalink
presumably:

http://sourceforge.net/p/pymol/code/HEAD/tree/trunk/pymol/modules/pymol/preset.py#l164
Post by Clavel
Hello everyone,
I would like to create my own command within the pymol environement.
I have currently a set of points in a pdb files with b-factors that i
would like to represent as the *cartoon putty* command is doing.(ie pdb
file)
The main problem is that I don't precisely know what *cartoon putty* is
doing.
So I would like to know where the code of cartoon putty is hidden in pymol
and how the code could be modify in order to work on all atoms rather than
CA.
Many thanks,
--
*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
<http://www.lcp.u-psud.fr/rubrique.php3?id_rubrique=266/> Institut de
Biologie Structurale <http://www.ibs.fr/spip.php?lang=en>
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]
<http://tinypic.com?ref=28s7yvd>
------------------------------------------------------------------------------
_______________________________________________
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Continue reading on narkive:
Loading...