[Biopython] Getting the atom number of a CA residue

Mark Livingstone livingstonemark at gmail.com
Mon May 28 01:55:25 UTC 2012


Hi Guys,

I want to use the Bio.PDB.NeighborSearch. To do so, it seems I need to
tell it what atom to center the search on. I have constructed this
convoluted center finding method ;-) and I'm wondering if there is
something simpler!!


    atoms = Bio.PDB.Selection.unfold_entities(mtc, "A")
    # we find the atom number of the mutation site residue's CA atom
which becomes the center of our search radius
    center = atoms[mtc[mutation_site].get_unpacked_list()[1].get_serial_number()].get_coord()
    bions = Bio.PDB.NeighborSearch(atoms)
    atoms_found = bions.search(center, 5.0, "A")
    residues_found = bions.search(center, 5.0, "R")


Using 1bti.pdb and asking for the Residue 22 [=mutation_site] CA [1]
does give me atom #187 coords which is correct. At the moment I am
only interested in CA, but I realise this somewhat hardcoded solution
will not scale!

Secondly, what I eventually want to get is more of a range function
where I can find e.g. what is between 5-10A from center. Since
neighborsearch doesn't give access to distances of the atoms /
residues, am I correct in thinking I will have to "roll my own"
neighbourhoodsearch and construct a sorted by distance list and
iterate through it getting e.g. 5 < distance < 10 or similar?

Thanks for your thoughts.

MarkL



More information about the Biopython mailing list