Lattice-Automation / seqviz

a JavaScript DNA, RNA, and protein sequence viewer
https://tools.latticeautomation.com/seqviz
MIT License
246 stars 53 forks source link

Render cut site when it goes over the end of the sequence #272

Closed guzmanvig closed 3 weeks ago

guzmanvig commented 2 months ago

Mentioned in: https://github.com/Lattice-Automation/seqviz/blob/803fc901e81a92b452d89715d520d9f358b4ede6/src/Linear/CutSites.tsx#L40 And in: # 270

Describe the bug

When an enzyme's combined recognition site and cut site sequence span straddles the last SeqBlock and first SeqBlock. This feature is not implemented in Seqviz as the TODO in the code mentions

Expected behavior

If an enzyme's recognition sequence is detected near the end of the final SeqBlock and some-or-all the associated cut site is offset from it such that it extends off the end of the final SeqBlock, then the cut site should be displayed on the first SeqBlock, at the top of the sequence viewer display.

jpsorensen-asimov commented 2 months ago

https://github.com/guzmanvig is this one you're actively working on? Was considering having a member of our team attempt to attack this one and contribute a fix, but don't want to have multiple people chasing this if you all were already on the case!

If we do tackle it, a desired behavior question - are you imagining that a recognition site would be rendered even if the recognition site went over the end of a circular sequence? Meaning part of the recognition site is on one side and part of the recognition site is on the other side? Or were you just imagining that we'd want to handle the case where the recognition site is entirely on one side of the boundary, but the cut site is on the other side? Maybe it's not a meaningful difference with the way SeqViz currently defines recognition sites (padded out with Ns to include the cut sites), which would necessitate the former. But wanted to see if you had a clear opinion based on the SeqViz philosophy.

Thanks!

guzmanvig commented 2 months ago

@jpsorensen-asimov I am indeed already working on this. I'm not 100% sure this will answer your question but the desired functionality imo is that Seqviz will render the recognition site (+ cut site) in both scenarios (and I add a third):