jmbuhr/quarto-molstar

opening molstar with different type

saurabhdea opened this issue · 9 comments

hey quarto is there any way to render Mol* with different type 3D representation for example gaussian surface as default not as cartoon. in your given code viewer.loadStructureFromUrl("./www/traj.xyz", "xyz")

jmbuhr commented

Yes, you can load it normally, make adjustments, save your view as a snapshot and then include that instead with https://jmbuhr.de/quarto-molstar/#snapshot-file

Thankyou jmbuhr

it there any possibility to show snapshot view in pdb file rather than MOLJ file. ?

jmbuhr commented

No, the file needs to contain the information about the representation and other molstar settings that you made when saving the snapshot. A pdb file only contains the structure and has no idea that molstar exists, so you can't save molstar settings to the pdb.

jmbuhr commented

unless I'm misunderstanding your question.

I think they are asking if you can have a different default style. The viewer can take some options for initialising, but I can'f for the life of me figure out what those potential options actually are:

loadPdb(pdb: string, options?: LoadStructureOptions) {

https://github.com/molstar/molstar/blob/14e6172c33b96fb03e49bbd29c750bf8f7c2224c/src/apps/viewer/app.ts#L251C9-L251C9

Mol* continues to have literally no documentation whatsoever which makes it really hard to develop for. If we can figure out what those potential options are, then we could include some basic options in the short code for initialising with some default styles etc

jmbuhr commented

That makes sense. Yes, It's a bit wild out there.

Yes, I am working on a project where I want to add pockets (cavities) by default to the gaussian surface, but I am unable to change the type of structure, as we can in JSMOL.

so if i am using this body

<body>
<div id="app-id" class="molstar-app"></div>
<script type="text/javascript">
molstar.Viewer.create("app-id", {"emdbProvider":"rcsb","layoutShowLeftPanel":true,"layoutShowRemoteState":false,"viewportShowAnimation":true,"pdbProvider":"rcsb","layoutShowSequence":false,"viewportShowSelectionMode":false,"layoutShowLog":false,"viewportShowExpand":true,"layoutShowControls":false,"layoutIsExpanded":false}).then(viewer => {
viewer.loadStructureFromUrl("./www/traj.xyz", "xyz")
});
</script>
</body>

how i can use
loadPdb(pdb: string, options?: LoadStructureOptions) {
for showing pdb file as gaussian surface ?