Open m-iguel opened 1 year ago
@M-iguel You don't want to modify the index.js
file directly. If you run npm run watch-playground
, this automatically updates the index.js file whenever you make changes to src/apps/playground/index.ts
.
I also checked it out, and you're right. It seems that converting the atom to a Loci type produces the same Loci (this could be a bug or we could be doing it wrong). I think another approach might iterating through the residues instead of the atoms. Here's what I got:
https://github.com/luna215/molstar/assets/7971405/de25faa6-dea4-4592-9dc4-69ab545471f0
Check out the pull request to see the code changes: https://github.com/luna215/molstar/pull/3
Hey,
It's-a me, Miguel!!
I'm sorry to keep bothering but I thought I might take your word and ask future questions.
I modified the code in the index.js file to render what I am looking for to then modify the rest. However, I am having some trouble with creating an array of atoms. So here I will post the code of the index.js file:
The thing is that, when you log any element of the atoms array in the console, all of them show that they are the same element, so afterwards, the lociA and lociB objects are also equal and that is why I think the distance measurement is not being rendered, because the starting and ending point is the same. This is what I think is happening, it might as well be something else.
Anyway, I post this here, because even though I know you are not that familiar with the measurementManager class in molstar, you are familiar with this code and might spot something I don't.
Just for reference, I will leve here the sourcecode of the addDistance function (https://github.com/molstar/molstar/blob/master/src/mol-plugin-state/manager/structure/measurement.ts#L97)
I think this approach might be ok, in this case I am trying to join atoms 3 and 100, but for some reason I don't seem to create the atoms array properly. Do you see any reason for this? Would you try a different approach?
I'm sorry to bother, but I'd love to hear from you :)
Thanks,
Miguel