Re: [PyMOL] Using API to select resi, and return some information within a certain distance

2017-04-28 Thread Jared Sampson
Hi Ahmad - 

Here are a few suggestions:

> I'm still a bit new to the API so I'm not sure which commands to use.
> At least I know I will start with cmd.select(string name, string
> selection).
> 
> How can I tell Pymol to:
> 
> 1) look within a certain radius distance, and return resi's within
> that distacne.

cmd.select('mysele', 'byres all within 5 of sele')

See https://pymolwiki.org/index.php/Selection_Algebra 
 for more handy operators 
(`beyond`, `around`, `expand`, etc.)


> 2) find all polar interactions within a distance,

You can use cmd.distance (https://pymolwiki.org/index.php/Distance 
), e.g. (as done in the GUI by [A] > 
find > polar contacts...)

cmd.dist("mysele_polar_conts","mysele","all within 5 of 
mysele",quiet=1,mode=2,label=0,reset=1)

or for a list of atoms, check out https://pymolwiki.org/index.php/Polarpairs 



> use sticks,

cmd.show('sticks', 'mysele')

or to hide all other representations,

cmd.show_as('sticks', 'mysele')


> color by atom

util.cnc('mysele')

I use this one all the time ("cnc" == color non-carbon).  There is also 
`util.cbc` == color by chain.


> hide everything else

cmd.hide('everything', 'all and not mysele')


> and output an image of the selections and interactions around it.

cmd.zoom('mysele', 5)
cmd.png('mysele.png', ray=1)


> Please feel free to throw in any useful commands that can you might think is 
> helpful.

One useful trick to learn new commands is to open a log file (via `log_open 
log.pml` or the File menu) and then perform the desired action in the GUI.  The 
log file will show the API commands that are called from the GUI.  It doesn't 
work for everything (e.g. wizards), but for most basic actions, it should be 
helpful.  At least it will give you the right command to look up on the PyMOL 
wiki!

Hope that helps.

Cheers,
Jared

> 
> Your help is greatly appreciated.
> 
> 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

--
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] which PyMOL to open?

2017-04-28 Thread AJ Vincelli

Hi all,

Thanks to Dheeraj, Jordan and Jed for your advice!

I don't think I installed any "extra" options, just educational-use-only 
PyMOL (version 1.7.4.5, x64) on Windows 10.


In the Windows 10 Start Menu folder, all of the 3D options are in a 
subfolder called "Stereo 3D Launch," so I think it's safe to say that 
all of those shortcuts are "special" and not "typical."


That leaves just 4 options, and of those, "Full Screen" and "Viewer 
Only" seem pretty straightforward.


That only leaves "PyMOL + Tcl-Tk GUI" and "PyMOL + Tcl-Tk GUI + 
Console." It looks like the shortcuts point to the same program, but the 
Console shortcut has an extra switch at the end: "C:\Program 
Files\PyMOL\PyMOL\PymolWin.exe" +2 -J. The GUI-only shortcut doesn't 
have the +2 switch, just the -J switch.


I don't know what the +2 switch does, or what the -J switch does for 
that matter, but I think I'm just going to use the "PyMOL + Tcl-Tk GUI + 
Console" option in the Start Menu for my everyday PyMOL use.


When I open either of these two shortcuts, they look exactly the same to 
me anyway.


Thanks for everyone's help!

AJ



-- Original Message --
From: "Dheeraj Prakaash" 
To: "AJ Vincelli" 
Cc: pymol-users@lists.sourceforge.net
Sent: 4/22/2017 12:46:51 AM
Subject: Re: [PyMOL] which PyMOL to open?


Wow!
I haven't seen so many options before, even after installing Edu PyMOL 
correctly.


Do you all of you get these options (Win10 users)?
I only get to see
PyMOL + Tcl-tk, and,
PyMOL + Tcl-tk + Console.

AJ, did you install anything extra?
This may seem another dumb question, but your answers will be helpful.

Regards
Dheeraj--
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] Using API to select resi, and return some information within a certain distance

2017-04-28 Thread Ahmad Abdelzaher
Hello,

I'm still a bit new to the API so I'm not sure which commands to use.
At least I know I will start with cmd.select(string name, string
selection).

How can I tell Pymol to:

1) look within a certain radius distance, and return resi's within
that distacne.

2) find all polar interactions within a distance, use sticks, color by
atom, hide everything else and output an image of the selections and
interactions around it.

Please feel free to throw in any useful commands that can you might
think is helpful.

Your help is greatly appreciated.

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