dsehnal / LiteMol

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

I have two pdb files locally. I want to implement two views superimposed together. #40

Closed ye1002551506 closed 5 years ago

ye1002551506 commented 5 years ago

How to use code to achieve?

dsehnal commented 5 years ago

There is an example for basic superposition: Transforms [ source | view live ]

However, the superposition algorithm only works on structures with the same or very similar sequence. If you want a proper superposition algorithm, you will have to get it from somewhere else. However, if you know the transformation that superposes the structures, you can just apply that.

ye1002551506 commented 5 years ago

First of all, thank you for your generous answer. I wish I could describe my problem in more detail in order to get more accurate advice.

I have two PDB files, but the source-url attribute in index. html allows only one file to be passed in. I want to achieve the effect can be generated in the http://webchemdev.ncbr.muni.cz/LiteMol/Viewer/ of the viewer, the viewer can be introduced into multiple PDB files, but I don't know how to use the code to achieve the effect?

  1. I have two PDB files. Can I achieve the desired effect by modifying the attributes of db-lite-mol in index. html ?

  2. If modifying index. html cannot achieve the desired effect, what is the easiest way to solve the problem?
    Thank you in advance @dsehnal

dsehnal commented 5 years ago

Yes, the angular wrapper does not seem to support multiple files at once.

But you should be able to replace that with the SimpleController [ source | view live ] quite easily.

You should be able to take the JavaScript code from here https://webchemdev.ncbr.muni.cz/LiteMol/Examples/SimpleController/LiteMol-example.js and simply call loadMolecule twice with different URLs and format: 'pdb'.

ye1002551506 commented 5 years ago

Thank you for your perfect answer, this has solved my problem perfectly, and I would like to express my heartfelt thanks and respect to you here. @dsehnal

dsehnal commented 5 years ago

You're welcome.