Closed J-DuYa closed 3 years ago
The original file isn't saved anywhere. You can make a fetch /ajax request from your own code (which will, in practice, be fast as it hits the browser cache unless you do something to prevent that).
You can also do the fetch in your code and pass the file data in to ngl as a Blob (there's an example of this here https://github.com/nglviewer/ngl/blob/e8713514cfa7100a8313b3ff34a3c94b4125ced4/examples/parallel.html)
If I modify the molecular structure in the interface, can I get the modified file information
https://www.rcsb.org/3d-view/6V94?preset=ligandInteraction&sele=GNP
Is this page's download an internal method of NGL?
That link takes me to a molstar view? Are you actually modifying the structure? If so, you can download it as a PDB file. new NGL.PdbWriter(structure).getString()
.
That link takes me to a molstar view? Are you actually modifying the structure? If so, you can download it as a PDB file.
new NGL.PdbWriter(structure).getString()
.
This function can be downloaded, but it is not the same as what I expected. I will take a look at it then, thanks.
Then I can take the liberty to ask, can I get the file information after the change (delete operation) on the page? If there is no similar method, what is the reason?
Sorry, I think we're talking at cross purposes a bit :)
NGL doesn't currently have any way to: 1) Edit molecules in a general way and save the results
PdbWriter
you'll still have all the atomsvar s = stage.compList[0].structure; var ap = s.getAtomProxy(); ap.index=1; ap.x = 101.0
). Changes you make like this will appear in the PdbWriter
output (but the number of atoms in the molecule stays the same)
2) You load 3 molecules, setup representations, then remove a molecule and other representations and want to save a "view" (the current state of the stage).
stage.compList
, then for each component, note e.g. component.structure.path
, and component.getParameters()
, iterate through component.reprList
and record representation types plus repr.getParameters()
- then write a function that reads this data and applies the state to stage. This isn't totally reliable as components might be generated directly using e.g. the Shape
api, but for simple "load a moleclue from a file and apply representations" it'll work.
How can I get the content of my sample file through NGL