[Chimera-users] identifying and counting selected residues

Eric Pettersen pett at cgl.ucsf.edu
Thu Apr 1 09:33:53 PDT 2021


These questions are oddly similar, and have the same answer.  To get the selected residues in Python, and how many, you:

	from chimera.selection import currentResidues
	sel_residues = currentResidues()
	num_sel = len(sel_residues)

--Eric

	Eric Pettersen
	UCSF Computer Graphics Lab

> On Mar 31, 2021, at 10:03 PM, Jayashree Chittari <jayashreechittari27 at gmail.com> wrote:
> 
> Respected sir/ma'am
> 
> Greetings for the day!
> I want to use chimera commands in shell scripting or python. So, my problem is how to count the residues using Chimera? in gui we know that there is a magnifying icon at the lower right portion of the window, but while running in linux terminal I'm unable to generate the same results.
> 
> Here is the attached ss of inspect selection, so if I want to print this in linux terminal what steps should I follow to get to this result?
> 
> I'm trying my best to search in the tutorials but  unable to create a command related to inspect selection.
> Kindly help me in this issue, it would be very grateful if you suggest the code.
> 
> thank you,
> 
> Regards
> Chittari Jaya Shree


> On Apr 1, 2021, at 2:13 AM, Smit Patel <patelsmit11103 at gmail.com> wrote:
> 
> respected ma'am
> 
> greetings for the day!
> 
> Sorry to disturb you again. can you pls tell me the process to run this selection inspector tool using chimera --nogui option. I tried but couldn't find any. Also in the python 2.7 scripts, the inspect.py script is hard to understand. Can you pls tell me to count residues without any involvement of GUI? it would be really helpful.
> 
> thank you,
> Regards
> 
> Smit, B.tech(bioinformatics)
> Amity university
> 
> On Wed, Mar 31, 2021 at 8:52 PM Elaine Meng <meng at cgl.ucsf.edu <mailto:meng at cgl.ucsf.edu>> wrote:
> Greetings Smit,
> You can just use the "select" command with these amino acid categories, for example:
> 
> select polar
> select nonpolar
> select hydrophobic
> 
> See:
> <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/select.html <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/select.html>>
> <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/atom_spec.html#builtin <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/atom_spec.html#builtin>>
> <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/selection.html <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/selection.html>>
> 
> .... and then the Selection Inspector says how many residues are selected.  You can open this tool from the menu (Actions... Inspect) or by clicking the magnifying-glass icon near the bottom right corner of the Chimera window, 
> <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/inspection.html <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/inspection.html>>
> 
> and just keep that tool open the whole time.  Then when you use the different select commands, it will say near the top of that dialog how many residues and atoms are selected.
> 
> There are beginner tutorials for starting to use commands, for example 
> <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/tutorials/getting_started.html <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/tutorials/getting_started.html>>
> 
> ...and the "working with commands" section in:
> <https://www.rbvi.ucsf.edu/Outreach/Tutorials/GettingStarted.html <https://www.rbvi.ucsf.edu/Outreach/Tutorials/GettingStarted.html>> 
> 
> I hope this helps,
> Elaine
> -----
> Elaine C. Meng, Ph.D.                       
> UCSF Chimera(X) team
> Department of Pharmaceutical Chemistry
> University of California, San Francisco
> 
> > On Mar 31, 2021, at 12:29 AM, Smit Patel <patelsmit11103 at gmail.com <mailto:patelsmit11103 at gmail.com>> wrote:
> > 
> > Respected sir/ma’am,
> >  
> > Greetings for the day!
> > I’m new user of chimera tool and I don’t know many functions related to command line. So my question is how to identify and count polar, nonpolar , hydrophobic residues in a given protein using command line.
> >  
> > Like in gui I performed selectàresidueàamino acid categoryàpolar or hydrophobic. So how to covert this process into the code using command line and get the count of the residues which are selected hydrophobic/polar?
> >  
> > It would be very grateful if you could advise me how to code the command line. 
> > Thank you,
> > Regards 
> > Smit  
> >  
> _______________________________________________
> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
> Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20210401/98d1ff2c/attachment.html>


More information about the Chimera-users mailing list