# install.packages("r3dmol")
::m_glimpse('4ozs') |>
r3dmol::m_spin() r3dmol
Visualising Proteins
Recently I’ve been doing a lot of structural bioinformatics. To avoid having to export my results into PyMol of Chimerax, I wanted a better solution that could embed the results more easily into the report that I was writing.
What would be even better than just an image of the final result is a fully interactive 3D model of the protein I was analysing at the time. Packages to achieve a similar sort of impact were already available in the form of 3Dmol.js, but it wasn’t easy to embed or create through the R interface.
I now humbly present, an (early) version of {r3dmol}!
Play around with the widget below, which can be generated in just a couple of lines of code, and embedded in an rmarkdown
document or in the RStudio viewer pane.
Check the Twitter thread for more details, but now while still in the Rstudio IDE, you can create molecular visualisations to quickly preview your work, but more importantly, you can seamlessly embed them into Rmarkdown HTML reports for sharing with colleagues or blogging online.
Hey! I helped make an open source package!
— Brady Johnston (@bradyajohnston) February 4, 2021
If you do any kind of structural bioinformatics in R, or even if you just want to embed pdbs easily into a blogdown post, you can do so with the {r3dmol} (originally by @swsoyee): https://t.co/s9De6kuVpT #rstats pic.twitter.com/LA9rjJIaKV