Atom selections for distance (embarrassingly simple)
Hi everyone, I'm trying to do some distance extraction of hetero atoms in pdbs. I've got for model in pdb_obj.hierarchy.models(): for chain in model.chains(): for rg in chain.residue_groups(): for ag in rg.atom_groups(): for atom in ag.atoms(): if atom.hetero == True: print atom.distance(atom) Which prints out 0.0 as expected. But I can't figure out how to, say, measure the distance to an atom in the previous residue (if there is a previous residue). I also noticed something weird in this tutorial: http://cctbx.sourceforge.net/sbgrid2008/tutorial.html They truncate a non-standard amino acid to the beta-carbon but this only works because there's an alternate conformation with a standard amino acid (Cys). So it wouldn't work with a seleno-met for instance (I know there's a convert-to-ala function in mmtbx - I said it was weird, not terrible). Anyway, I hope someone can explain the distances thing for me. I'm sure there are multiple ways of doing it (should I just do a selection of "hetatm" and iterate over them and try to get some distanes?). Cheers, Morten
Hi Morten, your example does not include symmetry. You can see the implementation of iotbx.show_distances 1yjp.pdb that computes all-vs-all distances in most efficient way and also is symmetry-smart. You can combine functionality of some pieces of iotbx.show_distances (those that give you indices of pairs) with the list of atoms from pdb_hierarchy (that gives you all labels: residue names, atom names, etc). Pavel On 2/18/15 11:30 AM, Morten Grøftehauge wrote:
Hi everyone,
I'm trying to do some distance extraction of hetero atoms in pdbs. I've got
for model in pdb_obj.hierarchy.models(): for chain in model.chains(): for rg in chain.residue_groups(): for ag in rg.atom_groups(): for atom in ag.atoms(): if atom.hetero == True: print atom.distance(atom)
Which prints out 0.0 as expected. But I can't figure out how to, say, measure the distance to an atom in the previous residue (if there is a previous residue).
I also noticed something weird in this tutorial: http://cctbx.sourceforge.net/sbgrid2008/tutorial.html They truncate a non-standard amino acid to the beta-carbon but this only works because there's an alternate conformation with a standard amino acid (Cys). So it wouldn't work with a seleno-met for instance (I know there's a convert-to-ala function in mmtbx - I said it was weird, not terrible).
Anyway, I hope someone can explain the distances thing for me. I'm sure there are multiple ways of doing it (should I just do a selection of "hetatm" and iterate over them and try to get some distanes?).
Cheers, Morten
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
participants (2)
-
Morten Grøftehauge
-
Pavel Afonine