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

2017-05-22 Thread Thomas Holder
Hi Chi,

The file needs a .py extension to be recognized as a Python script. Microsoft 
Windows can be tricky when it comes to changing a file extension. I recommend 
to follow these steps when downloading a Python file from the PyMOLWiki:

1) Visit https://pymolwiki.org/index.php/Get_raw_distances
2) Box on the right side, right click on "Download get_raw_distances.py"
3) "Save Link As..." or "Save target as..." (depends on browser)
File name: get_raw_distances.py
Save as type: PY File

Hope that helps.

Cheers,
  Thomas

> On May 19, 2017, at 9:41 PM, Chi Celestine  
> wrote:
> 
> 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  
>> 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 
>>>  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] 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 
> 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 
> 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] 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] 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 
> 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] 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

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

2017-05-04 Thread Ahmad Abdelzaher
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.

--
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