Skip to content

Commit 518d570

Browse files
committed
update ui with updated api
1 parent 708a412 commit 518d570

File tree

11 files changed

+322
-333
lines changed

11 files changed

+322
-333
lines changed

model/src/index.ts

Lines changed: 55 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
InferOutputsType,
77
PlDataTableState,
88
isPColumn,
9-
isPColumnSpec
9+
isPColumnSpec,
10+
FutureRef
1011
} from '@platforma-sdk/model';
1112
import { GraphMakerSettings } from '@milaboratories/graph-maker/dist/GraphMaker/types';
1213
import { parseResourceMap } from './helpers';
@@ -39,7 +40,7 @@ export type UiState = {
3940
export type ColumnOption = {
4041
ref: Ref;
4142
label: string;
42-
spec: PColumnSpec;
43+
assemblingFeature?: string;
4344
};
4445

4546
export const platforma = BlockModel.create<BlockArgs, UiState>('Heavy')
@@ -59,7 +60,7 @@ export const platforma = BlockModel.create<BlockArgs, UiState>('Heavy')
5960
// select metadata columns
6061
.output('donorColumnOptions', (ctx) =>
6162
ctx.resultPool
62-
.getSpecsFromResultPool()
63+
.getSpecs()
6364
.entries.filter((v) => isPColumnSpec(v.obj))
6465
.filter((v) => {
6566
const spec = v.obj as PColumnSpec;
@@ -74,6 +75,10 @@ export const platforma = BlockModel.create<BlockArgs, UiState>('Heavy')
7475
}`
7576
} satisfies Option)
7677
)
78+
.map((v) => ({
79+
text: v.label,
80+
value: v.ref,
81+
}))
7782
)
7883

7984
// selected all dataset options that have the same axis as selected metadata column
@@ -83,7 +88,7 @@ export const platforma = BlockModel.create<BlockArgs, UiState>('Heavy')
8388
}
8489
const donorColumn = ctx.args.donorColumn;
8590
const donorColumnSpec = ctx.resultPool
86-
.getSpecsFromResultPool()
91+
.getSpecs()
8792
.entries.find(
8893
(v) => v.ref.blockId === donorColumn.blockId && v.ref.name === donorColumn.name
8994
)?.obj;
@@ -93,7 +98,7 @@ export const platforma = BlockModel.create<BlockArgs, UiState>('Heavy')
9398
const toCompare = donorColumnSpec.axesSpec[0];
9499

95100
return ctx.resultPool
96-
.getSpecsFromResultPool()
101+
.getSpecs()
97102
.entries.filter((v) => isPColumnSpec(v.obj))
98103
.filter((v) => {
99104
const spec = v.obj as PColumnSpec;
@@ -111,16 +116,20 @@ export const platforma = BlockModel.create<BlockArgs, UiState>('Heavy')
111116
return true;
112117
})
113118
.map(
114-
(v) =>
115-
({
119+
(v) => {
120+
const option = {
116121
ref: v.ref,
117122
// @todo info about what was run
118123
label: `${ctx.getBlockLabel(v.ref.blockId)} / ${
119124
v.obj.annotations?.['pl7.app/label'] ?? `unlabelled`
120-
}`,
121-
spec: v.obj as PColumnSpec
122-
} as ColumnOption)
123-
);
125+
}`
126+
} as ColumnOption
127+
const spec = v.obj as PColumnSpec
128+
if (!(spec.annotations === undefined || spec.annotations["mixcr.com/assemblingFeature"] === undefined)) {
129+
option.assemblingFeature = spec.annotations["mixcr.com/assemblingFeature"]
130+
}
131+
return option
132+
});
124133
})
125134

126135
.output('trees', (ctx) => {
@@ -143,23 +152,50 @@ export const platforma = BlockModel.create<BlockArgs, UiState>('Heavy')
143152
return ctx.createPFrame(treeNodesColumns.concat(treeNodesWithClonesColumns));
144153
})
145154

146-
.output('allelesReports', (ctx) =>
147-
parseResourceMap(
155+
.output('availableDonorIds', (ctx) => {
156+
const alleleReports = ctx.outputs?.resolve({ field: 'allelesReports', assertFieldType: 'Input' })
157+
if (alleleReports === undefined) return undefined
158+
const reports = parseResourceMap( alleleReports, (acc) => acc.getFileContentAsString() )
159+
160+
const result = []
161+
for (const data of reports.data) {
162+
const donor = data.key[0] as string
163+
result.push({
164+
text: donor,
165+
value: donor,
166+
})
167+
}
168+
return result
169+
})
170+
171+
.output('allelesReports', (ctx) => {
172+
const reports = parseResourceMap(
148173
ctx.outputs?.resolve({ field: 'allelesReports', assertFieldType: 'Input' }),
149174
(acc) => acc.getFileContentAsString()
150175
)
151-
)
152176

153-
.output('treesReports', (ctx) =>
154-
parseResourceMap(
177+
const result = {} as { [key: string]: FutureRef<string | undefined>}
178+
for (const data of reports.data) {
179+
result[data.key[0] as string] = data.value
180+
}
181+
return result
182+
})
183+
184+
.output('treesReports', (ctx) => {
185+
const reports = parseResourceMap(
155186
ctx.outputs?.resolve({ field: 'treesReports', assertFieldType: 'Input' }),
156187
(acc) => acc.getFileContentAsString()
157188
)
158-
)
189+
190+
const result = {} as { [key: string]: FutureRef<string | undefined>}
191+
for (const data of reports.data) {
192+
result[data.key[0] as string] = data.value
193+
}
194+
return result
195+
})
159196

160197
.sections([
161-
{ type: 'link', href: '/', label: 'Settings' },
162-
{ type: 'link', href: '/reports', label: 'Reports' },
198+
{ type: 'link', href: '/', label: 'Main' },
163199
{ type: 'link', href: '/trees', label: 'Trees Table' },
164200
{ type: 'link', href: '/treeNodes', label: 'Tree Nodes Table' }
165201
])

pnpm-lock.yaml

Lines changed: 44 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ catalog:
99
'@platforma-sdk/tengo-builder': ^1.14.11
1010
'@platforma-sdk/block-tools': ^2.3.4
1111

12-
'@platforma-sdk/model': ^1.2.27
12+
"@platforma-sdk/model": ^1.2.32
13+
"@platforma-sdk/ui-vue": ^1.5.38
14+
1315
'@platforma-sdk/test': ^1.5.23
1416
"@milaboratories/graph-maker": ^1.0.8
1517

@@ -18,8 +20,6 @@ catalog:
1820

1921
'@milaboratory/mixcr': 4.7.0-70-develop
2022

21-
'@milaboratories/uikit': ^1.2.5
22-
'@platforma-sdk/ui-vue': ^1.3.8
2323
'@milaboratories/helpers': ^1.6.2
2424

2525
'vue': ^3.5.10

ui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"@ag-grid-community/vue3": "catalog:",
1616
"@milaboratories/helpers": "catalog:",
1717
"@platforma-open/milaboratories.mixcr-shm-trees.model": "workspace:*",
18-
"@milaboratories/uikit": "catalog:",
1918
"@platforma-sdk/model": "catalog:",
2019
"@platforma-sdk/ui-vue": "catalog:",
2120
"@milaboratories/graph-maker": "catalog:",

0 commit comments

Comments
 (0)