[Chimera-users] Setting selection mode command line
pett at cgl.ucsf.edu
Mon Dec 16 12:11:10 PST 2013
Yeah, the primary thing is that you can pretty much emulate selection modes with operators in the command line:
| (vertical bar): 'or' [union] ("#1 | ligand" is everything in model 1 and all ligands)
&: 'and' [intersection] (""#1 & ligand" is the ligands in model 1)
~: 'not' [negation] ("#1 & ~ligand" is everything in model 1 that is not ligand)
If you find it getting too complicated for you, you can instead build up a selection in piecemeal fashion with the 'sel' command:
sel ligand & #1 (selection the ligand in model 1)
sel sel z<5 (select everything within 5 angstroms of that)
sel sel & #2 (keep only the part in model 2)
then whatever command you wanted (e.g. "color red sel").
UCSF Computer Graphics Lab
On Dec 16, 2013, at 11:56 AM, Elaine Meng <meng at cgl.ucsf.edu> wrote:
> Hi Rebecca,
> I don't know much about nogui, maybe others can say something about that. I don't know if that would buy you that much time, even if it was working the way you intended.
> However, you can specify zones in commands without selecting anything. For example:
> color red ligand z<8
> …and do more complicated combinations, for example:
> delete solvent & #1 & ligand z>8
> (delete solvent residues in model 1 that don't have any atoms within 8 ang of ligand… or ~display instead of delete). Doesn't sound like you'd need aliases.
> See zones and combinations in the atomspec page. zr and z are for residue-based cutoff, za for atom-based
> On Dec 16, 2013, at 11:44 AM, rswett at chem.wayne.edu wrote:
>> Alright, thanks.
>> I was hoping to be able to manipulate some excessively large pdb files using chimera commandline only with the --nogui option to get around the display problem. I had intended to open three files, one protein, one solvated system and one standalone ligand. Align the protein to the solvated system and use the zone selection to carve out a sphere around the standalone ligand, saving that portion of the solvated system and the entirety of both progtein structures into a single file. If you have any suggestions let me know. I'll start looking int aliasing if you think that would help bet around the gui.
>> As it stands, I can't get it to work with the --nogui flag on windows anyway. I'm using the command
>> chimera --nogui block.cmd
>> where block.cmd simply opens the solvated system and ligand, selects a zone around the ligand and saves the selected atoms to a file, but I get no output and it runs too fast to be actually reading in the structures. Suggestions? I'm using the 1.8.1 build
>> Quoting Elaine Meng <meng at cgl.ucsf.edu>:
>>> Hi Rebecca,
>>> As far as I know, you cannot change the selection mode in a command. However, with commands you can often circumvent selection entirely, or in the few cases where you can't easily do that (for example, the "findhbond" command uses selections), there are sometimes alternative routes to achieving the same result. In the command line, you can make a selection and then use ~select to deselect only part of it. Sometimes instead of selections you can use aliases and combinations of aliases. For writing a subset of the coordinates, you could undisplay the unwanted atoms and use the corresponding option to the "write" command to exclude them from the output. Or, depending on exactly what you are doing, you could just delete the unwanted atoms before saving to a file.
>>> Avoiding selection may be one of the advantages of commands, since (as you found) drawing the selection outlines can make things slow.
>>> I hope this helps,
>>> Elaine C. Meng, Ph.D.
>>> UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
>>> Department of Pharmaceutical Chemistry
>>> University of California, San Francisco
>>> On Dec 16, 2013, at 8:13 AM, rswett at chem.wayne.edu wrote:
>>>> Hi all,
>>>> I'm interested in putting together a script that will open several large pdb files, select some very specific pieces of those files and save the output to another file. The problem is that they are large files and unwieldy in a graphics window. I have no problem generating the commands to select the regions I'm interested in, but I still need to be able to switch selection modes in between commands. Is there a way to change the selection mode at the command line without navigating the selection menu?
>> Chimera-users mailing list
>> Chimera-users at cgl.ucsf.edu
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
More information about the Chimera-users