-
Notifications
You must be signed in to change notification settings - Fork 60
-
Hi,
I'm trying to label grid points from a CCP4 map based on closest atoms in the aligned PDB. My issue is that the coordinate systems of the PDB file and the Grid don't seem to align (after getting cartesian co-ordinates for each grid point after fractionalization).
My current pipeline is: get fractional coordinates for each grid point -> use orthogonalization matrix to get cartesian coordinates for each grid point -> use nearest neighbour search between grid points and pdb coordinates to label a grid point based on atom type based on a specified radius.
The final step would only work if the map and PDB are aligned in their origin and coordinate systems (which they do not seem to be).
Is there a way to fix this or around this (or are there any flaws in my thought process) ?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 6 replies
-
If the map has the same unit cell as the PDB file, and it corresponds to this PDB file, I think it should work.
You can call grid.get_position(i,j,k) to get Cartesian coordinates corresponding to a grid point.
Beta Was this translation helpful? Give feedback.
All reactions
-
Ah, that's what you meant. This is normal, you need to take symmetry into account when searching for nearest neighbors. If you use gemmi.NeighborSearch, it is handled automatically.
Beta Was this translation helpful? Give feedback.
All reactions
-
Just so I understand correctly, gemmi.Position is a cartesian coordinate, and gemmi.Point is a grid point, yes? Is there a way to use NeighborSearch to get the nearest atom to a gemmi.Point?
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes, first you get Cartesian coordinates corresponding to the point
pos = grid.point_to_position(point)
and then
ns.find_nearest_atom(pos)
I'm assuming here that you have a system with crystallographic symmetry. (I don't remember if it also works for non-crystallographic models.)
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you! This works in finding the nearest atom to a grid point. How does NeighbourhoodSearch deal with unmodeled density? From my trials it seems it will find a nearest atom for every grid point?
Beta Was this translation helpful? Give feedback.
All reactions
-
NeighborSearch doesn't deal with density. It finds atoms in a model. For more details see:
https://gemmi.readthedocs.io/en/latest/analysis.html#neighbor-search
Beta Was this translation helpful? Give feedback.