Skip to content

Commit f85c568

Browse files
authored
Merge pull request #9 from platforma-open/mzueva/fix-open-button-for-bulk
Fix Open button for bulk dataset
2 parents fe74afc + c9d3061 commit f85c568

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

.changeset/short-toys-think.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@platforma-open/milaboratories.3d-structure-based-liabilities.model': patch
3+
---
4+
5+
Fix Open button for bulk dataset

model/src/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ export const platforma = BlockModelV3.create(dataModel)
218218
if (!parsed.isComplete) return undefined;
219219
return parsed.data;
220220
})
221-
// Axis id of the scClonotypeKey axis, used to attach the viewer-trigger
221+
// Axis id of the clonotype-key axis (scClonotypeKey for single-cell,
222+
// clonotypeKey for bulk), used to attach the viewer-trigger
222223
// button to that column in the table. Derive from the actual scoresData
223224
// column (which is what populates the table), so the AxisId matches the
224225
// table column's id byte-for-byte. Deriving from the PDB col's spec
@@ -232,7 +233,12 @@ export const platforma = BlockModelV3.create(dataModel)
232233
return undefined;
233234
}
234235
const first = cols?.[0];
235-
const found = first?.spec.axesSpec.find((a) => a.name === "pl7.app/vdj/scClonotypeKey");
236+
// The clonotype-key axis is named `scClonotypeKey` for single-cell data
237+
// and `clonotypeKey` for bulk; match either so the viewer-trigger button
238+
// attaches in both regimes (the scores column is single-keyed on it).
239+
const found = first?.spec.axesSpec.find(
240+
(a) => a.name === "pl7.app/vdj/scClonotypeKey" || a.name === "pl7.app/vdj/clonotypeKey",
241+
);
236242
if (!found) return undefined;
237243
return getAxisId(found);
238244
})

0 commit comments

Comments
 (0)