Re: [PyMOL] command line scrolling on Viewer

2017-05-02 Thread Jonathan Sheehan
Hi Beth,

It sounds like you may have accidentally toggled "Overlay Text."  In
the Settings menu, see if that setting is checked, and un-check it.
This works on Linux, not sure about Mac.



On Tue, May 2, 2017 at 2:29 PM, Beth Stroupe  wrote:
> Hi all,
>
> I am new to PyMol and probably just made a beginner’s mistake. I managed to 
> get the command line history to scroll on the Viewer. I am not sure the 
> sequence of events that lead to this, I was trying to select a region of the 
> molecule with my mouse and must have used an unfortunate series of mouse 
> clicks and keys (?). I cannot get it to go away and it seems saved to the 
> session. Google has not seemed to find a similar mishap. I was almost done 
> with the figure and would prefer to not start over (but if I begin a new 
> session the scroll is no longer present).
>
> If I hit esc, the molecule goes away but the words remain. The scroll is 
> updated as I add more to the session.
>
> I am running v1.8.6.0 (downloaded today, 5/2/17) on an iMac running Version 
> 10.11.6 El Capitan.
>
> Help! and many thanks,
>
> Beth

--
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] command line scrolling on Viewer

2017-05-02 Thread Beth Stroupe
Hi all,

I am new to PyMol and probably just made a beginner’s mistake. I managed to get 
the command line history to scroll on the Viewer. I am not sure the sequence of 
events that lead to this, I was trying to select a region of the molecule with 
my mouse and must have used an unfortunate series of mouse clicks and keys (?). 
I cannot get it to go away and it seems saved to the session. Google has not 
seemed to find a similar mishap. I was almost done with the figure and would 
prefer to not start over (but if I begin a new session the scroll is no longer 
present).

If I hit esc, the molecule goes away but the words remain. The scroll is 
updated as I add more to the session.

I am running v1.8.6.0 (downloaded today, 5/2/17) on an iMac running Version 
10.11.6 El Capitan.

Help! and many thanks,

Beth
--
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] Replace main/side chain with a H atom in a script

2017-05-02 Thread Qianyi Cheng
I want to run QM calculation on reaction center of a large protein. So I
need to chop off  many parts of the protein. I want to replace some
side/main chains with H atoms (for example replace the CB atom by a H atom
and also modify the C-H bond to the correct length).
I know how to make it work by clicking the build panel. But is there a way
I can write a script to make this happen? Thanks?
--
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] Using API to select resi, and return some information within a certain distance

2017-05-02 Thread David Hall
When debugging, it is good to stop running pymol as a command line app and
just run your script in a pymol gui and see what it is going on.

In this case, you would find your selections have zero atoms. Why? Because
you are basing them on something like "resn 102" , which is using the
residue name selector with a residue number.

If you replace resn with resi , you should get nice pictures.

> 2) I still have no idea what the command cmd.get_pdbstr do

It returns a string in PDB format of the set of atoms in the selection. So,
the same string as would be in a file if you said save('xxx.pdb', 'sele')



On Tue, May 2, 2017 at 3:47 AM, Ahmad Abdelzaher 
wrote:

