@platforma-open/milaboratories.top-antibodies 4.3.0 → 4.3.1

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.
package/dist/index.js CHANGED
@@ -14471,14 +14471,14 @@ const CLUSTER_ID_SELECTORS = [...CLUSTER_ID_AXIS_NAMES].map((name) => ({ name: e
14471
14471
  const OWN_PLUMBING_SELECTORS = [{ name: exactMatch("pl7.app/selectionStage") }, { name: exactMatch("pl7.app/lead-selection") }];
14472
14472
  /**
14473
14473
  * Adapt column recipes to `PColumn`s for the helpers that still take
14474
- * materialised `PColumn[]` and have no id form (`createPFrameForGraphs`,
14475
- * `PColumnIdAndSpec`).
14474
+ * materialised `PColumn[]` and have no id form (`getRelatedColumns`,
14475
+ * `createPFrameForGraphs`, `PColumnIdAndSpec`).
14476
14476
  *
14477
14477
  * Only bare leaves qualify: `PColumn.id` is typed `PObjectId`, which no wrapper
14478
14478
  * recipe carries — hence `isDataColumn` rather than `hasReachableData`, which
14479
- * also admits spec-overrides over a leaf. Deduped by id: the same leaf can be
14480
- * reachable via more than one path and `createPFrameForGraphs` rejects
14481
- * duplicates.
14479
+ * also admits spec-overrides over a leaf. Deduped by id: these lists travel as
14480
+ * block columns, and a repeated id aborts the collection scan inside
14481
+ * `getRelatedColumns`.
14482
14482
  */
14483
14483
  function toGraphColumns(recipes) {
14484
14484
  return dedupColumns(recipes.filter(isDataColumn).map((c) => ({
@@ -14492,32 +14492,38 @@ function accessorGraphColumns(accessor) {
14492
14492
  if (!accessor) return void 0;
14493
14493
  return toGraphColumns(ColumnsCollection([accessor]).getColumns());
14494
14494
  }
14495
+ function umapPoolColumns(ctx) {
14496
+ const clonotypeAxisName = getSpecByRef(getInputAnchorRef(ctx.data))?.axesSpec[1]?.name;
14497
+ if (clonotypeAxisName === void 0) return void 0;
14498
+ const umap = ColumnsCollection(["result_pool"]).filter({ include: {
14499
+ name: "^pl7\\.app/umap[12]$",
14500
+ axes: [{ name: exactMatch(clonotypeAxisName) }]
14501
+ } }).getColumns();
14502
+ if (umap.length === 0) return void 0;
14503
+ return toGraphColumns(umap);
14504
+ }
14495
14505
  /**
14496
- * UMAP columns from the sequence-space block plus this block's own sampled-rows
14497
- * markers, materialised for `createPFrameForGraphs` / `PColumnIdAndSpec`.
14506
+ * Ids of the columns that join the UMAP projection, discovered once per UMAP
14507
+ * column and unioned, so a second clonotype-space block keyed on its own axis
14508
+ * still contributes.
14498
14509
  *
14499
- * The legacy `{ anchor: "main", idx: 1 }` axis binding has no selector form, so
14500
- * the clonotype axis name is read off the resolved anchor spec and matched by
14501
- * name. Omitting `partialAxesMatch` keeps the old exact-axis-set semantics.
14510
+ * Anchors are specs, never ids, so the pool's own copy of a UMAP column cannot
14511
+ * collide with one handed in here.
14502
14512
  */
14503
- function umapGraphColumns(ctx) {
14504
- const anchorSpec = getSpecByRef(getInputAnchorRef(ctx.data));
14505
- const clonotypeAxisName = anchorSpec?.axesSpec[1]?.name;
14506
- if (anchorSpec === void 0 || clonotypeAxisName === void 0) return void 0;
14507
- const umap = ColumnsCollection(["result_pool"]).discover({
14508
- anchors: { main: anchorSpec },
14509
- include: {
14510
- name: "^pl7\\.app/umap[12]$",
14511
- axes: [{ name: exactMatch(clonotypeAxisName) }]
14512
- }
14513
- }).getColumns();
14514
- if (umap.length === 0) return void 0;
14515
- const sampledRows = ColumnsCollection([ctx.outputs?.resolve({
14513
+ function umapRelatedIds(umap) {
14514
+ return [...new Set(umap.flatMap((c) => ColumnsCollection().discover({
14515
+ mode: "enrichment",
14516
+ maxHops: 4,
14517
+ anchors: { main: c.spec },
14518
+ exclude: [{ annotations: { [Annotation.HideDataFromUi]: exactMatch("true") } }, { annotations: { [Annotation.HideDataFromGraphs]: exactMatch("true") } }]
14519
+ }).getColumnIds()))];
14520
+ }
14521
+ function sampledRowsGraphColumns(ctx) {
14522
+ return accessorGraphColumns(ctx.outputs?.resolve({
14516
14523
  field: "sampledRows",
14517
14524
  assertFieldType: "Input",
14518
14525
  allowPermanentAbsence: true
14519
- })].filter((a) => a !== void 0)).getColumns();
14520
- return toGraphColumns([...umap, ...sampledRows]);
14526
+ }));
14521
14527
  }
14522
14528
  const platforma$1 = BlockModelV3.create({
14523
14529
  dataModel: blockDataModel,
@@ -14806,13 +14812,14 @@ const platforma$1 = BlockModelV3.create({
14806
14812
  if (ctx.outputs.getIsReadyOrError() === false) return true;
14807
14813
  return false;
14808
14814
  }).outputWithStatus("umapPf", (ctx) => {
14809
- const pCols = umapGraphColumns(ctx);
14810
- if (pCols === void 0) return void 0;
14811
- return createPFrameForGraphs(ctx, pCols);
14815
+ const umap = umapPoolColumns(ctx);
14816
+ if (umap === void 0) return void 0;
14817
+ if (umap.some((c) => c.data === void 0)) return void 0;
14818
+ return ctx.createPFrame([...umapRelatedIds(umap), ...umap.map((c) => c.id)]);
14812
14819
  }).outputWithStatus("umapPcols", (ctx) => {
14813
- const pCols = umapGraphColumns(ctx);
14814
- if (pCols === void 0) return void 0;
14815
- return pCols.map((c) => ({
14820
+ const umap = umapPoolColumns(ctx);
14821
+ if (umap === void 0) return void 0;
14822
+ return [...umap, ...sampledRowsGraphColumns(ctx) ?? []].map((c) => ({
14816
14823
  columnId: c.id,
14817
14824
  spec: c.spec
14818
14825
  }));