MDAnalysis / membrane-curvature

MDAnalysis tool to calculate membrane curvature.
https://membrane-curvature.readthedocs.io/
GNU General Public License v3.0
29 stars 6 forks source link

Added ipynb tutorial - membrane-protein. #69

Closed ojeda-e closed 2 years ago

ojeda-e commented 3 years ago

This PR fixes #68

Changes include:

review-notebook-app[bot] commented 3 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

codecov[bot] commented 3 years ago

Codecov Report

Merging #69 (2ee6898) into main (4bb851e) will not change coverage. The diff coverage is n/a.

ojeda-e commented 3 years ago

Here is the second tutorial ready for review @orbeckst, @lilyminium. Apologies for the delay.

I have a question regarding the reference edit: of the NhaA Dataset. I'm printing the reference with print(NhaA.DESCR). I am not sure that's enough, though. Would you please suggest to me the best way to add the reference here? I considered two options. a) Add a last section in the notebook with the reference. b) Add it at the beginning of the document where I give the short description of the simulation.

Thanks!

orbeckst commented 3 years ago

I probably won't get to it before the end of the week. Please ping me again if you haven't heard from me by Friday. Thanks.

review-notebook-app[bot] commented 3 years ago

View / edit / reply to this conversation on ReviewNB

lilyminium commented on 2021-08-31T17:54:08Z ----------------------------------------------------------------

I haven't seen more_itertools before -- looks very interesting! However, I think you may be able to save this dependency by using numpy:

membrane_indexes[j] = np.split(lfs[n], np.where(np.ediff1d(lfs[n].residues.resids) > 1)[0] + 1)

It would also be easier to understand your code if you used more descriptive variable names. i and j, for example, are typically reserved for index integers in code. Here, though, they stand for an array and the leaflet name ("Upper"/"Lower") -- and you don't actually use i. Personally I'd not use n but instead rewrite the loop as for leaflet_indices, leaflet_name in zip(lfs, leaflets).


ojeda-e commented on 2021-09-02T06:21:53Z ----------------------------------------------------------------

Thanks for this. I changed the name of the variables and used an approach following your suggestion. I didn't know about np.ediff1d, thanks!