[chimera-dev] distance measurements
Eric Pettersen
pett at cgl.ucsf.edu
Thu Aug 20 12:35:55 PDT 2015
Probably the simplest way is to just see if you wound up with multiple models or not (i.e. len(openModels.list(modelTypes=Molecule)) > 1). If you just want to use one model per entry regardless of it being NMR or not, don’t loop over the model list but just use the first model in it, i.e. instead of:
for mol in openModels.list(modelTypes=[Molecule]):
indented analysis code
use:
mol = openModels.list(modelTypes=[Molecule])[0]
unindented analysis code
—Eric
> On Aug 19, 2015, at 9:10 PM, Feixia <feixia.chu at unh.edu> wrote:
>
> Thank you, Eric!
> I am still downloading PDB files through Bio.python. I am just interested in the overall distance distribution of residues, say Lys alpha carbon. NMR entries might end up over-representing due to their multiple models. Thank you for pointing it out. Is there a quick way to distinguish crystal structures from NMR structures?
>
> Best,
> Feixia
>
> On Wed, 19 Aug 2015 14:17:35 -0400, Eric Pettersen <pett at cgl.ucsf.edu> wrote:
>
> Hi Feixia,
> You could certainly use Chimera to do that. You need to know some Python. Take a look at the Programmer’s Guide:
>
> http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/index.html <http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/index.html>
>
> In particular, the “basic primer” discusses how to loop over files in a directory and do things to them one by one.
> Here’s some example code for printing the lysine CA-CA distances for a single open file. You could take that and move it into the loop described in the basic primer — customizing it as you wish…
>
> from chimera import openModels, Molecule
> # opening NMR files can produce multiple models, so use a loop...
> for mol in openModels.list(modelTypes=[Molecule]):
> lysCas = [a for a in mol.atoms if a.name == “CA” and a.residue.type == “LYS”]
> for i, ca1 in enumerate(lysCas):
> for ca2 in lysCas[i+1:]:
> print mol.name, ca1, ca2, ca1.coord().distance(ca2.coord())
>
> —Eric
>
> Eric Pettersen
> UCSF Computer Graphics Lab
>
>> On Aug 18, 2015, at 8:36 AM, Feixia <feixia.chu at unh.edu <mailto:feixia.chu at unh.edu>> wrote:
>>
>> Hi there,
>>
>> I am interested in retrieving distance information from large dataset in an automatic fashion. For instance, can we use Chimera to get the distances between lysine alpha-carbons of current PDB entries. Presumably, we can download all PDB structures on our local desktop, and just call functions one structure at a time. I wonder if we can do that with Chimera. Your advice will be highly appreciated.
>>
>> Best,
>> Feixia
>>
>>
> _______________________________________________
> Chimera-dev mailing list
> Chimera-dev at cgl.ucsf.edu
> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20150820/01e3b122/attachment.html>
More information about the Chimera-dev
mailing list