nglview icon indicating copy to clipboard operation
nglview copied to clipboard

Problems visualzing resnumbers greater than 9999

Open davidRFB opened this issue 3 years ago • 6 comments

  • Question about usage? Please search your issue here first: https://github.com/arose/nglview/issues/589 and https://github.com/arose/nglview/issues/785

  • Version report

python -c 'import nglview; print(nglview.__version__)'
3.0.1
python -c 'import ipywidgets; print(ipywidgets.__version__)'
7.6.4

Hi ! I am using nglview with show_pytraj(). However I have a problem visualizing water close to a residue because, some water residue number are greater than 9999. And therefore I do not see these waters. Here is an example image

I do not know if there is a problem with the topology with pytraj or maybe the visualizer.

Thank you for your time ! What an amazing proyect !

davidRFB avatar Sep 03 '21 20:09 davidRFB

I do not know if there is a problem with the topology with pytraj or maybe the visualizer.

hi @davidRFB:

Can you please save one frame to .pdb format and try again with

view = nv.show_file("your.pdb")
view
[...]

to see if that's an issue with pytraj or nglview? Cheers.

hainm avatar Sep 06 '21 03:09 hainm

Hi @hainm ! Thanks for your answer.

Here is the code with nglview and the pdb. image

The water number 1065 appears twice. I guess because also represent the water 1065X.

davidRFB avatar Sep 06 '21 23:09 davidRFB

So I guess it's the issue with pytraj of how pytraj save the pdb file. Let me investigate (although I don't promise a time frame for that). Cheers and thanks.

hainm avatar Sep 07 '21 02:09 hainm

Thank you very much ! Please, let me know if I can help with something.

davidRFB avatar Sep 07 '21 21:09 davidRFB

The issue is with not pytraj. I had the same problem with mdtraj or reading PDB directly. The problem with large structures is that residue number is becoming to big, so there is not enough field characters to hold it in PDB file in proper place. As a result the x,y,z values get shifted and NGLview (VMD has the same issue actually) can not read it. For me the trick around was to renumber residue numbers so they fit to 23-30 position @ATOM section and vois là, everything worked just fine. For me new numbers were not needed for further analysis. But if this information is important (e.g. for further analysis of proteins), it is probably better to split protein in shorter chains and restart resnumbers each time. And "re-map" back to original numbering when needed.

juliasubbotina avatar Aug 10 '22 11:08 juliasubbotina

Thank you very much for your comment.

Hai

On Wed, Aug 10, 2022 at 7:51 AM juliasubbotina @.***> wrote:

The issue is with not pytraj. I had the same problem with mdtraj or reading PDB directly. The problem with large structures is that residue number is becoming to big, so there is not enough field characters to hold it in PDB file in proper place https://zhanggroup.org/SSIPe/pdb_atom_format.html. As a result the x,y,z values get shifted and NGLview (VMD has the same issue actually) can not read it. For me the trick around was to renumber residue numbers (it wasn't a big thing for my situation) and vois là. Everything worked just fine.

— Reply to this email directly, view it on GitHub https://github.com/nglviewer/nglview/issues/993#issuecomment-1210565936, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABB645N6B5KD5RTVCSVU6B3VYOJS7ANCNFSM5DMOE5JA . You are receiving this because you were mentioned.Message ID: @.***>

hainm avatar Aug 10 '22 14:08 hainm