nglviewer / nglview

Jupyter widget to interactively view molecular structures and trajectories
http://nglviewer.org/nglview/latest/
Other
825 stars 133 forks source link

Usage questions about nglview: Please ask here first [4] #1000

Closed hainm closed 3 years ago

hainm commented 3 years ago

For any questions relating to how/why/ ... Or anything you don't know where to ask. For bug, suggestion or anything you want to ask separately, please open separate issue

Previous Q&As

Or click the Q&A label.

annalisasnow commented 3 years ago

Is it possible to use the nglview without Jupyter Notebooks? I would like to use it as pure python, maybe within the autogenerated windows, somewhat like tkinter.

hainm commented 3 years ago

Hi, it’s not possible. The web browser is required to render.

shalkya commented 3 years ago

You can render it in a IDE like vscode, that can handle jupyter notebooks, if that's of any help.

How can I remove a representation ? Here I would like to keep only the cartoon representation: image

The small molecule don't render, when I try to display it along with the protein: image

even if it does render well by showing it alone: image

edit: in the end I could achieve to do what I wanted this way:

w = nv.show_mdanalysis(mobile)
w.add_representation('cartoon')
w.remove_backbone()
w.add_ball_and_stick('SUC')
hainm commented 3 years ago

hi @shalkya

How can I remove a representation

view.remove_cartoon(component=0)
view[0].remove_cartoon()

and so on.

RichardJActon commented 3 years ago

Have you considered switching these Q&A issues over to github's new(ish) discussion section - it's better suited to this type of exchange than the issue system. https://docs.github.com/en/discussions/quickstart

hainm commented 3 years ago

Have you considered switching these Q&A issues over to github's new(ish) discussion section - it's better suited to this type of exchange than the issue system. https://docs.github.com/en/discussions/quickstart

Sounds good. I will ping @arose to turn the feature on. Thanks.

hainm commented 3 years ago

Please see new thread: https://github.com/nglviewer/nglview/discussions/1002

mkg12 commented 3 years ago

Hi, is there anyway to automatically have nglview start running inside jupyter notebook? This is without having to press the run button.

hainm commented 3 years ago

Hi, I don’t know about this. It’s more about bow to run a notebook automatically.

On Fri, Nov 12, 2021 at 5:23 PM mkg12 @.***> wrote:

Hi, is there anyway to automatically have nglview start running inside jupyter notebook? This is without having to press the run button.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/nglviewer/nglview/issues/1000#issuecomment-967699945, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABB645IMUZKWNTZIVJ34NHDULWHVRANCNFSM5FL6K7LA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

juliasubbotina commented 2 years ago

Hello,--

I wonder if there is any way to add the new atom type to the NGLView through the script, without touching the constants section in the main code?

I am creating a set of XYZ coordinates for coarse-grained beads with changing bead names/types and bead radii in the loop which I save as PDB or GRO (by using mdtraj or something) and then I need to visualize them with the NGLView.

My guess, is I need to update/add "const VdwRadii = " or "const ResidueRadii = " and probably some constants related to atom/residue names. Maybe something like this, but adding the actual atom to the topology, not the shape. However, I am not 100% sure what would be the safest/correct way to do so.

Any suggestions are welcome.

Thank you.

hainm commented 2 years ago

hi @juliasubbotina: I don't know the answer. Cheers.

Message ID: @.***>

Sucerquia commented 1 year ago

Hello,

how can I add a component only in one frame of a trajectory?

BTW, thanks for this useful tool!

hainm commented 1 year ago

Hi, nglview does not support this. Please reconstruct the trajectory having your component.

Hai

On Thu, Dec 15, 2022 at 5:43 AM Sucerquia @.***> wrote:

Hello,

how can I add a component only in one frame of a trajectory?

BTW, thanks for this useful tool!

— Reply to this email directly, view it on GitHub https://github.com/nglviewer/nglview/issues/1000#issuecomment-1352875244, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABB645LCYGRZB3SX2E3D77DWNLY5LANCNFSM5FL6K7LA . You are receiving this because you modified the open/close state.Message ID: @.***>