RosettaCommons / pyrosetta_viewer3d

Display PackedPose objects, Pose objects, or PDB files within a Jupyter notebook and Google Colab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

demo notebook in PyRosetta.notebooks

lyskov opened this issue · comments

Hi Jason! I just noticed that py3Dmol can now used in Colab notebook (example code below) and it works! Would it be possible to add add recommended workflow into (new?) PyRosetta.notebooks notebook?
Thanks,

import pyrosetta;
import pyrosetta.distributed.io as io
import py3Dmol

pyrosetta.init()
pose = pyrosetta.pose_from_sequence('TESTTHISEPICLIFE')

view = py3Dmol.view(width=500, height=500)
view.addModel(io.to_pdbstring(pose),'pdb')
view.setStyle({'model': 0}, {"cartoon": {'color': 'red'}})
view.addStyle({'model': 0}, {"stick": True})
view.zoomTo()
view.show()

Hi @lyskov , thanks! The viewer3d package should already work in Colab notebooks (see here). This is good to know since perhaps the interface has changed. Yes, I'd like to add Jupyter notebook examples herein (see #19). I think the PyRosetta.notebooks repo would be a great place, especially since it could be good to add them to the testing sever. One consideration is that the viewer3d package requires additional dependencies (see here), at minimum py3Dmol, but Jupyter notebooks would also contain nglview and pymol examples.