sacdallago / mecu

TPCA data analysis tool
http://protein.melting.degree
GNU General Public License v3.0
1 stars 0 forks source link

mecu-graph.js: calculating the distance of two same curves results in a crash of the site #17

Closed KlausNie closed 5 years ago

KlausNie commented 6 years ago

Originally posted by @KlausNie in https://github.com/sacdallago/mecu/issues/10#issuecomment-422309122

function findXNeighbours(v, scanline) {
    var f = function (forward, reverse) {
        var it = scanline.findIter(v);
        var u;
        while ((u = it[forward]()) !== null) {
            var uovervX = u.r.overlapX(v.r);
            if (uovervX <= 0 || uovervX <= u.r.overlapY(v.r)) {
                v[forward].insert(u);
                u[reverse].insert(v);
            }
            if (uovervX <= 0) {
                break;
            }
        }
    };
    f("next", "prev");
    f("prev", "next");
}
Uncaught TypeError: Cannot read property 'next' of null
    at f (mecu-graph.js:4059)
    at Object.findXNeighbours [as findNeighbours] (mecu-graph.js:4070)

seems to be happening when there are multiple proteins with the same read data. The points are then drawn all on the same position.

If there are too many proteins with the same read data (I found 5 - 7) the site goes into a freeze, the browser (chrome) halts the calculation and you are stuck with a ~4gb ram allocation. If the browser does not stop the calculation, the browser itself crashes and/or you run out of ram memory.

sacdallago commented 6 years ago

Seems dependent on https://github.com/tgdwyer/WebCola/issues/74

sacdallago commented 5 years ago

Solved?