This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Visualization of protein structure in R (Shiny)

Hi All!

I am creating a Shiny server and would like to show the user protein structures from PDB file. I tried to search for a package that is able to do that, but could not find one. bio3d can write the output to open by pymol and Rpdb have a visualization, but unfortunately it is not very good....

Is there any package or workaround that I am not aware of? Or any workaround if cannot be done by a package?

Thank you!

r rshiny pdb protein structure visualization

Don't know much about Shiny, but as its web based, can you make use of JSmol/Jmol or something?

Thanks, I will look into it!

PV is great for this, but it's JS not R

Actually if you make use of ShinyJS you can integrate any JavaScript library quite easily in your shiny application. I don't know how the 3D animation will integrate with shiny objects though, but it is worth a try

Thank you both, I hoped to avoid messing around with JS, but these seem good.

Are you hoping to display a dynamic structure or just a static one? If it's the latter, you could perhaps simply fetch an image of the protein from PDB and display that directly?

Thank you for the answer. I have custom PDB files, I cannot just fetch unfortunately

2 answers

I recently released the NGLVieweR package which is a htmlwidget for the NGL.js JavaScript library. It can be used to visualize and interact with protein data bank files (PDB) in R and Shiny applications. It includes a set of API functions to manipulate the viewer after creation and makes it possible to retrieve data from the visualization into R. You can find the documentation here.

Click here to view a Shiny application integrating most features of NGLVieweR

Hello :)

I tried use NGLVieweR into a shiny app but i failed.

I've a doubt: in my shiny script, user must enter with pdb file as input. How i can read and view protein structure with NGLVieweR? I only managed to use it by reading a local file or putting a pdb code. Please, help me :)

xoxo

Hello there! If you are still looking for an implementation for this, myself and another are developing the package {r3dmol} which has support for exactly this. Checkout the documentation here and let us know any feedback if you have particular questions or requests for features :)

Log in to answer this question.