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

Enhancement: ContactTrajectory class (with movies!) #53

Open
dwhswenson opened this issue Apr 16, 2019 · 6 comments
Open

Enhancement: ContactTrajectory class (with movies!) #53

dwhswenson opened this issue Apr 16, 2019 · 6 comments
Milestone

Comments

@dwhswenson
Copy link
Owner

It might be nice to add a ContactTrajectory class. This would store a separate (single frame) contact map for each time slice. Then you could do interesting things like create a ContactFrequency based on a set of frames determined after the fact. You could also create movies of how the contact map evolves in time (these should be based on some windowing into ContactFrequency instances; the window can be 1 if the user wants).

Relevant matplotlib docs on animation:

Animations that could be generated in real time would be impressive, but I'd be just as happy with something that pre-generates the images and makes a movie out of them, like ArtistAnimation does.

Note that, to use a rolling window to generate the contact frequency plots for each movie frame, we already have add_contact_frequency and subtract_contact_frequency methods. These affect the absolute histogram count, unlike ContactDifference, which compares the after-normalization (to number of frames) contact frequencies. We'd still output a separate plot at each time step, but the underlying data would be cheaper to calculate.

@sroet
Copy link
Collaborator

sroet commented Apr 16, 2019

+1 for the idea.

We'd still output a separate plot at each time step, but the underlying data would be cheaper to calculate.

Which one do you expect to be cheaper, using the methods or the ContactDifference?

@dwhswenson
Copy link
Owner Author

Which one do you expect to be cheaper, using the methods or the ContactDifference?

Not sure what you mean here... these calculate different things.

If you have freq_1 where a given contact is present 20/25 frames (80%), and freq_2 where that contact is present 1/2 frames (50%), then ContactDifference(freq_1, freq_2) gives a result of 30% for that contact (80% - 50%). On the other hand, freq_1.subtract_contact_frequency(freq_2) results in a ContactFrequency where the contact is present in 19/23 frames (~83%). Of course, this only makes sense if you know that the trajectory that makes freq_2 is a subtrajectory of the one that made freq_1.

Those methods were designed specifically for doing this sort of windowing of a contact frequency, so those are the things to use.

@sroet
Copy link
Collaborator

sroet commented Apr 16, 2019

Those methods were designed specifically for doing this sort of windowing of a contact frequency, so those are the things to use.

Ah I understand now :) thanks for the explanation

@dwhswenson dwhswenson added this to the 1.0 milestone Jun 3, 2019
@dwhswenson dwhswenson mentioned this issue Aug 13, 2020
11 tasks
@sroet
Copy link
Collaborator

sroet commented Oct 23, 2020

@dwhswenson was there any issue left here after #81 ?

@dwhswenson
Copy link
Owner Author

#81 doesn't include movies, just the ContactTrajectory itself.

@sroet
Copy link
Collaborator

sroet commented Oct 23, 2020

Good to know, was just checking in on the current state of things

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

No branches or pull requests

2 participants