jertubiana / ScanNet

Apache License 2.0
115 stars 28 forks source link

Can't Visualize filters with "Visualize spatio-chemical filters.ipynb" #10

Open L40S38 opened 5 months ago

L40S38 commented 5 months ago

On Windows (WSL Ubuntu20.04), constructed environment with conda and run pip install -r requirements.txt, still I stucked some bug relevant to pythreejs.

When I run the 3rd cell from the top, I encountered ValueError like below and visualize non-three-dimensional image (maybe only showed the flag of atom or acids).

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-3-c7d86697239f> in <module>
----> 1 renderer = show_3d_filters.plot_aminoacid_filter(filter_specificities,117,sg=sg);
      2 display(renderer)

c:\...\ScanNet\visualizations\show_3d_filters.py in plot_aminoacid_filter(filter_specificities, index, show_asa, show_ss, show_negative, threshold1, scale, list_additional_objects, sg, camera_position)
    467                                           camera_position=camera_position,
    468                                           key_light_position=[0.5, 1, 0],
--> 469                                           maxi=12,dpi=600,crop=False)
    470 
    471 

C:\...\ScanNet\visualizations\weight_logo_3d.py in show_ellipsoids(list_ellipsoids, list_colors, list_figures, list_texts, list_segments, list_additional_objects, level, sg, wireframe, show_frame, fs, scale, offset, camera_position, key_light_position, opacity, maxi, xlims, ylims, zlims, download, crop, render, tmp_folder, dpi)
    556         lam, U = np.linalg.eigh(inertia)
    557         sqrt_inertia = np.dot(U, np.sqrt(lam)[:, np.newaxis] * U.T)
--> 558         ellipsoids_V = level * np.dot(sphere_V, sqrt_inertia)
    559         ellipsoids_V = ellipsoids_V.tolist()
    560         sphereG = pythreejs.Geometry(vertices=ellipsoids_V, faces=sphere_F)

<__array_function__ internals> in dot(*args, **kwargs)

ValueError: shapes (0,) and (3,3) not aligned: 0 (dim 0) != 3 (dim 0)

output

Please tell me how to fix the bug.

L40S38 commented 5 months ago

I attempted a further challenge to get this code working.

sg = weight_logo_3d.make_sphere_geometry(30)

After running this code again after the error, I no longer get the above error, but the image is not rendered except in the "Visualize atomic neighborhood" cell.

jertubiana commented 5 months ago

Hi,

Try: 1) Resetting the notebook. 2) Running separately the first cell with make_sphere_geometry 3) Then run the others (do not use run all).

Let me know, Jerome

On 20 May 2024, at 8:26, L40S38 @.***> wrote:

I attempted a further challenge to get this code working.

sg = weight_logo_3d.make_sphere_geometry(30)

After running this code again after the error, I no longer get the above error, but the image is not rendered except in the "Visualize atomic neighborhood" cell.

— Reply to this email directly, view it on GitHub https://github.com/jertubiana/ScanNet/issues/10#issuecomment-2119693784, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACHSPJQE4QXRVYDGHOIQLZDZDGCRFAVCNFSM6AAAAABHK224VWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJZGY4TGNZYGQ. You are receiving this because you are subscribed to this thread.

L40S38 commented 4 months ago

I installed pythreejs extention to jupyter, I can visualize on jupyter notebook, but can't on jupyter-lab.

I have no idea why failing on jupyter-lab, but I could visualize the all filter, so I'm going to use jupyter notebook from now on.

Thank you for your advice.