INNER CODE UNIT · JavaScript

hash

lh3/gfatools · js/gfa-plot.js:243

			hash = (hash + gfa_int_hash(w.v[j])) & 0xffffffff;
		ww.hash = w.v.length << 32 | hash;
		walk.push(ww);
	}
	if (merge) { // merge identical walks; FIXME: this only checks hash
		walk = walk.sort(function(x,y) { return x.hash - y.hash; });
		var i0, i, k;
		for (i0 = 0, i = 1, k = 0; i <= walk.length; ++i) {
			if (i == walk.length || walk[i0].hash != walk[i].hash) {
				walk[k] = walk[i0];
				walk[k++].n = i - i0;
				i0 = i;
			}
		}
		walk.length = k;
		walk = walk.sort(function(x,y) { return y.n - x.n; });
		for (i = 0; i < walk.length; ++i) // reassign sample name
			walk[i].label = "" + walk[i].n;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…