Coder Social home page Coder Social logo

Total length not accurate about bandage HOT 2 OPEN

rrwick avatar rrwick commented on June 30, 2024
Total length not accurate

from bandage.

Comments (2)

rrwick avatar rrwick commented on June 30, 2024

Roye,

This is by design, though I'm aware it can be confusing and I'm open to suggestions on how to make it less so.

The way I currently view the issue is this: if you select some nodes, the total length (displayed on the right of the GUI) is just a simple sum of node lengths, ignoring overlaps. If, however, you are extracting sequences for graph paths, then overlaps are taken into account and subtracted to avoid duplicated sequences.

I went with this simplistic approach because I could see multiple different ways to consider overlaps in the total length, and I'm not sure which would be best. In particular, things are not obvious when you have multiple nodes selected which do not form a simple path.

Consider the case where these three nodes are selected:

  B
 /
A
 \
  C

Imagine all three nodes have a length of 100 bp and the two edges have an overlap of 10 bp. If the user selected all three, I can see a few different possibilities:

  • Total length = 300 bp. A simple sum, ignoring overlaps (what Bandage currently does).
  • Total length = 290 bp. Trim the overlap length from node A. The overlap length is removed only once because the two edges share the same overlap.
  • Total length = 280 bp. Trim the overlap length from nodes B and C. The overlap length is removed twice, once for all possible edges connecting nodes in the selection.
  • Only edges which are selected have their overlap removed. This way total length depends not just on the node selection but also on the edge selection. Total length would be 300, 290 or 280, depending on whether 0, 1 or 2 edges were included in the selection.

I went with the first option because it seemed simplest and least confusing to me. But if you can make a case for one of the other options, or suggest an approach I haven't considered, then I'm keen to hear it!

Thanks,
Ryan

from bandage.

rozovr avatar rozovr commented on June 30, 2024

Hey Ryan, thanks for considering this.

The second case is not clear to me - can you clarify why the two edges share the same overlap? I think there are two different overlaps since they relate to different ends of A.

Generally, I agree there are cases the length reported can be ambiguous, particularly whenever your path returns to some point that's already been visited, but as it is, the total length is problematic in that it's misleading. For how it is currently, I would think to re-label that length to something like 'sum of node lengths.' To make it clear this is not the same as the path length, maybe consider putting the path selection box under the node selection (at the right) and having a "path length" reported under it.

To me the path selection box is more needed and natural than an additional box showing edge selection. I may be on the fringe in this sense, but I have tended to mostly ignore the selectable edges, so in my view the edge selection box may be superfluous. It would be interesting to see if others think the same.

R

from bandage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.