dsehnal / LiteMol

A library/plugin for handling 3D structural molecular data (not only) in the browser.
Other
157 stars 38 forks source link

Can LiteMol load a molecule from a file instead that from a url? #61

Closed mb925 closed 4 years ago

mb925 commented 4 years ago

I am using the following function to load a molecule: await this.ltplugin.loadMolecule({ id: ids, url: this.url, format: 'cif', modelRef: 'model', doNotCreateVisual: true });

Can I upload a PDB chain from a local file instead that from a url? Thank you.

dsehnal commented 4 years ago

Alternatively, if you mean that you already have the string with the file, you can also do that. Just use { ..., data: ..., ...} instead of the url param. And change the format to pdb if it's a PDB file.

mb925 commented 4 years ago

Thank you for your help. We will host the files as suggested in your answer.

In order to speed the loading of molecules, does LiteMol support compressed files and/or MMTF format?

dsehnal commented 4 years ago

Well, if this is a new integration, I recommend you use Mol* (https://molstar.org/) which is successor to both LiteMol and NGL.

LiteMol and Mol* support BinaryCIF (publication is coming out soon) which superseeds MMTF and is available at both RCSB and PDBe.