-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
- Broken link https://twodanalysis.readthedocs.io/en/latest/installation, which is used in the installation directions in BioPolymer2D_Tutorial.ipynb.
- Error with wget package from conda setup:
ModuleNotFoundError: No module named 'wget', fixed by installing viapip install wget - interfacial, not interfatial above cell 11 in BioPolymer2D_Tutorial.ipynb
- Would be great to have a little more information related to PolarAnalysis in the doc string or the tutorial. I was left uncertain as to "what explicitly the angle each of the residues were plotting actually is?"
- Above cell 29 in BioPolymer2D_Tutorial.ipynb, change "more better" to just "better"
Suggestions:
- Would be easy to support 'x' and 'y' axis of surfaces in BioPolymer2D.PolarAnalysis method, with a simple transform of the output of the getPositions method. Just use a rotation matrix to rotate the axis to the z axis by 90 degrees.
import matplotlib.pyplot as plt
import numpy as np
points = [[1,0,0], [1,1,0], [1,1,1], [1,0,1]] # sample points
def rotate_around_y(points):
"""Assumes -90 degree rotation about y axis -> rotate x onto z.
Full 3D rotation matrix, where theta is the rotation amount.
np.array([
[1, 0, 0],
[0, cos(theta), -sin(theta)],
[0, sin(theta), cos(theta)]
])
"""
com = np.mean(points, axis=0)
rotation_matrix = np.array([[0,0,-1], [0,1,0], [1,0,0]])
points = np.array(points) - com
return (rotation_matrix @ points.T).T + com
x,y,z = rotate_around_y(points).T
# Create a figure and add a 3D subplot
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x0,y0,z0 = np.array(points).T
# Plot the 3D points using ax.scatter()
ax.scatter(x, y, z, c='r', marker='o') # 'c' for color, 'marker' for point style
ax.scatter(x0,y0,z0, c='g', marker='o') # 'c' for color, 'marker' for point style
# Set labels for the axes
ax.set_xlabel('X-axis')
ax.set_ylabel('Y-axis')
ax.set_zlabel('Z-axis')
# Set a title for the plot
ax.set_title('3D Scatter Plot of Points')
# Display the plot
plt.show()- It might be nice to have some suggestions about how to setup a .gro/.top file for ease of use in this software. Maybe a little blurb in the readme, such as residue numbering, selection by molecule, selection by .ndx file, etc.
- There's lot's of print statements in the program, which is nice, but not all of the output is labeled fully. Especially lots of numpy arrays with the shape that's printed, could use some details as to which each of those dimensions corresponds to. Might be worth looking into the class method __repr__.
Otherwise this is running great! I'll give the Membrane example a run through as well, and try to see if I can get the code running on a few of my non-protein surface trajectories to see how it handles something a little different. Overall, I'm excited to try to use some of these analysis methods in my own work! Thanks @ABoschF , @govarguz, and @ricard1997
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels