molstar / molstar

A comprehensive macromolecular library
https://molstar.org
MIT License
654 stars 148 forks source link

If i want to use this, what can i do ? #81

Closed J-DuYa closed 3 years ago

J-DuYa commented 4 years ago

Do you have an address to use the document?

dsehnal commented 4 years ago

You can have a look at https://github.com/molstar/molstar/tree/master/src/apps and https://github.com/molstar/molstar/tree/master/src/examples for example usage.

J-DuYa commented 4 years ago

You can have a look at https://github.com/molstar/molstar/tree/master/src/apps and https://github.com/molstar/molstar/tree/master/src/examples for example usage.

Is there an externally accessible api document?

J-DuYa commented 4 years ago

You can have a look at https://github.com/molstar/molstar/tree/master/src/apps and https://github.com/molstar/molstar/tree/master/src/examples for example usage.

Similar to NGLView. Document(http://nglviewer.org/ngldev/api/manual/coloring.html)

dsehnal commented 4 years ago

Sorry there is currently no such document.

But if you want help with a specific task, feel free to ask here.

J-DuYa commented 4 years ago

Okay, i have some questions.

e.g:

  1. Is there an initialization method similar to NGL or 3dmol, instead of inserting your interface into the entire web page? I don't need the initial page like this page (https://molstar.org/viewer/).🙋
  2. if i need one function of marking molecular interactions, I think there are similar functions in your official demo. What should I do if I want to use it, and what method should I adjust. 🙋‍
  3. If i want to modify molecular structure, what method do I need to adjust to update the molecule?🙋‍
  4. Can I copy, paste, and delete the molecule? If possible, what method do I need to adjust to achieve these functions? 🙋‍
  5. Does it have the functions of measuring distance, angle and dihedral angle? If possible, what method do I need to adjust to achieve these functions?🙋‍
  6. After performing certain operations, can I get the modified file through some methods? 🙋‍
  7. Can I monitor changes in molecular structure in real time? Is there an internal method? 🙋‍
dsehnal commented 4 years ago

That's a lot of questions.

e.g:

1. Is there an initialization method similar to NGL or 3dmol, instead of inserting your interface into the entire web page?
   I don't need the initial page like this page ([https://molstar.org/viewer/).🙋](https://molstar.org/viewer/).%F0%9F%99%8B)

https://github.com/molstar/molstar/blob/master/src/examples/lighting/index.ts#L74

2. if i need one function of marking molecular interactions, I think there are similar functions in your official demo. What should I do if I want to use it, and what method should I adjust. 🙋‍

There are many ways to mark interactions, too generic question.

3. If i want to modify molecular structure, what method do I need to adjust to update the molecule?🙋‍

Modify how? Changes names/positions of the atoms for example? In a way this is possible, but very complicated, we are working on making this easier but it is not ready yet.

4. Can I copy, paste, and delete the molecule? If possible, what method do I need to adjust to achieve these functions? 🙋‍

You mean change the sequence? Same answer as above.

5. Does it have the functions of measuring distance, angle and dihedral angle? If possible, what method do I need to adjust to achieve these functions?🙋‍

Yes, plugin.managers.structure.measurements has methods to do this. It needs 2-4 selections as parameters. You can get selections by modifying say https://github.com/molstar/molstar/blob/master/src/examples/basic-wrapper/index.ts#L122

6. After performing certain operations, can I get the modified file through some methods? 🙋‍

There is a generic CIF exporter, but you would have to write most of the code yourself. Mol* currently does support modifications very well.

7. Can I monitor changes in molecular structure in real time? Is there an internal method? 🙋‍

What changes do you mean?

J-DuYa commented 4 years ago

Sorry, man, some of my questions are not specific.

I will organize the language and think up these questions before asking you.

Do you have other contact information? If you have any, you can send me a private message and we will discuss it in another place🙂

J-DuYa commented 4 years ago

This product is really great. Not having the corresponding documentation is really unfriendly😂

  1. For this answer "There are many ways to mark interactions, too generic question."

What I want to know is whether it can show the interaction between molecules well.

  1. For this question, "Can I monitor changes in molecular structure in real time? Is there an internal method?"

What I want to know is whenever I modify the structure of a molecule on the interface, can I immediately get the information of my modified molecule

dsehnal commented 4 years ago

This product is really great. Not having the corresponding documentation is really unfriendly😂

I agree and it is something on our TODO list. It's also an open source project and we welcome contributions ;)

1. For this answer "There are many ways to mark interactions, too generic question."

What I want to know is whether it can show the interaction between molecules well.

It is possible. There are basically two ways to do this:

  1. Create a Structure object that is based on multiple Models. In this case the interaction should be computed automatically.
  2. Write a custom visual that takes the structures as input
1. For this question, "Can I monitor changes in molecular structure in real time? Is there an internal method?"

What I want to know is whenever I modify the structure of a molecule on the interface, can I immediately get the information of my modified molecule

You mean the representation?

J-DuYa commented 4 years ago

Thanks, man, this is indeed what I want to know. If i have other questions, i will ask again.😄

J-DuYa commented 4 years ago

Is there a way to expose it, let me customize an upload box (not built-in), customize select files initialization?

dsehnal commented 4 years ago

Yes, you can call the functions on the context from anywhere on the page. This is the code that handles the default loading https://github.com/molstar/molstar/blob/master/src/mol-plugin-state/actions/structure.ts#L41 in the viewer. You can use it as a base to write your own.

Here are visualization presets https://github.com/molstar/molstar/blob/master/src/mol-plugin-state/builder/structure/representation-preset.ts , can also be used as a template to write your own.