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

Reply via email to