Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opening molstar with different type #13

Open
saurabhdea opened this issue Aug 17, 2023 · 9 comments
Open

opening molstar with different type #13

saurabhdea opened this issue Aug 17, 2023 · 9 comments

Comments

@saurabhdea
Copy link

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
Copy link
Owner

jmbuhr commented Aug 17, 2023

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

@jmbuhr jmbuhr closed this as completed Aug 17, 2023
@saurabhdea
Copy link
Author

Thankyou jmbuhr

@saurabhdea
Copy link
Author

saurabhdea commented Aug 18, 2023

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

@jmbuhr
Copy link
Owner

jmbuhr commented Aug 18, 2023

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
Copy link
Owner

jmbuhr commented Aug 18, 2023

unless I'm misunderstanding your question.

@BradyAJohnston
Copy link
Contributor

BradyAJohnston commented Aug 18, 2023

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
Copy link
Owner

jmbuhr commented Aug 18, 2023

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

@jmbuhr jmbuhr reopened this Aug 18, 2023
@saurabhdea
Copy link
Author

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.

@saurabhdea
Copy link
Author

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants