Re: [PyMOL] Is there a way to "count" hydrogen bond interactions?

2017-05-19 Thread Chi Celestine
Dear Thomas,
Many thanks! I copied and saved the script as a dot txt but can not run it from 
file> run  on pymol. Do I need yo save the file in a special folder? I am 
actually really new with pymol and not vey good in scripting

Thanks for your understanding

Sincerely
Chi
-
Celestine Chi, PhD
ETH Zürich
Laboratory for Physical Chemistry
Vladimir-Prelog-Weg 2 HCI F 222
CH-8093 Zürich
Email: chi.celest...@phys.chem.ethz.ch
tele: 004144 63 37510

On May 19, 2017, at 5:33 PM, Thomas Holder 
mailto:thomas.hol...@schrodinger.com>> wrote:

Hi Celestine,

Did you run the "get_raw_distances.py" script first? You can do that by:

run 
https://raw.githubusercontent.com/Pymol-Scripts/Pymol-script-repo/master/get_raw_distances.py

Or better: Download it to your computer and run it from there ("run" command or 
"File > Run Script..." from the menu).

After running the script, you can use the "get_raw_distances" command.

Cheers,
 Thomas

On May 19, 2017, at 2:26 PM, Chi Celestine 
mailto:chi.celest...@phys.chem.ethz.ch>> wrote:

Hi Thomas,
I am also interesting in getting bond distances between two pairs of molecule. 
I tried running the commands to suggested but I get an error message e.g
When I tried the following (see below) the fist command was well executed but 
the second gave an error message “ SyntaxError: invalid syntax”

I got a similar error message when I tried to execute  this command D = 
get_raw_distances("distname”)  as well


Sincerely,
Celestine

Example
fetch 2xwu, async=0



# interface polar contacts
distance iface_hbonds, chain A, chain B, mode=2



# dump (model,index) information
get_raw_distances iface_hbonds


-
Celestine Chi, PhD
ETH Zürich
Laboratory for Physical Chemistry
Vladimir-Prelog-Weg 2 HCI F 222
CH-8093 Zürich
Email: chi.celest...@phys.chem.ethz.ch
tele: 004144 63 37510

On May 19, 2017, at 1:16 PM, Thomas Holder 
mailto:thomas.hol...@schrodinger.com>> wrote:

Hi Ahmad,

Unfortunately there is no proper API for this. But I can think of two 
approaches. Note that the results can differ because the two method do slightly 
different h-bond detection!

1) Use "cmd.find_pairs" with mode=1 on "donors" and "acceptors" selection. 
Example:

sele1 = "chain A & (donors | acceptors)"
sele2 = "chain B & (donors | acceptors)"
radius = 3.5
D = cmd.find_pairs(sele1, sele2, mode=1, cutoff=radius)
print("number of h-bonds:", len(D))

1) Use "cmd.distance" and the "get_raw_distances" script. Example:

run 
https://raw.githubusercontent.com/Pymol-Scripts/Pymol-script-repo/master/get_raw_distances.py

sele1 = "chain A"
sele2 = "chain B"
radius = 3.5
cmd.distance("distname", sele1, sele2, mode=2, cutoff=radius)
D = get_raw_distances("distname")
print("number of h-bonds:", len(D))

See also:
https://pymolwiki.org/index.php/Get_raw_distances
https://pymolwiki.org/index.php/Distance
https://pymolwiki.org/index.php/Find_pairs

Hope that helps.

Cheers,
Thomas

On May 5, 2017, at 5:08 AM, Ahmad Abdelzaher  wrote:

I know I can can find the hydrogen bond interactions between a
selection and surrounding residues within a certain radius. I would
like to find a way to retrieve the actual count of those interactions
per residue. How can I do it in the API?

Regards.

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
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] reproduce special vrml-output

2017-05-19 Thread Sampson, Jared
Hi Anke -

Try `as surface`, which is the equivalent of `hide everything; show surface`. 

Hope that helps.

Cheers,
Jared

Sent from my iPhone

