Closed GoogleCodeExporter closed 9 years ago
There exists a workaround if you know your selections. Then you can explicitly
construct the KDTree NeighborSearch from atom selection. (In fact, this is
faster
than MDAnalysis selection parsing and may be rather useful when iterating over a
whole trajectory):
import MDAnalysis.KDTree.NeighborSearch as kdNS
u = Universe(psf,dcd)
water = u.selectAtoms('name OH2')
protein = u.selectAtoms('protein')
# The following has to be done every time step:
ns_w = kdNS.AtomNeighborSearch(water)
solvation_shell = ns_w.search_list(protein,4.0) # water oxygens within 4A of
protein
(see also the doc strings for MDAnalysis.KDTree.NeighborSearch)
Original comment by orbeckst
on 28 Aug 2008 at 1:00
Changed the title because the problem is really that selectAtoms() from Universe
behaves different from seletAtoms() from a arbitrary AtomSelection. In the code
the
problem is that the atom selection does not know about any other atoms than
itself.
Hence any selection that references atoms outside the AtomGroup fails.
Original comment by orbeckst
on 2 Sep 2008 at 4:15
changed title (removed 'UNSTABLE') because this issue is also present in 0.6.0
Original comment by orbeckst
on 1 Apr 2010 at 11:27
i'm going to give this one and issue 42 a look.
Original comment by jan...@gmail.com
on 3 Jul 2011 at 6:25
This is the simplest solution i could think of: when a selection is applied to
an existing AtomGroup, it is in fact applied to its universe. Then, a common
set of the starting Atoms and the newly selected ones is returned.
A common parent class to AtomGroup and Universe would probably be a better idea.
Original comment by jan...@gmail.com
on 3 Jul 2011 at 8:39
Attachments:
@jandom: The patch is probably to costly for most cases. I can't really think
of a good way to change the underlying code to make this work except
introducing "named selections" as proposed in Issue 42. I'll close it for the
time being as wontfix.
Anyone, feel free to re-open.
Original comment by orbeckst
on 13 Sep 2011 at 3:33
Original issue reported on code.google.com by
orbeckst
on 28 Aug 2008 at 12:55