Skip to content
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

feat: add RelPropertySelection to select atoms based on positions relative to a given selection #4838

Open
ChiahsinChu opened this issue Dec 16, 2024 · 5 comments · May be fixed by #4841
Open
Labels
Component-Selections decision needed requires input from developers before moving further enhancement

Comments

@ChiahsinChu
Copy link
Contributor

Is your feature request related to a problem?

When investigating the solid/liquid interface, I would like to take the outermost solid atoms as the reference and analyse the liquid close to the surface (e.g., <= 5 angstroms away from the surface in the direction perpendicular to the surface). However, the reference might shifts during the simulation, and I would like to find a selection updated on-the-fly.

Describe the solution you'd like

I'd like to add a new selection class RelPropertySelection, which can be used in the following way:
relprop [abs] property operator value selection
For example, if I want to choose the water with the z distances to the surface smaller than 3 ang, I can use:
relprop z < 3.0 surface
where surface is the selection of the outermost surface atoms.

@orbeckst
Copy link
Member

Sounds like an interesting selection operator.

Do other tools provide similar functionality?

@ChiahsinChu
Copy link
Contributor Author

As far as I know, no. I have implemented this feature (though in v2.3.0) in my own mda fork. The implementation is simple, and it should not influence the functionality of other modules in the selection.

@orbeckst
Copy link
Member

If you already have an implementation then please feel free to put up a PR. It's easier to discuss concrete code than code in the abstract.

@ChiahsinChu ChiahsinChu linked a pull request Dec 18, 2024 that will close this issue
5 tasks
@orbeckst
Copy link
Member

@MDAnalysis/coredevs what do you think about adding a relprop selection operator to the selection language?

You can just 👍 or 👎 this comment (and of course add any comments of your own).

@orbeckst orbeckst linked a pull request Dec 19, 2024 that will close this issue
5 tasks
@RMeli
Copy link
Member

RMeli commented Dec 19, 2024

It could be useful, so why not. However, relprop doesn't say anything to me; is this a standard name? If not, can we thing of something more explicit?

@orbeckst orbeckst added the decision needed requires input from developers before moving further label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component-Selections decision needed requires input from developers before moving further enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants