[feature] : Connect close ends
Is your feature request related to a problem?
Prolly a duplicate, will delete later if so
Describe the solution you would like.
Connect close ends, if within a certain distance, and if the connecting line is maybe above a certain threshold?
Describe the alternatives you have considered.
No response
Additional context
No response
Need to investigate if these gaps are noticeably above background
Perhaps need to add a pathfinding algorithm to say "can we get from one end to the other end within say 10nm without going below 0.5 nm above the surface and avoiding going back on the current trace?"
I have a gap filling algorithm used for another project but haven't implemented it in TopoStats yet as I imagined there are a load of more complex cases where my algorithm fails (I've only tested it on minicircles at the moment!)
We could have a look at this together and see if it would resolve the gaps for the data set you're working on?
Yeah we should have a look together @llwiggins
IIRC that your method used like-oriented vectors?
It fits a cubic spline through the coordinates before and after the break, seems to work well for small gaps but I imagine is quite whacky if the gaps are too large!
@llwiggins how does it decide whether or not to connect two ends?
I've set an eligibility criteria which will only connect two ends if the gap between them is within a certain distance threshold (atm a certain percentage of the expected contour length for the full molecule!)
Sorry I can't find the issue now but there was one highlighting that a "bridge" is sometimes formed during skeletonisation between regions that came close to each other but shouldn't be connected. Will have to be careful that any solution here for joining ends doesn't re-introduce those.