marrink-lab / MDVoxelSegmentation

A voxel based approach for dynamic cluster analysis of molecular dynamics trajectories.
Other
23 stars 11 forks source link

Counting flip-flops in stacked bilayer #121

Closed shakhawath closed 2 years ago

shakhawath commented 2 years ago

Dear Bart,

First of all, thank you very much for developing such a nice tool. It will be useful for many different applications. I am currently trying to calculate the number of flip-flop events in a stacked bilayer system. However, how exactly to extract that data is not quite clear to me. I also want to generate a figure like Figure 3D in the article. I can see the sample python script which reads the file 'clusters.npy' and plot the number of segments. It would be great to know how exactly we can extract the flip-flop data from this file. Please also let me know if I need to generate some other file to collect the data. Thanks in advance for your help.

Shakhawath Hossain, Uppsala University.

BartBruininks commented 2 years ago

Dear Shakhawath,

The general idea of a flip, is that you are in one leaflet in one frame and in another in the other. Meaning a lipid residue would be assigned to a certain segment, which would then change. The clusters.npy contains the segment ID for each atom in each frame (in order), thus we could extract such data. However, keep in mind that a lipid might not be assigned to a segment at all if it is ambiguous (force-segmentation can help, but it is never 100% guaranteed).

If you need further help, please let me know. I wouldn't mind making a jupyter notebook, example, but if you have it working there is no need :)

Cheers,

Bart

shakhawath commented 2 years ago

Dear Bart,

Thank you very much for your quick reply. I dont have it working now. It will definitely help if you could make a notebook or add a few line of example on how to extract the segment id for each atom in each frame. I understood the ambiguity that the lipids (specially cholesterol) might not be assigned to a particular segment and I also understood the force segmentation part. Thanks for your help.

Regards, Shakhawath.

BartBruininks commented 2 years ago

I added a worked example to the github, you can find it at 'mdvoxelsegmentation/templates/lipid_flip-flop.ipynb'. There is also a rendered HTML for viewing the code in the browser at 'mdvoxelsegmentation/templates/lipid_flip-flop.html'. For now this is not in the pip distribution but I hope this gets you on your way. The end result is a plot which looks like this: flip-flop

BartBruininks commented 2 years ago

Basic residue segment fetching has been added as a code example in the readme as well.

shakhawath commented 2 years ago

Thank you very much for such quick response on this. Everything is quite clear now.

BartBruininks commented 2 years ago

Good to hear, if you have it working please post an image here. I'd love to see what you used it for! Anyway, you can close the topic once you have it working, and if you need additional help let me know.

shakhawath commented 2 years ago

Here is an image that is showing cholesterol flip-flops from a 3 micro seconds simulation. Thanks. /Shakhawath Figure_1