tycho-components 0.28.4 → 0.28.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -245,7 +245,13 @@ export default class CytoscapeTreeConverter {
|
|
|
245
245
|
return struct.chunks.filter((c) => c.l === level && i >= c.i && f <= c.f);
|
|
246
246
|
}
|
|
247
247
|
findTightestContainingChunk(struct, i, f, minLevel = 1) {
|
|
248
|
-
return this.tightestChunk(struct.chunks.filter((c) => c.l >= minLevel &&
|
|
248
|
+
return this.tightestChunk(struct.chunks.filter((c) => c.l >= minLevel &&
|
|
249
|
+
i >= c.i &&
|
|
250
|
+
f <= c.f &&
|
|
251
|
+
!this.isXpScaffoldChunk(c)));
|
|
252
|
+
}
|
|
253
|
+
isXpScaffoldChunk(chunk) {
|
|
254
|
+
return chunk.t === '*XP*';
|
|
249
255
|
}
|
|
250
256
|
tightestChunk(chunks) {
|
|
251
257
|
if (chunks.length === 0)
|
|
@@ -257,6 +263,13 @@ export default class CytoscapeTreeConverter {
|
|
|
257
263
|
return c;
|
|
258
264
|
if (span > bestSpan)
|
|
259
265
|
return best;
|
|
266
|
+
if (c.l != null && best.l != null && c.l !== best.l) {
|
|
267
|
+
return c.l > best.l ? c : best;
|
|
268
|
+
}
|
|
269
|
+
if (this.isXpScaffoldChunk(c) && !this.isXpScaffoldChunk(best))
|
|
270
|
+
return best;
|
|
271
|
+
if (!this.isXpScaffoldChunk(c) && this.isXpScaffoldChunk(best))
|
|
272
|
+
return c;
|
|
260
273
|
return c.i > best.i ? c : best;
|
|
261
274
|
});
|
|
262
275
|
}
|