nglviewer / ngl

WebGL protein viewer
http://nglviewer.org/ngl/
MIT License
664 stars 169 forks source link

Inquiry support drawing a path from one residue to another residue #946

Open juexinwang opened 1 year ago

juexinwang commented 1 year ago

Hi, I am interested in drawing a path from one residue to another residue in the protein structure (as this figure: https://www.nature.com/articles/s41467-022-29331-3/figures/3), can we do that using ngl? Thanks very much!

fredludlow commented 1 year ago

Late reply...

For making a one-off graphic, I suspect the simplest way would be to make a dummy molecule with atoms at those coordinates, explicit bonds (i.e. something like sdf/mol format) and a selection color scheme https://nglviewer.org/ngl/api/manual/usage/coloring.html#selection-based-coloring

Alternatively you can play with shapes: https://nglviewer.org/ngl/api/class/src/geometry/shape.js~Shape.html