[Chimera-users] Ligand selection information

Eric Pettersen pett at cgl.ucsf.edu
Wed Oct 15 14:54:46 PDT 2014


Hi Korbin,
	In Python you can get a list of the currently selected residues with:

res_list = chimera.selection.currentResidues()

That returns Residue objects, which are described some in the Chimera Programmer's Guide.  In IDLE Python shell (Tools->General Controls->IDLE) you can also get some description of Residue capabilities with:

help(chimera.Residue)

You could also nose around the Chimera code (which is in your Chimera distribution) to see how things are done or ask questions here or on the chimera-dev mailing list (more "programmer-y" questions are better on the latter).
	I note that your "ligand" list contains waters, likely due to those waters having altlocs which confuses the classification code.  This "confusion" only exists in the 1.9 production release or earlier.  If you get the 1.10 daily build or the 1.10 release candidate then those waters will not be classified as ligand.

--Eric

                        Eric Pettersen
                        UCSF Computer Graphics Lab
                        http://www.cgl.ucsf.edu

On Oct 15, 2014, at 1:58 PM, Korbin West <khwest16 at wabash.edu> wrote:

> Hello.
> 
> I'm fairly new to Chimera and Python programming, I'm still trying to pick up a lot of it as I go. I'm going through some data and am trying to get the information about a ligand in a protein. So in my script I'm using the runCommand function to get the info on the ligand, but I'd like a way to do so without writing it to a file.
> 
> Here's what I have at the moment, writing the information to a file.
> 
> runCommand('open 2izh')
> runCommand('sel ligand')
> runCommand("writesel ~/Desktop/testligand.txt")
> 
> And here's an excerpt of the testligand.txt file:
> 
> #1 BTN 300.B
> #1 HOH 1777.B
> #1 HOH 1778.B
> #1 BTN 300.D
> #2 ACY 801.B
> #2 SER 308.C
> #3 BTN 300.B
> 
> 
> Is there a way I can just access this information as a list or something so I don't have to write the file then open the file to see the info? I'd like to continue the script to sort out through some of this information but I'm dealing with a lot of pdb files so I'd prefer not to have write a file, open it, read it, then rewrite it and repeat a ton of times.
> 
> Thanks so much,
> 
> Korbin West
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> http://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/20141015/ef0de350/attachment.html>


More information about the Chimera-users mailing list