> Thank you. I made a few mistakes in my code. I wasn't paying attention
> to the commented code because I was only trying stuff there. I still
> get:
>
> 1) a bunch of 3 kb black png's
> 2) I still have no idea what the command cmd.get_pdbstr do
> 3) can you give me a line using iterate to get the residue names and
> numbers?
>
>
> import __main__
> __main__.pymol_argv = ['pymol','-qc']
> import pymol
> from pymol import cmd, stored, util
>
> pymol.finish_launching()
>
> residues = {'3s4m.pdb': {'102': 'THR',
>   '143': 'TYR',
>   '158': 'SER',
>   '166': 'TYR',
>   '173': 'TRP',
>   '181': 'SER',
>   '183': 'HIS',
>   '206': 'SER',
>   '95': 'TYR'}}
>
> for name, data in residues.items():
> for resnumber, resname in data.items():
> cmd.delete('all')
> bare_name = name.split('.')[0]
> cmd.load(name, bare_name)
> cmd.select('%s_%s%s' % (bare_name, resname, resnumber), 'byres
> resn %s around 10' % resnumber)
> cmd.dist('mysele_polar_conts','%s_%s%s' % (bare_name, resname,
> resnumber),'all within 5 of %s_%s%s' % (bare_name, resname,
> resnumber), quiet=1,mode=2,label=0,reset=1)
> cmd.show_as('sticks', '%s_%s%s' % (bare_name, resname, resnumber))
> util.cnc('%s_%s%s' % (bare_name, resname, resnumber))
> cmd.hide('everything', 'all and not %s_%s%s' % (bare_name,
> resname, resnumber))
> cmd.zoom('%s_%s%s' % (bare_name, resname, resnumber), 5)
> cmd.png('%s_%s%s.png' % (bare_name, resname, resnumber), ray=1)
>
>
>
> On Tue, May 2, 2017 at 7:14 AM, Jared Sampson
>  wrote:
> > Hi Ahmad - Please see below for some suggestions on getting your script
> to
> > do what I understand you would like to do.
> >
> > Cheers,
> > Jared
> >
> >
> > On May 1, 2017, at 4:54 PM, Ahmad Abdelzaher 
> wrote:
> >
> > OK I finally tried some of Jared suggestions, I'm not sure why
> > util.cnc doesn't work I get "NameError: name 'util' is not defined",
> >
> >
> > You will need to import the `util` namespace.  Try changing the pymol
> > submodule import line to:
> >
> > from pymol import cmd, stored, util
> >
> > Again, I want to color by element, second option from the gui. Also
> > the script outputs black screenshots, nothing is there, so there is a
> > bug somewhere! I attached the script and pdb below. I would appreciate
> > your help.
> >
> > import __main__
> > __main__.pymol_argv = ['pymol','-qc']
> > import pymol
> > from pymol import cmd, stored
> >
> > pymol.finish_launching()
> >
> > residues = {'3s4m.pdb': {'102': 'THR',
> >  '143': 'TYR',
> >  '158': 'SER',
> >  '166': 'TYR',
> >  '173': 'TRP',
> >  '181': 'SER',
> >  '183': 'HIS',
> >  '206': 'SER',
> >  '95': 'TYR'}}
> >
> > for name, data in residues.items():
> >for resnumber, resname in data.items():
> >cmd.delete('all')
> >cmd.load(name, name)
> >
> >
> > The load command here gives you an object called "3s4m.pdb" but you later
> > try to use a selection called only "3s4m" (`bare_name`).  If you leave
> the
> > second argument off from cmd.load(), the .pdb extension will be stripped
> > automatically.  Alternatively, you could assign `bare_name` first and
> give
> > that as the 2nd argument:
> >
> > bare_name = name.split('.')[0]
> > cmd.load(name, bare_name)
> >
> >
> >bare_name = name.split('.')[0]
> >cmd.select('%s_%s%s' % (bare_name, resname, resnumber), 'byres
> > resn %s around 3' % resnumber)
> >#selee = cmd.get_pdbstr('%s' % name.split('.')[0])
> >
> >
> > Since you've already assigned a variable for this, you can (and should!)
> use
> > `bare_name` instead of `name.split('.')[0]` wherever it occurs.  Also,
> you
> > don't need to do "%"-style string formatting if your variable is a string
> > and comprises the entire argument string.  Simply
> > `cmd.get_pdbstr(bare_name)`, for example, will work just fine.
> >
> >#print(selee)
> >cmd.dist('mysele_polar_conts','%s_%s%s' % (bare_name, resname,
> > resnumber),'all within 5 of %s_%s%s' % (name.split('.')[0], resname,
> > resnumber), quiet=1,mode=2,label=0,reset=1)
> >cmd.show_as('sticks', '%s_%s%s' % (bare_name, resname, resnumber))
> >#util.cnc('%s' % name.split('.')[0])
> >cmd.hide('everything', 

Re: [PyMOL] Text Font size

2017-05-02 Thread Mykola Dimura
Thank you Thomas and Piotr,
Unfortunately I only have PyMOL 1.7.6.4 - Incentive available at the
moment. I will try the “display_scale_factor” option once my pymol
installation is updated.
Best regards, Mykola Dimura.


On 1 May 2017 at 20:38, Thomas Holder  wrote:
> Hi Mykola,
>
> Incentive PyMOL 1.8.4 introduced the “display_scale_factor” setting which 
> allows scaling of the internal GUI, prompt, fonts etc. by a factor of 2. In 
> MacPyMOL this is also linked to the “Display > Retina Resolution” menu option 
> and the “--retina” launch argument.
>
> Hope that helps.
>
> Cheers,
>   Thomas
>
>> On May 1, 2017, at 7:00 PM, Mykola Dimura  wrote:
>>
>> It's a pity, that internal_gui font size does not scale with
>> internal_gui_control_size. This is the only thing missing for pymol to
>> be usable on high-dpi displays. Is it possible that this feature will
>> appear in future pymol versions?
>>
>> Best regards, Mykola Dimura.
>>
 Unfortunately, the graphics window fonts can't be changed.
 But you could increase the size of the buttons in the object menu panel:
 set internal_gui_control_size, 40
>
> --
> 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] Using API to select resi, and return some information within a certain distance

2017-05-02 Thread Ahmad Abdelzaher
Thank you. I made a few mistakes in my code. I wasn't paying attention
to the commented code because I was only trying stuff there. I still
get:

1) a bunch of 3 kb black png's
2) I still have no idea what the command cmd.get_pdbstr do
3) can you give me a line using iterate to get the residue names and numbers?


import __main__
__main__.pymol_argv = ['pymol','-qc']
import pymol
from pymol import cmd, stored, util

