-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a geometry selection supporting selecting an zone shaped like a box #4323
Comments
@Cloudac7 could you provide a few usage examples here? PR #4324 outlines the general syntax. I'd be interested to see how one might use it in practice, e.g., corresponding to the different cases in your nice illustrations. E.g. To select all atoms in a box with length LX, LY, LZ, centered on center of mass of residue 42: u.select_atoms("box LX LY LZ (resid 42)" (That's probably not the correct syntax but you get the idea: description of what you are accomplishing and how a user would use your code.) |
OK. Let me give it a try. To select all atoms within a defined 3D box region relative to the center of geometry (COG) of a specified residue: Use the u.select_atoms("box <axes> <max> <min> <selection>") Where:
For example: To select all atoms between Zmax above and Zmin below the COG of residue 42 along z: u.select_atoms("box z Zmax Zmin (resid 42)") To select an 2D box around residue 114 from Xmin to Xmax on x and Ymin to Ymax on y: u.select_atoms("box xy Xmax Xmin Ymax Ymin (resid 114)") To select a 3D box around residue 514: u.select_atoms("box xyz Xmax Xmin Ymax Ymin Zmax Zmin (resid 514)") |
The selection syntax looks reasonable and fits the pattern established with cyzone:
I just want to confirm that in your case, |
Yes, exactly. |
This set of selections would have come in handy for something I had to do: cut out a system from a bigger system https://fhi-aims-club.gitlab.io/tutorials/fhi-aims-mdanalysis/2-periodic-sub-system/ |
I have encountered the same problem discussed in the original post. |
Is your feature request related to a problem?
I am now working on an system only z axis periodic, and I need to pick the atoms contained within certain distance in only z axis from a selected group. I tried to use
cyzone
to implement, but it could not include all atoms because of the shape of selection is a circle in xy plane and could not include all atoms in xy. And theprop
selection could not read a dynamic updating selction.Describe the solution you'd like
I would like to add a new geometry selection (named as
box
, for example), that could satisfy the requirement.It would create a zone from center of geometry of given selection to
x
,y
, orz
direction in a box.Describe alternatives you've considered
#4324
The text was updated successfully, but these errors were encountered: