@platforma-open/milaboratories.import-vdj 1.7.0 → 1.8.0

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
@@ -12795,6 +12795,8 @@ function bareSetValid(bare) {
12795
12795
  }
12796
12796
  //#endregion
12797
12797
  //#region ../model/dist/index.js
12798
+ /** Unpartitioned inline-JSON p-column storage; payload is `{ keyLength, data }`. */
12799
+ const RT_JSON = "PColumnData/Json";
12798
12800
  /**
12799
12801
  * The mapping fields that belong to the dataset door and mean nothing on a bare set: the bare
12800
12802
  * path in the workflow reads `bareSet`, `fileSource` and `datasetRef` and nothing else.
@@ -13090,13 +13092,37 @@ const platforma$1 = BlockModelV3.create(blockDataModel).args(projectArgs).prerun
13090
13092
  }).outputWithStatus("stats", (ctx) => {
13091
13093
  const pCols = ctx.outputs?.resolve("stats")?.getPColumns();
13092
13094
  if (pCols === void 0) return;
13093
- const primary = pCols.find((c) => c.spec.name.endsWith("/annotatedCount"));
13095
+ const primary = pCols.find((c) => c.spec.name.endsWith("/annotatedCount")) ?? pCols.find((c) => c.spec.name === "pl7.app/vdj/stat/clonotypeCount");
13094
13096
  if (primary === void 0) return;
13095
13097
  return createPlDataTableV3(ctx, {
13096
13098
  primaryColumns: [DataColumn.fromColumn(primary)],
13097
13099
  columns: pCols.filter((c) => c.id !== primary.id).map((c) => DataColumn.fromColumn(c)),
13098
13100
  tableState: ctx.data.tableState
13099
13101
  });
13102
+ }).output("emptyChainSamples", (ctx) => {
13103
+ const pCols = ctx.outputs?.resolve("stats")?.getPColumns();
13104
+ if (pCols === void 0) return;
13105
+ const countCols = pCols.filter((c) => c.spec.name === "pl7.app/vdj/stat/clonotypeCount");
13106
+ const [firstCol] = countCols;
13107
+ if (firstCol === void 0) return;
13108
+ const totals = /* @__PURE__ */ new Map();
13109
+ for (const col of countCols) {
13110
+ const data = col.data;
13111
+ if (!(data instanceof TreeNodeAccessor) || data.resourceType.name !== RT_JSON) return;
13112
+ const json = data.getDataAsJsonOrUndefined();
13113
+ if (json === void 0) return;
13114
+ for (const [keyStr, value] of Object.entries(json.data)) {
13115
+ const [sampleId] = JSON.parse(keyStr);
13116
+ if (sampleId === void 0) continue;
13117
+ const count = typeof value === "number" ? value : 0;
13118
+ totals.set(sampleId, (totals.get(sampleId) ?? 0) + count);
13119
+ }
13120
+ }
13121
+ const labels = ctx.resultPool.findLabelsForColumnAxis(firstCol.spec, 0);
13122
+ return {
13123
+ emptySamples: [...totals.entries()].filter(([, total]) => total === 0).map(([sampleId]) => labels?.[sampleId] ?? String(sampleId)).sort((a, b) => a.localeCompare(b)),
13124
+ sampleCount: totals.size
13125
+ };
13100
13126
  }).sections((_ctx) => [{
13101
13127
  type: "link",
13102
13128
  href: "/",