vgteam / sequenceTubeMap

displays multiple genomic sequences in the form of a tube map
MIT License
180 stars 25 forks source link

I want to learn more about your projects #340

Closed Szhiha closed 1 year ago

Szhiha commented 1 year ago

Would you mind telling me how to achieve a mouse click on a base with a small vertical line pointing to the corresponding reference base sequence on the page like you ? Thank you !

adamnovak commented 1 year ago

Glad to hear you are interested in the project @Szhiha, but I don't understand your question.

If you want to know how we manage to draw the vertical lines that appear when you hover the mouse over a substitution or insertion or deletion in a read, that happens here:

https://github.com/vgteam/sequenceTubeMap/blob/429fb486abc3a7fa500dfbfece00d067b33bcdc8/src/util/tubemap.js#L4672-L4741

We calculate the positions the lines need to be at, and then we add them to the visualization by using the appropriate d3 API methods.

Or are you asking how you could change the code to draw vertical lines when you click on bases on non-reference nodes, to connect them to bases on reference nodes?

Szhiha commented 1 year ago

I am very happy to receive your reply, sorry for confusing you before. In fact, the question I wanted to ask you before is just the paragraph you answered for me. Thank you very much for your guidance, and wish you a good day!

adamnovak commented 1 year ago

Great! I'll close out this issue, since your question is answered.