Visualizing structures sent over gRPC
See original GitHub issueHi all, in NGL I had written some code which allowed me to send over gRPC a PDB string blob and visualize it in the viewer like this:
var stringBlob = new Blob([call.request.structure], { type: 'text/plain' });
stage.loadFile(stringBlob, {
ext: "pdb",
name: call.request.name
}).then(function (structureComponent) {
var reqdata = call.request
if (reqdata.repr_type) {
if (reqdata.repr_selection) {
structureComponent.addRepresentation(reqdata.repr_type, { sele: reqdata.repr_selection })
} else {
structureComponent.addRepresentation(reqdata.repr_type)
}
} else {
stage.defaultFileRepresentation(structureComponent)
}
if (reqdata.traj && (reqdata.traj.length != 0)) {
frames = trajToFrames(call.request.traj);
structureComponent.addTrajectory(frames);
}
})
I am however unable to find an equivalent for loading a structure from a PDB blob (and trajectory from an array).
What would be the correct way to do this in Mol*?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Visualizing gRPC Language Stacks
Each structure is slightly different based on the needs of each language implementation of gRPC.
Read more >Reconstructing and Visualizing Distributed Traces from Log ...
Remote procedure calls (RPCs) are a foundational building block for distributed systems. RPC libraries allow developers to write a language-agnostic de-.
Read more >Should you consider using gRPC in your data science ...
I would say a definite yes for the question in title, if you have to send large datasets across your micro services, AND...
Read more >How to build a REST API with gRPC and get the best of two ...
Build a gRPC Service with REST support from an OpenAPI description. ... All the data structures that were generated previously are used within...
Read more >gRPC overview | API Gateway Documentation - Google Cloud
By default, gRPC uses protocol buffers as the Interface Definition Language (IDL) for describing both the service interface and the structure of the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Having build-in trajectory streaming support is currently on top of my todo list so in the coming weeks both your tasks should be made easier.
If you need it now, here are some pointers:
@stefdoerr
PluginStateObject.Molecule.Model
PDB structure to the state tree.PluginStateObject.Molecule.Topology
from your data. (here’s an example https://github.com/molstar/molstar/blob/490c6679eb7cbcec230b3b0e2fc589262eed6833/src/mol-plugin-state/transforms/model.ts#L105)AddTrajectory
state action (https://github.com/molstar/molstar/blob/482059cc9b1d0777d90cdde7d8b8fb0a94edbacc/src/mol-plugin-state/actions/structure.ts) to merge the 2 objects from the above steps.@pschmidtke
getFrameAtIndex
will do the query or use cached data.Trajectory
implementation. (example https://github.com/molstar/molstar/blob/490c6679eb7cbcec230b3b0e2fc589262eed6833/src/mol-plugin-state/transforms/model.ts#L130)https://github.com/Acellera/molkitstar link to the electron application for future reference if anyone is interested in it