dsehnal / LiteMol

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

Set secondary structure #57

Open suyang-nju opened 5 years ago

suyang-nju commented 5 years ago

Is there a way to explicitly set/change secondary structures after loading a molecule?

dsehnal commented 5 years ago

It is possible, albeit a bit tricky.

Basically you would create a transform that maps Model -> Model and then create rest of the state tree same way as you would without applying the transform.

The transform would look similar to https://github.com/dsehnal/LiteMol/blob/85ec87c2698b6abeca8a18cf150f0341b8f2c6ea/src/lib/Bootstrap/Entity/Transformer/Molecule.ts#L274, but you would need to replace secondaryStructure property (https://github.com/dsehnal/LiteMol/blob/master/src/lib/Core/Structure/Molecule.ts#L473) in the data and secondaryStructureIndex in the residue table (https://github.com/dsehnal/LiteMol/blob/master/src/lib/Core/Structure/Molecule.ts#L350). This is how you would apply your new transform https://github.com/dsehnal/LiteMol/blob/master/examples/Transforms/src/Process.ts#L109.

Alternatively, you can use the new Mol* viewer (https://molstar.org ; basically a merge of LiteMol and NGL). and I would include an example for you how to do this. When do you need it?

suyang-nju commented 5 years ago

Not urgent. How does Mol compare to LiteMol in setting/changing the secondary structures? Much simpler? I use LiteMol to show structures and highlight (change color) regions of interest based on user input. Would switching to Mol fairly straightforward?

dsehnal commented 4 years ago

Well, currently the sec scruct modification is about the same amount of work as in LiteMol. But if we write the code I would rather do it for the new software.

How do you imagine the workflow for changing the secondary structure?

Mol* code is very similar to LiteMol as far as state management goes. Tho we are now working on simplifying that somewhat.

suyang-nju commented 4 years ago

User uploads a pdb/cif file. We display its amino acid sequence with secondary structure annotations and the 3D structure. Secondary structures are initially determined by DSSP or PyMol on the server after uploading the file. Ideally, the 3D structure showed would use this info. User then is able to change/set secondary structures using the sequence view, and the 3D view will automatically reflect those changes.

dsehnal commented 4 years ago

Ok, I will see what I can do.