> On May 19, 2017, at 6:43 AM, Anke Schultz  
> wrote:
> 
> Hi Thomas,
> 
> thanks for the explanation on adjusting view, it works fine. This leaves 
> me with one question: How do I get a .wrl-file containing only faces? 
> Using "show surface" and setting surface_type to 2 (triangles) gives me 
> sticks and spheres in the .wrl-file (sticks as edges, spheres at the 
> ends of every edge).
> 
> Cheers,
> 
> Anke
> 
> 
>> Am 19.05.2017 um 10:38 schrieb Thomas Holder:
>> Hi Anke,
>> 
>> The obvious difference I can see in your two samples is that the first one 
>> contains sticks and spheres representations, and the second one only has 
>> faces (could be surface or cartoon).
>> 
>> The other difference is the viewport z position (zoom distance), which is 
>> 0.0 in the second sample. This can be set as follows before exporting the 
>> file (note that the molecule might not be visible anymore, it could be 
>> behind the camera):
>> 
>> view = list(cmd.get_view())
>> view[11] = 0.0
>> cmd.set_view(view)
>> 
>> Hope that helps.
>> 
>> Cheers,
>>   Thomas
>> 
>>> On May 17, 2017, at 4:27 PM, Anke Schultz  
>>> wrote:
>>> 
>>> Hi all,
>>> 
>>> I've been experimenting with exporting surface meshes as .wrl-files. I 
>>> played with the geometry_export_mode setting and the set_view() options, 
>>> since I wanted to get the surface's coordinates corresponding to the atom's 
>>> coordinates of the sd-file I imported to pymol initially. I realized that 
>>> by exporting .wrl-format I got the camera-view instead of the "real" 
>>> coordinates as long as I left everything else on default. This resulted in 
>>> a shift between atom- and surface-coordinates.
>>> 
>>> While playing around to align camera and reality, I somehow managed to 
>>> change the way my .wrl-file looked in the end and it seems to be exactly 
>>> what I was looking for. I have tried for two days now, but unfortunately I 
>>> can't reproduce my steps leading to this special .wrl-file.
>>> 
>>> This is (part of) a .wrl-file without changing default settings:
>>> ###
>>> #VRML V2.0 utf8
>>> 
>>> Viewpoint {
>>>  position 0 0 20.39730644
>>>  orientation 1 0 0 0
>>>  description "Z view"
>>>  fieldOfView 0.465421
>>> }
>>> DirectionalLight {
>>>  direction -0.348155 -0.348155   -0.870
>>> }
>>> NavigationInfo {
>>>  headlight TRUE
>>>  type "EXAMINE"
>>> }
>>> Transform {
>>>  translation -1.820169 2.166291 -3.211221
>>>  rotation -0.199343 0.00 0.979930 2.401556
>>>  children [
>>>   Shape {
>>>geometry Cylinder {
>>> radius 0.024352
>>> height 0.139351
>>> bottom FALSE
>>> topFALSE
>>>}
>>>appearance Appearance {
>>>material Material { diffuseColor 0.9000 0.9000 0.9000
>>>specularColor 0.8 0.8 0.8
>>>shininess 0.8 }
>>>}
>>>   }
>>>   Transform {
>>>translation 0.0 0.069676 0.0
>>>children Shape {
>>> geometry Sphere { radius 0.024352 }
>>> appearance Appearance {
>>>material Material { diffuseColor 0.9000 0.9000 0.9000
>>>specularColor 0.8 0.8 0.8
>>>shininess 0.8 }
>>> }
>>>}
>>>   }
>>>   Transform {
>>>translation 0.0 -0.069676 0.0
>>>children Shape {
>>> geometry Sphere { radius 0.024352 }
>>> appearance Appearance {
>>>material Material { diffuseColor 0.9000 0.9000 0.9000
>>>specularColor 0.8 0.8 0.8
>>>shininess 0.8 }
>>> }
>>>}
>>>   }
>>>  ]
>>> }
>>> Transform {
>>>  translation -1.906664 2.148911 -3.187284
>>>  rotation 0.635566 0.00 0.772046 0.994256
>>> [...]
>>> ###
>>> 
>>> And this is (part of) the special .wrl-file I mysteriously created:
>>> 
>>> ###
>>> #VRML V2.0 utf8
>>> 
>>> Viewpoint {
>>>  position 0 0 -0.
>>>  orientation 1 0 0 0
>>>  description "Z view"
>>>  fieldOfView 0.465421
>>> }
>>> DirectionalLight {
>>>  direction -0.348155 -0.348155   -0.870
>>> }
>>> NavigationInfo {
>>>  headlight TRUE
>>>  type "EXAMINE"
>>> }
>>> Shape {
>>>  appearance Appearance {
>>>   material Material { diffuseColor 1.0 1.0 1.0 }
>>>  }
>>>  geometry IndexedFaceSet {
>>>   coord Coordinate {
>>>point [
>>> 1.121935 1.360173 -0.410155,
>>> 1.840800 1.307029 -0.904629,
>>> 1.445710 1.051540 -1.083943,
>>> 1.301289 0.550209 -1.380068,
>>> 1.445710 1.051540 -1.083943,
>>> 1.840800 1.307029 -0.904629,
>>> 2.165471 0.781700 -1.754629,
>>> 1.301289 0.550209 -1.380068,
>>> 1.840800 1.307029 -0.904629,
>>> 2.693056 1.515260 -1.343787,
>>> 2.165471 0.781700 -1.754629,
>>> 1.840800 1.307029 -0.904629,
>>> [...]
>>> ###

Re: [PyMOL] Is there a way to "count" hydrogen bond interactions?

2017-05-19 Thread Thomas Holder
Hi Celestine,

Did you run the "get_raw_distances.py" script first? You can do that by:

run 
https://raw.githubusercontent.com/Pymol-Scripts/Pymol-script-repo/master/get_raw_distances.py

Or better: Download it to your computer and run it from there ("run" command or 
"File > Run Script..." from the menu).

After running the script, you can use the "get_raw_distances" command.

Cheers,
  Thomas

> On May 19, 2017, at 2:26 PM, Chi Celestine  
> wrote:
> 
> Hi Thomas,
> I am also interesting in getting bond distances between two pairs of 
> molecule. I tried running the commands to suggested but I get an error 
> message e.g 
> When I tried the following (see below) the fist command was well executed but 
> the second gave an error message “ SyntaxError: invalid syntax”
> 
> I got a similar error message when I tried to execute  this command D = 
> get_raw_distances("distname”)  as well 
> 
> 
> Sincerely,
> Celestine 
> 
> Example
> fetch 2xwu, async=0
> 
> 
> 
> # interface polar contacts
> distance iface_hbonds, chain A, chain B, mode=2
> 
> 
> 
> # dump (model,index) information
> get_raw_distances iface_hbonds
> 
>  
> -
> Celestine Chi, PhD
> ETH Zürich 
> Laboratory for Physical Chemistry
> Vladimir-Prelog-Weg 2 HCI F 222
> CH-8093 Zürich
> Email: chi.celest...@phys.chem.ethz.ch
> tele: 004144 63 37510
> 
>> On May 19, 2017, at 1:16 PM, Thomas Holder  
>> wrote:
>> 
>> Hi Ahmad,
>> 
>> Unfortunately there is no proper API for this. But I can think of two 
>> approaches. Note that the results can differ because the two method do 
>> slightly different h-bond detection!
>> 
>> 1) Use "cmd.find_pairs" with mode=1 on "donors" and "acceptors" selection. 
>> Example:
>> 
>> sele1 = "chain A & (donors | acceptors)"
>> sele2 = "chain B & (donors | acceptors)"
>> radius = 3.5
>> D = cmd.find_pairs(sele1, sele2, mode=1, cutoff=radius)
>> print("number of h-bonds:", len(D))
>> 
>> 1) Use "cmd.distance" and the "get_raw_distances" script. Example:
>> 
>> run 
>> https://raw.githubusercontent.com/Pymol-Scripts/Pymol-script-repo/master/get_raw_distances.py
>> 
>> sele1 = "chain A"
>> sele2 = "chain B"
>> radius = 3.5
>> cmd.distance("distname", sele1, sele2, mode=2, cutoff=radius)
>> D = get_raw_distances("distname")
>> print("number of h-bonds:", len(D))
>> 
>> See also:
>> https://pymolwiki.org/index.php/Get_raw_distances
>> https://pymolwiki.org/index.php/Distance
>> https://pymolwiki.org/index.php/Find_pairs
>> 
>> Hope that helps.
>> 
>> Cheers,
>>  Thomas
>> 
>>> On May 5, 2017, at 5:08 AM, Ahmad Abdelzaher  wrote:
>>> 
>>> I know I can can find the hydrogen bond interactions between a
>>> selection and surrounding residues within a certain radius. I would
>>> like to find a way to retrieve the actual count of those interactions
>>> per residue. How can I do it in the API?
>>> 
>>> Regards.

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
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] reproduce special vrml-output

2017-05-19 Thread Anke Schultz
Hi Thomas,

thanks for the explanation on adjusting view, it works fine. This leaves 
me with one question: How do I get a .wrl-file containing only faces? 
Using "show surface" and setting surface_type to 2 (triangles) gives me 
sticks and spheres in the .wrl-file (sticks as edges, spheres at the 
ends of every edge).

Cheers,

Anke


Am 19.05.2017 um 10:38 schrieb Thomas Holder:
> Hi Anke,
>
> The obvious difference I can see in your two samples is that the first one 
> contains sticks and spheres representations, and the second one only has 
> faces (could be surface or cartoon).
>
> The other difference is the viewport z position (zoom distance), which is 0.0 
> in the second sample. This can be set as follows before exporting the file 
> (note that the molecule might not be visible anymore, it could be behind the 
> camera):
>
> view = list(cmd.get_view())
> view[11] = 0.0
> cmd.set_view(view)
>
> Hope that helps.
>
> Cheers,
>Thomas
>
>> On May 17, 2017, at 4:27 PM, Anke Schultz  
>> wrote:
>>
>> Hi all,
>>
>> I've been experimenting with exporting surface meshes as .wrl-files. I 
>> played with the geometry_export_mode setting and the set_view() options, 
>> since I wanted to get the surface's coordinates corresponding to the atom's 
>> coordinates of the sd-file I imported to pymol initially. I realized that by 
>> exporting .wrl-format I got the camera-view instead of the "real" 
>> coordinates as long as I left everything else on default. This resulted in a 
>> shift between atom- and surface-coordinates.
>>
>> While playing around to align camera and reality, I somehow managed to 
>> change the way my .wrl-file looked in the end and it seems to be exactly 
>> what I was looking for. I have tried for two days now, but unfortunately I 
>> can't reproduce my steps leading to this special .wrl-file.
>>
>> This is (part of) a .wrl-file without changing default settings:
>> ###
>> #VRML V2.0 utf8
>>
>> Viewpoint {
>>   position 0 0 20.39730644
>>   orientation 1 0 0 0
>>   description "Z view"
>>   fieldOfView 0.465421
>> }
>> DirectionalLight {
>>   direction -0.348155 -0.348155   -0.870
>> }
>> NavigationInfo {
>>   headlight TRUE
>>   type "EXAMINE"
>> }
>> Transform {
>>   translation -1.820169 2.166291 -3.211221
>>   rotation -0.199343 0.00 0.979930 2.401556
>>   children [
>>Shape {
>> geometry Cylinder {
>>  radius 0.024352
>>  height 0.139351
>>  bottom FALSE
>>  topFALSE
>> }
>> appearance Appearance {
>> material Material { diffuseColor 0.9000 0.9000 0.9000
>> specularColor 0.8 0.8 0.8
>> shininess 0.8 }
>> }
>>}
>>Transform {
>> translation 0.0 0.069676 0.0
>> children Shape {
>>  geometry Sphere { radius 0.024352 }
>>  appearance Appearance {
>> material Material { diffuseColor 0.9000 0.9000 0.9000
>> specularColor 0.8 0.8 0.8
>> shininess 0.8 }
>>  }
>> }
>>}
>>Transform {
>> translation 0.0 -0.069676 0.0
>> children Shape {
>>  geometry Sphere { radius 0.024352 }
>>  appearance Appearance {
>> material Material { diffuseColor 0.9000 0.9000 0.9000
>> specularColor 0.8 0.8 0.8
>> shininess 0.8 }
>>  }
>> }
>>}
>>   ]
>> }
>> Transform {
>>   translation -1.906664 2.148911 -3.187284
>>   rotation 0.635566 0.00 0.772046 0.994256
>> [...]
>> ###
>>
>> And this is (part of) the special .wrl-file I mysteriously created:
>>
>> ###
>> #VRML V2.0 utf8
>>
>> Viewpoint {
>>   position 0 0 -0.
>>   orientation 1 0 0 0
>>   description "Z view"
>>   fieldOfView 0.465421
>> }
>> DirectionalLight {
>>   direction -0.348155 -0.348155   -0.870
>> }
>> NavigationInfo {
>>   headlight TRUE
>>   type "EXAMINE"
>> }
>> Shape {
>>   appearance Appearance {
>>material Material { diffuseColor 1.0 1.0 1.0 }
>>   }
>>   geometry IndexedFaceSet {
>>coord Coordinate {
>> point [
>> 1.121935 1.360173 -0.410155,
>> 1.840800 1.307029 -0.904629,
>> 1.445710 1.051540 -1.083943,
>> 1.301289 0.550209 -1.380068,
>> 1.445710 1.051540 -1.083943,
>> 1.840800 1.307029 -0.904629,
>> 2.165471 0.781700 -1.754629,
>> 1.301289 0.550209 -1.380068,
>> 1.840800 1.307029 -0.904629,
>> 2.693056 1.515260 -1.343787,
>> 2.165471 0.781700 -1.754629,
>> 1.840800 1.307029 -0.904629,
>> [...]
>> ###
>>
>> If anyone knows the way to this .wrl-format, I would really appreciate your 
>> help.
>> I'm using Pymol Version 1.8.6.0 on Ubuntu.
>>
>> Thanks in advance,
>> Anke
> --
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
>
>


--

Re: [PyMOL] Is there a way to "count" hydrogen bond interactions?

2017-05-19 Thread Chi Celestine
Hi Thomas,
I am also interesting in getting bond distances between two pairs of molecule. 
I tried running the commands to suggested but I get an error message e.g
When I tried the following (see below) the fist command was well executed but 
the second gave an error message “ SyntaxError: invalid syntax”

I got a similar error message when I tried to execute  this command D = 
get_raw_distances("distname”)  as well


Sincerely,
Celestine

Example

fetch 2xwu, async=0

# interface polar contacts
distance iface_hbonds, chain A, chain B, mode=2

# dump (model,index) information
get_raw_distances iface_hbonds


-
Celestine Chi, PhD
ETH Zürich
Laboratory for Physical Chemistry
Vladimir-Prelog-Weg 2 HCI F 222
CH-8093 Zürich
Email: chi.celest...@phys.chem.ethz.ch
tele: 004144 63 37510

On May 19, 2017, at 1:16 PM, Thomas Holder 
mailto:thomas.hol...@schrodinger.com>> wrote:

Hi Ahmad,

Unfortunately there is no proper API for this. But I can think of two 
approaches. Note that the results can differ because the two method do slightly 
different h-bond detection!

1) Use "cmd.find_pairs" with mode=1 on "donors" and "acceptors" selection. 
Example:

sele1 = "chain A & (donors | acceptors)"
sele2 = "chain B & (donors | acceptors)"
radius = 3.5
D = cmd.find_pairs(sele1, sele2, mode=1, cutoff=radius)
print("number of h-bonds:", len(D))

1) Use "cmd.distance" and the "get_raw_distances" script. Example:

run 
https://raw.githubusercontent.com/Pymol-Scripts/Pymol-script-repo/master/get_raw_distances.py

sele1 = "chain A"
sele2 = "chain B"
radius = 3.5
cmd.distance("distname", sele1, sele2, mode=2, cutoff=radius)
D = get_raw_distances("distname")
print("number of h-bonds:", len(D))

See also:
https://pymolwiki.org/index.php/Get_raw_distances
https://pymolwiki.org/index.php/Distance
https://pymolwiki.org/index.php/Find_pairs

Hope that helps.

Cheers,
 Thomas

On May 5, 2017, at 5:08 AM, Ahmad Abdelzaher  wrote:

I know I can can find the hydrogen bond interactions between a
selection and surrounding residues within a certain radius. I would
like to find a way to retrieve the actual count of those interactions
per residue. How can I do it in the API?

Regards.

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
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

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
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] reproduce special vrml-output

2017-05-19 Thread Thomas Holder
Hi Anke,

surface_type 0 will produce faces (solid triangles).

There are no triangle faces in surface_type 2, only edges.

Thomas

> On May 19, 2017, at 12:43 PM, Anke Schultz  
> wrote:
> 
> Hi Thomas,
> 
> thanks for the explanation on adjusting view, it works fine. This leaves me 
> with one question: How do I get a .wrl-file containing only faces? Using 
> "show surface" and setting surface_type to 2 (triangles) gives me sticks and 
> spheres in the .wrl-file (sticks as edges, spheres at the ends of every edge).
> 
> Cheers,
> 
> Anke
> 
> 
> Am 19.05.2017 um 10:38 schrieb Thomas Holder:
>> Hi Anke,
>> 
>> The obvious difference I can see in your two samples is that the first one 
>> contains sticks and spheres representations, and the second one only has 
>> faces (could be surface or cartoon).
>> 
>> The other difference is the viewport z position (zoom distance), which is 
>> 0.0 in the second sample. This can be set as follows before exporting the 
>> file (note that the molecule might not be visible anymore, it could be 
>> behind the camera):
>> 
>> view = list(cmd.get_view())
>> view[11] = 0.0
>> cmd.set_view(view)
>> 
>> Hope that helps.
>> 
>> Cheers,
>>   Thomas
>> 
>>> On May 17, 2017, at 4:27 PM, Anke Schultz  
>>> wrote:
>>> 
>>> Hi all,
>>> 
>>> I've been experimenting with exporting surface meshes as .wrl-files. I 
>>> played with the geometry_export_mode setting and the set_view() options, 
>>> since I wanted to get the surface's coordinates corresponding to the atom's 
>>> coordinates of the sd-file I imported to pymol initially. I realized that 
>>> by exporting .wrl-format I got the camera-view instead of the "real" 
>>> coordinates as long as I left everything else on default. This resulted in 
>>> a shift between atom- and surface-coordinates.
>>> 
>>> While playing around to align camera and reality, I somehow managed to 
>>> change the way my .wrl-file looked in the end and it seems to be exactly 
>>> what I was looking for. I have tried for two days now, but unfortunately I 
>>> can't reproduce my steps leading to this special .wrl-file.
>>> 
>>> This is (part of) a .wrl-file without changing default settings:
>>> ###
>>> #VRML V2.0 utf8
>>> 
>>> Viewpoint {
>>>  position 0 0 20.39730644
>>>  orientation 1 0 0 0
>>>  description "Z view"
>>>  fieldOfView 0.465421
>>> }
>>> DirectionalLight {
>>>  direction -0.348155 -0.348155   -0.870
>>> }
>>> NavigationInfo {
>>>  headlight TRUE
>>>  type "EXAMINE"
>>> }
>>> Transform {
>>>  translation -1.820169 2.166291 -3.211221
>>>  rotation -0.199343 0.00 0.979930 2.401556
>>>  children [
>>>   Shape {
>>>geometry Cylinder {
>>> radius 0.024352
>>> height 0.139351
>>> bottom FALSE
>>> topFALSE
>>>}
>>>appearance Appearance {
>>>material Material { diffuseColor 0.9000 0.9000 0.9000
>>>specularColor 0.8 0.8 0.8
>>>shininess 0.8 }
>>>}
>>>   }
>>>   Transform {
>>>translation 0.0 0.069676 0.0
>>>children Shape {
>>> geometry Sphere { radius 0.024352 }
>>> appearance Appearance {
>>>material Material { diffuseColor 0.9000 0.9000 0.9000
>>>specularColor 0.8 0.8 0.8
>>>shininess 0.8 }
>>> }
>>>}
>>>   }
>>>   Transform {
>>>translation 0.0 -0.069676 0.0
>>>children Shape {
>>> geometry Sphere { radius 0.024352 }
>>> appearance Appearance {
>>>material Material { diffuseColor 0.9000 0.9000 0.9000
>>>specularColor 0.8 0.8 0.8
>>>shininess 0.8 }
>>> }
>>>}
>>>   }
>>>  ]
>>> }
>>> Transform {
>>>  translation -1.906664 2.148911 -3.187284
>>>  rotation 0.635566 0.00 0.772046 0.994256
>>> [...]
>>> ###
>>> 
>>> And this is (part of) the special .wrl-file I mysteriously created:
>>> 
>>> ###
>>> #VRML V2.0 utf8
>>> 
>>> Viewpoint {
>>>  position 0 0 -0.
>>>  orientation 1 0 0 0
>>>  description "Z view"
>>>  fieldOfView 0.465421
>>> }
>>> DirectionalLight {
>>>  direction -0.348155 -0.348155   -0.870
>>> }
>>> NavigationInfo {
>>>  headlight TRUE
>>>  type "EXAMINE"
>>> }
>>> Shape {
>>>  appearance Appearance {
>>>   material Material { diffuseColor 1.0 1.0 1.0 }
>>>  }
>>>  geometry IndexedFaceSet {
>>>   coord Coordinate {
>>>point [
>>> 1.121935 1.360173 -0.410155,
>>> 1.840800 1.307029 -0.904629,
>>> 1.445710 1.051540 -1.083943,
>>> 1.301289 0.550209 -1.380068,
>>> 1.445710 1.051540 -1.083943,
>>> 1.840800 1.307029 -0.904629,
>>> 2.165471 0.781700 -1.754629,
>>> 1.301289 0.550209 -1.380068,
>>> 1.840800 1.307029 -0.904629,
>>> 2.693056 1.515260 -1.343787,
>>> 2.165471 0.781700 -1.754629,
>>> 1.840800 1.307029 -0.904629,
>>> [...]
>>> ###
>>> 
>>> If anyo

Re: [PyMOL] Is there a way to "count" hydrogen bond interactions?

2017-05-19 Thread Thomas Holder
Hi Ahmad,

Unfortunately there is no proper API for this. But I can think of two 
approaches. Note that the results can differ because the two method do slightly 
different h-bond detection!

1) Use "cmd.find_pairs" with mode=1 on "donors" and "acceptors" selection. 
Example:

sele1 = "chain A & (donors | acceptors)"
sele2 = "chain B & (donors | acceptors)"
radius = 3.5
D = cmd.find_pairs(sele1, sele2, mode=1, cutoff=radius)
print("number of h-bonds:", len(D))

1) Use "cmd.distance" and the "get_raw_distances" script. Example:

run 
https://raw.githubusercontent.com/Pymol-Scripts/Pymol-script-repo/master/get_raw_distances.py

sele1 = "chain A"
sele2 = "chain B"
radius = 3.5
cmd.distance("distname", sele1, sele2, mode=2, cutoff=radius)
D = get_raw_distances("distname")
print("number of h-bonds:", len(D))

See also:
https://pymolwiki.org/index.php/Get_raw_distances
https://pymolwiki.org/index.php/Distance
https://pymolwiki.org/index.php/Find_pairs

Hope that helps.

Cheers,
  Thomas

> On May 5, 2017, at 5:08 AM, Ahmad Abdelzaher  wrote:
> 
> I know I can can find the hydrogen bond interactions between a
> selection and surrounding residues within a certain radius. I would
> like to find a way to retrieve the actual count of those interactions
> per residue. How can I do it in the API?
> 
> Regards.

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
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] B-factor

2017-05-19 Thread Thomas Holder
Hi Kingsley,

The b-factor is a result of the X-ray crystallography experiment. If you have 
X-ray data, I suggest to consult the CCP4BB mailing list 
(http://www.ccp4.ac.uk/ccp4bb.php). If you don’t have such data, then you can’t 
calculate a b-factor.

There are computational methods which analyze a structure for potential 
flexibility, for example Normal Mode Analysis (NMA). These methods can 
approximate real b-factors.

If you have an ensemble of structures (e.g. from an MD simulation) you could 
also calculate the root mean square fluctuation per atom (RMSF), which is 
related to the b-factor in the sense that it describes a distribution around a 
center position. See for example “rmsf2b” in the PSICO library: 
https://github.com/speleo3/pymol-psico/blob/master/psico/editing.py#L69

Cheers,
  Thomas

> On May 8, 2017, at 2:42 PM, Kingsley Theras Primus Dass . 
> <105726...@gms.tcu.edu.tw> wrote:
> 
> Hi everyone ! 
> I want to calculate the b-factor for my protein . Can. Anyone tell me how to 
> do b-factor or some tutorial about that. 
> 
> Thanks in advance :)

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
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] Difference between action -> align -> to molecule and using align via command line

2017-05-19 Thread Thomas Holder
Hi Dolev,

The difference is that the menu action only aligns on C-alpha atoms. Since 
PyMOL 1.8 the menu label says “align > to molecule (*/CA)” to make this more 
obvious.

The exact command which is executed by the menu action is:

align 4A11 & name CA & polymer, 3W15 & name CA & polymer, 
object=aln_4A11_to_3W15

The “polymer” selection makes sure that calcium atoms are not included, which 
also have name CA.

See also:
https://pymolwiki.org/index.php/Align

Cheers,
  Thomas

> On May 18, 2017, at 12:41 PM, do r  wrote:
> 
> Hello
> 
> I have noted that using action -> align -> to molecule via the GUI gives 
> (sometimes radically) different result then running align on the same 
> structures via command line.
> 
> For examples, for PDB structures 4A11 and 3W15, the command
> align 4A11,3W15, aligns 1632 atoms and gives an RMSD of 7.538, whereas
> action -> align -> to molecule aligns 375 and gives an RMSD of 24.416.
> I have also seen such differences on other pairs of structures.
> 
> Any explanation of this phenomenon will be most appreciated.
> 
> Thanks in advance
> Dolev Rahat 

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
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] reproduce special vrml-output

2017-05-19 Thread Thomas Holder
Hi Anke,

The obvious difference I can see in your two samples is that the first one 
contains sticks and spheres representations, and the second one only has faces 
(could be surface or cartoon).

The other difference is the viewport z position (zoom distance), which is 0.0 
in the second sample. This can be set as follows before exporting the file 
(note that the molecule might not be visible anymore, it could be behind the 
camera):

view = list(cmd.get_view())
view[11] = 0.0
cmd.set_view(view)

Hope that helps.

Cheers,
  Thomas

> On May 17, 2017, at 4:27 PM, Anke Schultz  
> wrote:
> 
> Hi all,
> 
> I've been experimenting with exporting surface meshes as .wrl-files. I played 
> with the geometry_export_mode setting and the set_view() options, since I 
> wanted to get the surface's coordinates corresponding to the atom's 
> coordinates of the sd-file I imported to pymol initially. I realized that by 
> exporting .wrl-format I got the camera-view instead of the "real" coordinates 
> as long as I left everything else on default. This resulted in a shift 
> between atom- and surface-coordinates.
> 
> While playing around to align camera and reality, I somehow managed to change 
> the way my .wrl-file looked in the end and it seems to be exactly what I was 
> looking for. I have tried for two days now, but unfortunately I can't 
> reproduce my steps leading to this special .wrl-file.
> 
> This is (part of) a .wrl-file without changing default settings:
> ###
> #VRML V2.0 utf8
> 
> Viewpoint {
>  position 0 0 20.39730644
>  orientation 1 0 0 0
>  description "Z view"
>  fieldOfView 0.465421
> }
> DirectionalLight {
>  direction -0.348155 -0.348155   -0.870
> }
> NavigationInfo {
>  headlight TRUE
>  type "EXAMINE"
> }
> Transform {
>  translation -1.820169 2.166291 -3.211221
>  rotation -0.199343 0.00 0.979930 2.401556
>  children [
>   Shape {
>geometry Cylinder {
> radius 0.024352
> height 0.139351
> bottom FALSE
> topFALSE
>}
>appearance Appearance {
>material Material { diffuseColor 0.9000 0.9000 0.9000 
>specularColor 0.8 0.8 0.8 
>shininess 0.8 }
>}
>   }
>   Transform {
>translation 0.0 0.069676 0.0
>children Shape {
> geometry Sphere { radius 0.024352 }
> appearance Appearance {
>material Material { diffuseColor 0.9000 0.9000 0.9000 
>specularColor 0.8 0.8 0.8 
>shininess 0.8 }
> }
>}
>   }
>   Transform {
>translation 0.0 -0.069676 0.0
>children Shape {
> geometry Sphere { radius 0.024352 }
> appearance Appearance {
>material Material { diffuseColor 0.9000 0.9000 0.9000 
>specularColor 0.8 0.8 0.8 
>shininess 0.8 }
> }
>}
>   }
>  ]
> }
> Transform {
>  translation -1.906664 2.148911 -3.187284
>  rotation 0.635566 0.00 0.772046 0.994256
> [...]
> ###
> 
> And this is (part of) the special .wrl-file I mysteriously created:
> 
> ###
> #VRML V2.0 utf8
> 
> Viewpoint {
>  position 0 0 -0.
>  orientation 1 0 0 0
>  description "Z view"
>  fieldOfView 0.465421
> }
> DirectionalLight {
>  direction -0.348155 -0.348155   -0.870
> }
> NavigationInfo {
>  headlight TRUE
>  type "EXAMINE"
> }
> Shape {
>  appearance Appearance {
>   material Material { diffuseColor 1.0 1.0 1.0 }
>  }
>  geometry IndexedFaceSet {
>   coord Coordinate {
>point [
> 1.121935 1.360173 -0.410155,
> 1.840800 1.307029 -0.904629,
> 1.445710 1.051540 -1.083943,
> 1.301289 0.550209 -1.380068,
> 1.445710 1.051540 -1.083943,
> 1.840800 1.307029 -0.904629,
> 2.165471 0.781700 -1.754629,
> 1.301289 0.550209 -1.380068,
> 1.840800 1.307029 -0.904629,
> 2.693056 1.515260 -1.343787,
> 2.165471 0.781700 -1.754629,
> 1.840800 1.307029 -0.904629,
> [...]
> ###
> 
> If anyone knows the way to this .wrl-format, I would really appreciate your 
> help.
> I'm using Pymol Version 1.8.6.0 on Ubuntu.
> 
> Thanks in advance,
> Anke

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
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] Difference between action -> align -> to molecule and using align via command line

2017-05-19 Thread do r
Hello

I have noted that using action -> align -> to molecule via the GUI gives
(sometimes radically) different result then running align on the same
structures via command line.

For examples, for PDB structures 4A11 and 3W15, the command
align 4A11,3W15, aligns 1632 atoms and gives an RMSD of 7.538, whereas
action -> align -> to molecule aligns 375 and gives an RMSD of 24.416.
I have also seen such differences on other pairs of structures.

Any explanation of this phenomenon will be most appreciated.

Thanks in advance
Dolev Rahat
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
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] Residue selection along coordinates on z-axis

2017-05-19 Thread Thomas Holder
Hi Marko,

Have you tried this?

select zplane, z > 6.377 and z < 7.139

This works since PyMOL 1.6 (I think).

Cheers,
  Thomas

> On May 19, 2017, at 9:49 AM, Marko Sever  wrote:
> 
> Hello everyone! Could someone help me figure out, how I could do a residue 
> selection along specific z-axis coordinates, for example from 6,377-7,139 on 
> the z-axis, etc..Like that it selects all residues in that plane.
> 
> Marko Sever, PhD student

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
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] Residue selection along coordinates on z-axis

2017-05-19 Thread Marko Sever
Hello everyone! Could someone help me figure out, how I could do a residue 
selection along specific z-axis coordinates, for example from 6,377-7,139 on 
the z-axis, etc..Like that it selects all residues in that plane.

Marko Sever, PhD student



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
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