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

Feature: AtomGroupGroup #1861

Open
richardjgowers opened this issue Apr 10, 2018 · 19 comments
Open

Feature: AtomGroupGroup #1861

richardjgowers opened this issue Apr 10, 2018 · 19 comments

Comments

@richardjgowers
Copy link
Member

So this is kind of inspired by https://groups.google.com/forum/#!topic/mdnalysis-discussion/eqegNLWvHAY and also some other work I did on coarse-graining before.

Wouldn't it be cool if we could do something like:

from MDAnalysis.coarsegraining import Bead / SuperGroup / ÜberGroup (fur ze deutsch)

ags = u.atoms[:4], u.atoms[4:8], u.atoms[8:12]

ug = ÜberGroup(ags)

# Then properties of the ug are averages* of the subgroups
ug.positions == [ag.center_of_mass() for ag in ags]
ug.charges == [np.mean(ag.charges) for ag in ags]
ug.masses == [np.sum(ag.masses) for ag in ags]

This is useful for coarsegraining, but also for dealing with concepts like aromatic rings. This would also let us move further towards using AtomGroups more, as ÜberGroup would subclass from it and would mimic all possible attributes.

Thoughts? (ping @jbarnoud @mnmelo)

@jbarnoud
Copy link
Contributor

I have seen at least two shots given at the issue, one of them being from you if I well remember. They were dealing with CG universes, though. I am obviously in favour of anything that would make my life of coarse-grainer (is it a thing? it should!) easier; so I am in favour of this. But I think having the coarse-graining done by a reader is better: indeed, it allows to use transparently everything we already have in place.

How we build the CG reader is an other question. It could very be:

from MDAnalysis.coarsegraining import ÜberReader, ÜberParser

ags = u.atoms[:4], u.atoms[4:8], u.atoms[8:12]
ucg = mda.Universe(ÜberParser(ags), ÜberReader(ags))

@richardjgowers
Copy link
Member Author

It'd be definitely cool to resurrect CGUniverse, that was pre-new-topology system!

I think there's also issues like #1053 where you want to treat groups of atoms as single sites, but not in a CG way, or you don't want to construct an entire Universe for that. I'm dealing with a lot of phenyl rings lately and it's annoying to drop the object based approach and end up with arrays of ring centers, arrays of other properties etc.

@orbeckst
Copy link
Member

orbeckst commented Apr 11, 2018

When I read the email I also thought of BlobGroup.

In principle the new topology system allows this at the AtomGroup level: create a new attribute (blobid) and assign the blobids as you wish, the ag.groupby("blobid") to get your AtomGroups for the blobs.

EDIT: ... of course it does not do the automated averaging.

@orbeckst
Copy link
Member

orbeckst commented Apr 11, 2018

... and ja, die ÜberGruppe zounds wery nice.

@richardjgowers
Copy link
Member Author

@orbeckst I was mostly joking about ÜberGroup, then I warmed to it after I couldn't think of anything better, now I realise it's confusing because of the Uber app :(. Maybe BeadGroup.

Having it as an attribute is a cool idea but it would mean that each Atom could only be in a single Bead, or you'd need a new dummy attribute for each different Bead representation layer you added. It's an interesting idea!

@orbeckst
Copy link
Member

I don't mind claiming "Uber" – it's been used in American English before the ride sharing company. I would probably still choose a more boring and descriptive name but I think whoever implements it gets to choose ;-).

@richardjgowers
Copy link
Member Author

Just another thought, it would be cool if an AtomGroup had a to_BeadGroup method. So then when you had a collection of AGs, ag.to_BeadGroup lets you treat many atoms as a single entity, sum(ag.to_BeadGroup for ag in my_ags) would give you the array of Beads

@orbeckst
Copy link
Member

It might be useful to work out an API proposal (sort of an "MDAnalysis Extra Enhancement Proposal" or MEEP for short...) that gives an idea of what the API would look like and what it would enable.

There's also the old issue on coarse grained FF awareness #507 that would make MDA more useable for the CG community.

@Shlokatadistance
Copy link

I think we can implement the data structures for the centres of mass and the atoms in a more systematic way, cause there are plenty of issues which arise from concatenations in python. but I also think that this can be implemented fairly well in the pre-existing structure.
(P.S I look forward to working on the same for GSoc2020)

@orbeckst
Copy link
Member

@Shlokatadistance , you might want to look deeper in how MDAnalysis represents systems, namely as numpy arrays of integers, where the integer is the id of the particle. The 2016 paper also explains a little bit more. (And if you really want to learn more, look at issue #363 and the blog post A shiny, new and faster topology system.)

@richardjgowers
Copy link
Member Author

@danonymous856
Copy link

how to get started with the project as a newbie? @anyone

@danonymous856
Copy link

Yeah1 Also what abt this one . from where do I collect worthy info to contribute at this part specifically only.

@orbeckst
Copy link
Member

Hello @danonymous856 , welcome to MDAnalysis. I suggest you introduce yourself first on the developer mailing list and let us know what you‘re interested in (GSoC or Outreachy or generally contributing); also include your GitHub username in the intro email. We can then point you in the right directions.

This specific issue is not well suited for a new contribution as it overlaps with a GSoC project.

@danonymous856
Copy link

Sure thing

@orbeckst
Copy link
Member

orbeckst commented Apr 2, 2024

@bintang-aswam according to https://www.mdanalysis.org/2024/02/27/gsoc2024 you need to have an approved pre-proposal to submit a full proposal. If you don't have that, then it's too late to apply for working with MDAnalysis, sorry.

@bintang-aswam
Copy link

@orbeckst, could I contribute to pull-requests alongside open project (if any) outside of GSoC program?

@orbeckst
Copy link
Member

orbeckst commented Jun 4, 2024

You and anybody else are more than welcome to contribute to MDAnalysis. It's an open source project and we value all contributions from the community. I'd generally suggest to engage in conversations in Discord or our Discussion forums, especially if they are more general or open ended. If there's a specific issue you are looking into, communicate on the issue.

@bintang-aswam
Copy link

To be honest, I want to focus on advancing the recent MDAnalysis solver @orbeckst.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants