Protein Data Bank Sanity Plugin
This is a plugin which adds an object type protein
to your Sanity schema, and provides a custom input component to let you select a PDB protein model in a predefined list and adjust the starting camera position and zoom.
Not familiar with Sanity? Visit www.sanity.io
Quick start
- While in your project folder, run
sanity install pdb-input
. Read more about using plugins in Sanity here.
Usage
Use it in your schema types:
// [...] fields: // [...] name: "proteinModel" title: "A PDB 3d model" type: "protein" ;
Note that the above only works if you import and use the all:part:@sanity/base/schema-type
part in your schema. This is the most common way. If you are not importing the base types in this manner, you may import the schemas/pdb.js
and schemas/pdbCamera.js
and include them in your schema manually.
Read more about schemas in Sanity here.
Data model example
"_type": "protein" "camera": "rotation": 04790152907371521 -08654894232749939 -014653077721595764 0 -014660295844078064 -024346202611923218 0958766520023346 0 -08654779195785522 -043778201937675476 -024350611865520477 0 0 0 0 1 "center": -15685999870300293 2224799919128418 -6605999946594238 "zoom": 365915087377568 "pdb": "4HHB"
Displaying the PDB models in your web frontend
This plugin uses bio-pv node module to let the editor manipulate the camera settings. You may use the same library for displaying interactive PDB models in your web frontend. You can find it here