[Chimera-users] Programmatic selection and minimisation

Elaine Meng meng at cgl.ucsf.edu
Mon Dec 10 10:24:54 PST 2018

Hi Miro,
I’m not a programmer but I think I can answer these...

(2) and (3) I believe that if you run through one minimization using the GUIs, e.g. start with Minimize Structure GUI (in menu under Tools.. Structure Editing), which will then display Dock Prep, AddH, Add Charge GUIs, you can turn on the option “Memorize options chosen in subsequent dialogs” on the Minimize Structure dialog.  After you do that, it will save the options you chose in Dock Prep in your preferences file.  

Later when you use the “minimize” command with “nogui true” it will use the settings you previously saved.  Also, it will use the charge method most recently chosen in the Add Charge GUI.  This is mentioned in the “nogui true” description:

(1) This one is trickier.  Commands like the following would get rid of single residues beyond the zone:

sel #0:501.a zr<5
delete solvent & ~ sel
delete ions & ~ sel
delete ligand & ~ sel

The main problem, however, is that then you’d still need to identify whole biopolymer chains (based on connectivity, NOT based on chain ID) without any part in the zone.  One idea is to remove protein helix/strand assignments IDs (assuming that your workflow doesn’t need them for anything) and then use “select up” once to promote protein and nucleic residues to their whole connected chains. 

setattr r isHelix false
setattr r isStrand false
setattr r ssId 0
sel up
delete protein & ~ sel
delete nucleic & ~ sel

(capital letter “i” in ssId, value zero)

I hope this helps,
Elaine C. Meng, Ph.D.
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco

> On Dec 9, 2018, at 7:27 PM, Miro Moman <miromoman at gmail.com> wrote:
> Hello,
> I am trying to use Chimera programmatically in order to automatise a number of tasks.
> I have tree questions:
> 1) When I select a zone around the ligand (for instance "runCommand(select #0:501.A zr<5)" the selection level is either atoms or, in this case, residues. Is there a way to select molecules? Because the problem I am finding is that if I run "runCommand(select up)", depending on the PDB file, sometimes I need to do it twice and sometimes three times in order to select the entire molecules (be them proteins or not). I would like to have more control over this function. The purpose being deleting molecules that are far away from the ligand. 
> 2) Right now I am running "DockPrep" followed by "minimize" (without further "prep"). The reason is that "DockPrep" enables me to set options, whereas for "minimize" with "prep" this possibility, if it exists, does not seem to be documented. Is that the case?
> 3) Finally, in "DockPrep", is there a way to select the charge model explicitly? For instance, to choose Gasteiger charges in order to save time.
> Kind regards,
> Miro

More information about the Chimera-users mailing list