@platforma-open/milaboratories.humanization-score.model 0.2.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/.turbo/turbo-build.log +18 -0
- package/.turbo/turbo-lint.log +5 -0
- package/.turbo/turbo-type-check.log +6 -0
- package/CHANGELOG.md +5 -0
- package/dist/bundle.js +10211 -0
- package/dist/bundle.js.map +1 -0
- package/dist/index.cjs +42 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +1687 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -0
- package/dist/model.json +1 -0
- package/eslint.config.mjs +4 -0
- package/package.json +29 -0
- package/src/index.ts +93 -0
- package/tsconfig.json +9 -0
- package/vitest.config.mts +8 -0
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@platforma-open/milaboratories.humanization-score.model",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Block model",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@platforma-sdk/model": "1.77.15",
|
|
10
|
+
"@milaboratories/helpers": "1.14.2"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@milaboratories/ts-builder": "1.5.0",
|
|
14
|
+
"@milaboratories/ts-configs": "1.2.3",
|
|
15
|
+
"@platforma-sdk/block-tools": "2.9.3",
|
|
16
|
+
"@platforma-sdk/eslint-config": "1.2.0",
|
|
17
|
+
"eslint": "^9.25.1",
|
|
18
|
+
"vitest": "^4.0.7",
|
|
19
|
+
"typescript": "~5.6.3"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "ts-builder build --target block-model && block-tools build-model",
|
|
23
|
+
"watch": "ts-builder build --target block-model --watch",
|
|
24
|
+
"type-check": "ts-builder type-check --target block-model",
|
|
25
|
+
"test": "vitest",
|
|
26
|
+
"lint": "eslint .",
|
|
27
|
+
"do-pack": "shx rm -f *.tgz && pnpm pack && shx mv *.tgz package.tgz"
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
PlDataTableStateV2,
|
|
3
|
+
PlRef,
|
|
4
|
+
} from '@platforma-sdk/model';
|
|
5
|
+
import {
|
|
6
|
+
ArrayColumnProvider,
|
|
7
|
+
BlockModelV3,
|
|
8
|
+
DataModelBuilder,
|
|
9
|
+
createPlDataTableStateV2,
|
|
10
|
+
createPlDataTableV3,
|
|
11
|
+
} from '@platforma-sdk/model';
|
|
12
|
+
export type * from '@milaboratories/helpers';
|
|
13
|
+
|
|
14
|
+
type OldArgs = {
|
|
15
|
+
customBlockLabel: string;
|
|
16
|
+
inputAnchor?: PlRef;
|
|
17
|
+
mem?: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type OldUiState = {
|
|
21
|
+
tableState: PlDataTableStateV2;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type BlockData = {
|
|
25
|
+
customBlockLabel: string;
|
|
26
|
+
inputAnchor?: PlRef;
|
|
27
|
+
mem?: number;
|
|
28
|
+
tableState: PlDataTableStateV2;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const dataModel = new DataModelBuilder()
|
|
32
|
+
.from<BlockData>('v1')
|
|
33
|
+
.upgradeLegacy<OldArgs, OldUiState>(({ args, uiState }) => ({
|
|
34
|
+
...args,
|
|
35
|
+
tableState: uiState.tableState,
|
|
36
|
+
}))
|
|
37
|
+
.init(() => ({
|
|
38
|
+
customBlockLabel: '',
|
|
39
|
+
tableState: createPlDataTableStateV2(),
|
|
40
|
+
}));
|
|
41
|
+
|
|
42
|
+
export const platforma = BlockModelV3.create(dataModel)
|
|
43
|
+
|
|
44
|
+
.args((data) => {
|
|
45
|
+
if (!data.inputAnchor) throw new Error('Input anchor is required');
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
customBlockLabel: data.customBlockLabel || 'Humanness Score',
|
|
49
|
+
inputAnchor: data.inputAnchor,
|
|
50
|
+
mem: data.mem,
|
|
51
|
+
};
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
.output('inputOptions', (ctx) =>
|
|
55
|
+
ctx.resultPool.getOptions([{
|
|
56
|
+
axes: [
|
|
57
|
+
{ name: 'pl7.app/sampleId' },
|
|
58
|
+
{ name: 'pl7.app/vdj/clonotypeKey' },
|
|
59
|
+
],
|
|
60
|
+
annotations: { 'pl7.app/isAnchor': 'true' },
|
|
61
|
+
}, {
|
|
62
|
+
axes: [
|
|
63
|
+
{ name: 'pl7.app/sampleId' },
|
|
64
|
+
{ name: 'pl7.app/vdj/scClonotypeKey' },
|
|
65
|
+
],
|
|
66
|
+
annotations: { 'pl7.app/isAnchor': 'true' },
|
|
67
|
+
}]),
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
.outputWithStatus('pt', (ctx) => {
|
|
71
|
+
const pCols = ctx.outputs?.resolve('outputLiabilities')?.getPColumns();
|
|
72
|
+
if (pCols === undefined) {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
return createPlDataTableV3(ctx, {
|
|
76
|
+
tableState: ctx.data.tableState,
|
|
77
|
+
columns: new ArrayColumnProvider(pCols)
|
|
78
|
+
.getAllColumns()
|
|
79
|
+
.map((column) => ({ column, isPrimary: true })),
|
|
80
|
+
});
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
.output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)
|
|
84
|
+
|
|
85
|
+
.title(() => 'Humanness Score')
|
|
86
|
+
|
|
87
|
+
.subtitle((ctx) => ctx.data.customBlockLabel || 'Humanness Score')
|
|
88
|
+
|
|
89
|
+
.sections((_) => [
|
|
90
|
+
{ type: 'link', href: '/', label: 'Table' },
|
|
91
|
+
])
|
|
92
|
+
|
|
93
|
+
.done();
|
package/tsconfig.json
ADDED