pymol.finish_launching()

residues = {'3s4m.pdb': {'102': 'THR',
  '143': 'TYR',
  '158': 'SER',
  '166': 'TYR',
  '173': 'TRP',
  '181': 'SER',
  '183': 'HIS',
  '206': 'SER',
  '95': 'TYR'}}

for name, data in residues.items():
for resnumber, resname in data.items():
cmd.delete('all')
bare_name = name.split('.')[0]
cmd.load(name, bare_name)
cmd.select('%s_%s%s' % (bare_name, resname, resnumber), 'byres
resn %s around 10' % resnumber)
cmd.dist('mysele_polar_conts','%s_%s%s' % (bare_name, resname,
resnumber),'all within 5 of %s_%s%s' % (bare_name, resname,
resnumber), quiet=1,mode=2,label=0,reset=1)
cmd.show_as('sticks', '%s_%s%s' % (bare_name, resname, resnumber))
util.cnc('%s_%s%s' % (bare_name, resname, resnumber))
cmd.hide('everything', 'all and not %s_%s%s' % (bare_name,
resname, resnumber))
cmd.zoom('%s_%s%s' % (bare_name, resname, resnumber), 5)
cmd.png('%s_%s%s.png' % (bare_name, resname, resnumber), ray=1)



On Tue, May 2, 2017 at 7:14 AM, Jared Sampson
 wrote:
> Hi Ahmad - Please see below for some suggestions on getting your script to
> do what I understand you would like to do.
>
> Cheers,
> Jared
>
>
> On May 1, 2017, at 4:54 PM, Ahmad Abdelzaher  wrote:
>
> OK I finally tried some of Jared suggestions, I'm not sure why
> util.cnc doesn't work I get "NameError: name 'util' is not defined",
>
>
> You will need to import the `util` namespace.  Try changing the pymol
> submodule import line to:
>
> from pymol import cmd, stored, util
>
> Again, I want to color by element, second option from the gui. Also
> the script outputs black screenshots, nothing is there, so there is a
> bug somewhere! I attached the script and pdb below. I would appreciate
> your help.
>
> import __main__
> __main__.pymol_argv = ['pymol','-qc']
> import pymol
> from pymol import cmd, stored
>
> pymol.finish_launching()
>
> residues = {'3s4m.pdb': {'102': 'THR',
>  '143': 'TYR',
>  '158': 'SER',
>  '166': 'TYR',
>  '173': 'TRP',
>  '181': 'SER',
>  '183': 'HIS',
>  '206': 'SER',
>  '95': 'TYR'}}
>
> for name, data in residues.items():
>for resnumber, resname in data.items():
>cmd.delete('all')
>cmd.load(name, name)
>
>
> The load command here gives you an object called "3s4m.pdb" but you later
> try to use a selection called only "3s4m" (`bare_name`).  If you leave the
> second argument off from cmd.load(), the .pdb extension will be stripped
> automatically.  Alternatively, you could assign `bare_name` first and give
> that as the 2nd argument:
>
> bare_name = name.split('.')[0]
> cmd.load(name, bare_name)
>
>
>bare_name = name.split('.')[0]
>cmd.select('%s_%s%s' % (bare_name, resname, resnumber), 'byres
> resn %s around 3' % resnumber)
>#selee = cmd.get_pdbstr('%s' % name.split('.')[0])
>
>
> Since you've already assigned a variable for this, you can (and should!) use
> `bare_name` instead of `name.split('.')[0]` wherever it occurs.  Also, you
> don't need to do "%"-style string formatting if your variable is a string
> and comprises the entire argument string.  Simply
> `cmd.get_pdbstr(bare_name)`, for example, will work just fine.
>
>#print(selee)
>cmd.dist('mysele_polar_conts','%s_%s%s' % (bare_name, resname,
> resnumber),'all within 5 of %s_%s%s' % (name.split('.')[0], resname,
> resnumber), quiet=1,mode=2,label=0,reset=1)
>cmd.show_as('sticks', '%s_%s%s' % (bare_name, resname, resnumber))
>#util.cnc('%s' % name.split('.')[0])
>cmd.hide('everything', 'all and not %s_%s%s' % (bare_name,
> resname, resnumber))
>cmd.zoom('%s_%s%s' % (bare_name, resname, resnumber), 5)
>cmd.png('%s_%s%s.png' % (bare_name, resname, resnumber), ray=1)
>
>
> Also, to get information about residues in your selection as you asked in
> your later message, have a look at cmd.iterate().
> https://pymolwiki.org/index.php/Iterate
>
>
> Hope that helps.
>
> Cheers,
> Jared
>
>
> On Sat, Apr 29, 2017 at 3:34 PM, Ahmad Abdelzaher
>  wrote:
>
> Thanks Jared. A lot of fantastic tips there. Much appreciated.
>
> Regards.
>
> On Sat, Apr 29, 2017 at 6:03 AM, Jared Sampson
>  wrote:
>
> 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