@platforma-open/milaboratories.immune-assay-data.model 1.0.1 → 1.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 +13 -13
- package/CHANGELOG.md +12 -0
- package/dist/bundle.js +511 -490
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +9 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -51
- package/dist/index.d.ts +7 -51
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +5 -5
- package/src/index.ts +14 -9
package/dist/index.cjs
CHANGED
|
@@ -5,16 +5,15 @@ var model$1 = require('@platforma-sdk/model');
|
|
|
5
5
|
// src/index.ts
|
|
6
6
|
var model = model$1.BlockModel.create().withArgs({
|
|
7
7
|
settings: {
|
|
8
|
-
|
|
9
|
-
// default to coverage of clone,
|
|
10
|
-
coverageThreshold: 0.95
|
|
8
|
+
coverageThreshold: 0.95,
|
|
11
9
|
// default value matching MMseqs2 default
|
|
12
|
-
|
|
10
|
+
identity: 0.9,
|
|
11
|
+
similarityType: "alignment-score"
|
|
12
|
+
},
|
|
13
|
+
selectedColumns: []
|
|
13
14
|
}).withUiState({
|
|
14
15
|
title: "Immune Assay Data",
|
|
15
|
-
tableState:
|
|
16
|
-
gridState: {}
|
|
17
|
-
}
|
|
16
|
+
tableState: model$1.createPlDataTableStateV2()
|
|
18
17
|
}).argsValid(
|
|
19
18
|
(ctx) => ctx.args.datasetRef !== void 0 && ctx.args.fileHandle !== void 0 && ctx.args.importColumns !== void 0 && ctx.args.sequenceColumnHeader !== void 0 && ctx.args.targetRef !== void 0 && ctx.uiState.fileImportError === void 0
|
|
20
19
|
).output(
|
|
@@ -82,13 +81,15 @@ var model = model$1.BlockModel.create().withArgs({
|
|
|
82
81
|
(ctx) => ctx.outputs?.resolve("dataImportHandle")?.getImportProgress(),
|
|
83
82
|
{ isActive: true }
|
|
84
83
|
).output("table", (ctx) => {
|
|
84
|
+
if (ctx.outputs?.resolve("emptyResults")?.getDataAsJson()) {
|
|
85
|
+
return void 0;
|
|
86
|
+
}
|
|
85
87
|
const cols = ctx.outputs?.resolve("table")?.getPColumns();
|
|
86
88
|
if (cols === void 0)
|
|
87
89
|
return void 0;
|
|
88
90
|
return model$1.createPlDataTableV2(
|
|
89
91
|
ctx,
|
|
90
92
|
cols,
|
|
91
|
-
(_) => true,
|
|
92
93
|
ctx.uiState.tableState
|
|
93
94
|
);
|
|
94
95
|
}).output("isRunning", (ctx) => ctx.outputs?.getIsReadyOrError() === false).title((ctx) => ctx.uiState.title).sections((_ctx) => [
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["BlockModel","createPlDataTableV2"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["BlockModel","createPlDataTableStateV2","createPlDataTableV2"],"mappings":";;;;;AA2CO,IAAM,KAAQ,GAAAA,kBAAA,CAAW,MAAO,EAAA,CAEpC,QAAoB,CAAA;AAAA,EACnB,QAAU,EAAA;AAAA,IACR,iBAAmB,EAAA,IAAA;AAAA;AAAA,IACnB,QAAU,EAAA,GAAA;AAAA,IACV,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,iBAAiB;AACnB,CAAC,EAEA,WAAqB,CAAA;AAAA,EACpB,KAAO,EAAA,mBAAA;AAAA,EACP,YAAYC,gCAAyB;AACvC,CAAC,CAEA,CAAA,SAAA;AAAA,EAAU,CAAC,GACV,KAAA,GAAA,CAAI,IAAK,CAAA,UAAA,KAAe,UACrB,GAAI,CAAA,IAAA,CAAK,UAAe,KAAA,MAAA,IACxB,GAAI,CAAA,IAAA,CAAK,kBAAkB,MAC3B,IAAA,GAAA,CAAI,IAAK,CAAA,oBAAA,KAAyB,MAClC,IAAA,GAAA,CAAI,KAAK,SAAc,KAAA,MAAA,IACvB,GAAI,CAAA,OA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OAAA,EAAS,mBAAwB,KAAA,KAAK,EAEvE,KAAM,CAAA,CAAC,QAAQ,GAAI,CAAA,OAAA,CAAQ,KAAK,CAEhC,CAAA,QAAA,CAAS,CAAC,IAAU,KAAA;AAAA,EACnB,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,GAAA,EAAK,OAAO,MAAO;AAC3C,CAAE,EAED,IAAK","file":"index.cjs","sourcesContent":["import type {\n ImportFileHandle,\n InferOutputsType,\n PlDataTableStateV2,\n PlRef,\n SUniversalPColumnId\n} from '@platforma-sdk/model';\nimport {\n BlockModel,\n createPlDataTableStateV2,\n createPlDataTableV2,\n} from '@platforma-sdk/model';\n\ntype Settings = {\n coverageThreshold: number; // fraction of aligned residues required\n identity: number;\n similarityType: 'sequence-identity' | 'alignment-score';\n};\n\nexport type ImportColumnInfo = {\n header: string;\n type: 'Int' | 'Double' | 'String';\n /** If this column is a sequence column, the type of the sequence */\n sequenceType?: 'nucleotide' | 'aminoacid';\n};\n\nexport type BlockArgs = {\n datasetRef?: PlRef;\n targetRef?: SUniversalPColumnId;\n fileHandle?: ImportFileHandle;\n fileExtension?: string;\n importColumns?: ImportColumnInfo[];\n sequenceColumnHeader?: string;\n selectedColumns: string[];\n settings: Settings;\n};\n\nexport type UiState = {\n title: string;\n fileImportError?: string;\n tableState: PlDataTableStateV2;\n};\n\nexport const model = BlockModel.create()\n\n .withArgs<BlockArgs>({\n settings: {\n coverageThreshold: 0.95, // default value matching MMseqs2 default\n identity: 0.9,\n similarityType: 'alignment-score',\n },\n selectedColumns: [],\n })\n\n .withUiState<UiState>({\n title: 'Immune Assay Data',\n tableState: createPlDataTableStateV2(),\n })\n\n .argsValid((ctx) =>\n ctx.args.datasetRef !== undefined\n && ctx.args.fileHandle !== undefined\n && ctx.args.importColumns !== undefined\n && ctx.args.sequenceColumnHeader !== undefined\n && ctx.args.targetRef !== undefined\n && ctx.uiState.fileImportError === undefined,\n )\n\n .output('datasetOptions', (ctx) =>\n ctx.resultPool.getOptions([{\n axes: [\n { name: 'pl7.app/sampleId' },\n { name: 'pl7.app/vdj/clonotypeKey' },\n ],\n annotations: { 'pl7.app/isAnchor': 'true' },\n }, {\n axes: [\n { name: 'pl7.app/sampleId' },\n { name: 'pl7.app/vdj/scClonotypeKey' },\n ],\n annotations: { 'pl7.app/isAnchor': 'true' },\n }], { refsWithEnrichments: true }),\n )\n\n .output('targetOptions', (ctx) => {\n const ref = ctx.args.datasetRef;\n if (ref === undefined) return undefined;\n\n const isSingleCell = ctx.resultPool.getPColumnSpecByRef(ref)?.axesSpec[1].name === 'pl7.app/vdj/scClonotypeKey';\n const sequenceMatchers = [];\n const allowedFeatures = ['CDR1', 'CDR2', 'CDR3', 'FR1', 'FR2',\n 'FR3', 'FR4', 'VDJRegion'];\n for (const feature of allowedFeatures) {\n if (isSingleCell) {\n sequenceMatchers.push({\n axes: [{ anchor: 'main', idx: 1 }],\n name: 'pl7.app/vdj/sequence',\n domain: {\n 'pl7.app/vdj/feature': feature,\n 'pl7.app/vdj/scClonotypeChain/index': 'primary',\n },\n });\n } else {\n sequenceMatchers.push({\n axes: [{ anchor: 'main', idx: 1 }],\n name: 'pl7.app/vdj/sequence',\n domain: {\n 'pl7.app/vdj/feature': feature,\n },\n });\n }\n }\n\n return ctx.resultPool.getCanonicalOptions(\n { main: ref },\n sequenceMatchers,\n {\n ignoreMissingDomains: true,\n labelOps: {\n includeNativeLabel: true,\n },\n });\n })\n\n .output(\n 'dataImportHandle',\n (ctx) => ctx.outputs?.resolve('dataImportHandle')?.getImportProgress(),\n { isActive: true },\n )\n\n .output('table', (ctx) => {\n if (ctx.outputs?.resolve('emptyResults')?.getDataAsJson<boolean>()) {\n return undefined;\n }\n const cols = ctx.outputs?.resolve('table')?.getPColumns();\n if (cols === undefined)\n return undefined;\n\n return createPlDataTableV2(\n ctx,\n cols,\n ctx.uiState.tableState,\n );\n })\n\n .output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)\n\n .title((ctx) => ctx.uiState.title)\n\n .sections((_ctx) => ([\n { type: 'link', href: '/', label: 'Main' },\n ]))\n\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof model>;\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as _platforma_sdk_model from '@platforma-sdk/model';
|
|
2
|
-
import { PlRef, SUniversalPColumnId, ImportFileHandle,
|
|
2
|
+
import { PlRef, SUniversalPColumnId, ImportFileHandle, PlDataTableStateV2, InferOutputsType } from '@platforma-sdk/model';
|
|
3
3
|
|
|
4
4
|
type Settings = {
|
|
5
5
|
coverageThreshold: number;
|
|
6
|
-
|
|
6
|
+
identity: number;
|
|
7
|
+
similarityType: 'sequence-identity' | 'alignment-score';
|
|
7
8
|
};
|
|
8
9
|
type ImportColumnInfo = {
|
|
9
10
|
header: string;
|
|
@@ -18,12 +19,13 @@ type BlockArgs = {
|
|
|
18
19
|
fileExtension?: string;
|
|
19
20
|
importColumns?: ImportColumnInfo[];
|
|
20
21
|
sequenceColumnHeader?: string;
|
|
22
|
+
selectedColumns: string[];
|
|
21
23
|
settings: Settings;
|
|
22
24
|
};
|
|
23
25
|
type UiState = {
|
|
24
26
|
title: string;
|
|
25
27
|
fileImportError?: string;
|
|
26
|
-
tableState:
|
|
28
|
+
tableState: PlDataTableStateV2;
|
|
27
29
|
};
|
|
28
30
|
declare const model: _platforma_sdk_model.Platforma<BlockArgs, {
|
|
29
31
|
datasetOptions: _platforma_sdk_model.ValueOrErrors<{
|
|
@@ -41,54 +43,8 @@ declare const model: _platforma_sdk_model.Platforma<BlockArgs, {
|
|
|
41
43
|
}[] | undefined>;
|
|
42
44
|
dataImportHandle: _platforma_sdk_model.ValueOrErrors<_platforma_sdk_model.ImportProgress | undefined>;
|
|
43
45
|
table: _platforma_sdk_model.ValueOrErrors<{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
id: {
|
|
47
|
-
readonly type: _platforma_sdk_model.ValueType;
|
|
48
|
-
readonly name: string;
|
|
49
|
-
readonly domain?: {
|
|
50
|
-
[x: string]: string;
|
|
51
|
-
} | undefined;
|
|
52
|
-
};
|
|
53
|
-
spec: {
|
|
54
|
-
readonly type: _platforma_sdk_model.ValueType;
|
|
55
|
-
readonly name: string;
|
|
56
|
-
readonly domain?: {
|
|
57
|
-
[x: string]: string;
|
|
58
|
-
} | undefined;
|
|
59
|
-
readonly annotations?: {
|
|
60
|
-
[x: string]: string;
|
|
61
|
-
} | undefined;
|
|
62
|
-
readonly parentAxes?: number[] | undefined;
|
|
63
|
-
};
|
|
64
|
-
} | {
|
|
65
|
-
type: "column";
|
|
66
|
-
id: _platforma_sdk_model.PObjectId;
|
|
67
|
-
spec: {
|
|
68
|
-
readonly valueType: _platforma_sdk_model.ValueType;
|
|
69
|
-
readonly kind: "PColumn";
|
|
70
|
-
readonly name: string;
|
|
71
|
-
readonly domain?: {
|
|
72
|
-
[x: string]: string;
|
|
73
|
-
} | undefined;
|
|
74
|
-
readonly annotations?: {
|
|
75
|
-
[x: string]: string;
|
|
76
|
-
} | undefined;
|
|
77
|
-
readonly parentAxes?: number[] | undefined;
|
|
78
|
-
readonly axesSpec: {
|
|
79
|
-
readonly type: _platforma_sdk_model.ValueType;
|
|
80
|
-
readonly name: string;
|
|
81
|
-
readonly domain?: {
|
|
82
|
-
[x: string]: string;
|
|
83
|
-
} | undefined;
|
|
84
|
-
readonly annotations?: {
|
|
85
|
-
[x: string]: string;
|
|
86
|
-
} | undefined;
|
|
87
|
-
readonly parentAxes?: number[] | undefined;
|
|
88
|
-
}[];
|
|
89
|
-
};
|
|
90
|
-
})[];
|
|
91
|
-
tableHandle: _platforma_sdk_model.PTableHandle;
|
|
46
|
+
fullTableHandle: _platforma_sdk_model.PTableHandle;
|
|
47
|
+
visibleTableHandle: _platforma_sdk_model.PTableHandle;
|
|
92
48
|
} | undefined>;
|
|
93
49
|
isRunning: _platforma_sdk_model.ValueOrErrors<boolean>;
|
|
94
50
|
}, UiState, "/">;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as _platforma_sdk_model from '@platforma-sdk/model';
|
|
2
|
-
import { PlRef, SUniversalPColumnId, ImportFileHandle,
|
|
2
|
+
import { PlRef, SUniversalPColumnId, ImportFileHandle, PlDataTableStateV2, InferOutputsType } from '@platforma-sdk/model';
|
|
3
3
|
|
|
4
4
|
type Settings = {
|
|
5
5
|
coverageThreshold: number;
|
|
6
|
-
|
|
6
|
+
identity: number;
|
|
7
|
+
similarityType: 'sequence-identity' | 'alignment-score';
|
|
7
8
|
};
|
|
8
9
|
type ImportColumnInfo = {
|
|
9
10
|
header: string;
|
|
@@ -18,12 +19,13 @@ type BlockArgs = {
|
|
|
18
19
|
fileExtension?: string;
|
|
19
20
|
importColumns?: ImportColumnInfo[];
|
|
20
21
|
sequenceColumnHeader?: string;
|
|
22
|
+
selectedColumns: string[];
|
|
21
23
|
settings: Settings;
|
|
22
24
|
};
|
|
23
25
|
type UiState = {
|
|
24
26
|
title: string;
|
|
25
27
|
fileImportError?: string;
|
|
26
|
-
tableState:
|
|
28
|
+
tableState: PlDataTableStateV2;
|
|
27
29
|
};
|
|
28
30
|
declare const model: _platforma_sdk_model.Platforma<BlockArgs, {
|
|
29
31
|
datasetOptions: _platforma_sdk_model.ValueOrErrors<{
|
|
@@ -41,54 +43,8 @@ declare const model: _platforma_sdk_model.Platforma<BlockArgs, {
|
|
|
41
43
|
}[] | undefined>;
|
|
42
44
|
dataImportHandle: _platforma_sdk_model.ValueOrErrors<_platforma_sdk_model.ImportProgress | undefined>;
|
|
43
45
|
table: _platforma_sdk_model.ValueOrErrors<{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
id: {
|
|
47
|
-
readonly type: _platforma_sdk_model.ValueType;
|
|
48
|
-
readonly name: string;
|
|
49
|
-
readonly domain?: {
|
|
50
|
-
[x: string]: string;
|
|
51
|
-
} | undefined;
|
|
52
|
-
};
|
|
53
|
-
spec: {
|
|
54
|
-
readonly type: _platforma_sdk_model.ValueType;
|
|
55
|
-
readonly name: string;
|
|
56
|
-
readonly domain?: {
|
|
57
|
-
[x: string]: string;
|
|
58
|
-
} | undefined;
|
|
59
|
-
readonly annotations?: {
|
|
60
|
-
[x: string]: string;
|
|
61
|
-
} | undefined;
|
|
62
|
-
readonly parentAxes?: number[] | undefined;
|
|
63
|
-
};
|
|
64
|
-
} | {
|
|
65
|
-
type: "column";
|
|
66
|
-
id: _platforma_sdk_model.PObjectId;
|
|
67
|
-
spec: {
|
|
68
|
-
readonly valueType: _platforma_sdk_model.ValueType;
|
|
69
|
-
readonly kind: "PColumn";
|
|
70
|
-
readonly name: string;
|
|
71
|
-
readonly domain?: {
|
|
72
|
-
[x: string]: string;
|
|
73
|
-
} | undefined;
|
|
74
|
-
readonly annotations?: {
|
|
75
|
-
[x: string]: string;
|
|
76
|
-
} | undefined;
|
|
77
|
-
readonly parentAxes?: number[] | undefined;
|
|
78
|
-
readonly axesSpec: {
|
|
79
|
-
readonly type: _platforma_sdk_model.ValueType;
|
|
80
|
-
readonly name: string;
|
|
81
|
-
readonly domain?: {
|
|
82
|
-
[x: string]: string;
|
|
83
|
-
} | undefined;
|
|
84
|
-
readonly annotations?: {
|
|
85
|
-
[x: string]: string;
|
|
86
|
-
} | undefined;
|
|
87
|
-
readonly parentAxes?: number[] | undefined;
|
|
88
|
-
}[];
|
|
89
|
-
};
|
|
90
|
-
})[];
|
|
91
|
-
tableHandle: _platforma_sdk_model.PTableHandle;
|
|
46
|
+
fullTableHandle: _platforma_sdk_model.PTableHandle;
|
|
47
|
+
visibleTableHandle: _platforma_sdk_model.PTableHandle;
|
|
92
48
|
} | undefined>;
|
|
93
49
|
isRunning: _platforma_sdk_model.ValueOrErrors<boolean>;
|
|
94
50
|
}, UiState, "/">;
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { BlockModel, createPlDataTableV2 } from '@platforma-sdk/model';
|
|
1
|
+
import { BlockModel, createPlDataTableStateV2, createPlDataTableV2 } from '@platforma-sdk/model';
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
var model = BlockModel.create().withArgs({
|
|
5
5
|
settings: {
|
|
6
|
-
|
|
7
|
-
// default to coverage of clone,
|
|
8
|
-
coverageThreshold: 0.95
|
|
6
|
+
coverageThreshold: 0.95,
|
|
9
7
|
// default value matching MMseqs2 default
|
|
10
|
-
|
|
8
|
+
identity: 0.9,
|
|
9
|
+
similarityType: "alignment-score"
|
|
10
|
+
},
|
|
11
|
+
selectedColumns: []
|
|
11
12
|
}).withUiState({
|
|
12
13
|
title: "Immune Assay Data",
|
|
13
|
-
tableState:
|
|
14
|
-
gridState: {}
|
|
15
|
-
}
|
|
14
|
+
tableState: createPlDataTableStateV2()
|
|
16
15
|
}).argsValid(
|
|
17
16
|
(ctx) => ctx.args.datasetRef !== void 0 && ctx.args.fileHandle !== void 0 && ctx.args.importColumns !== void 0 && ctx.args.sequenceColumnHeader !== void 0 && ctx.args.targetRef !== void 0 && ctx.uiState.fileImportError === void 0
|
|
18
17
|
).output(
|
|
@@ -80,13 +79,15 @@ var model = BlockModel.create().withArgs({
|
|
|
80
79
|
(ctx) => ctx.outputs?.resolve("dataImportHandle")?.getImportProgress(),
|
|
81
80
|
{ isActive: true }
|
|
82
81
|
).output("table", (ctx) => {
|
|
82
|
+
if (ctx.outputs?.resolve("emptyResults")?.getDataAsJson()) {
|
|
83
|
+
return void 0;
|
|
84
|
+
}
|
|
83
85
|
const cols = ctx.outputs?.resolve("table")?.getPColumns();
|
|
84
86
|
if (cols === void 0)
|
|
85
87
|
return void 0;
|
|
86
88
|
return createPlDataTableV2(
|
|
87
89
|
ctx,
|
|
88
90
|
cols,
|
|
89
|
-
(_) => true,
|
|
90
91
|
ctx.uiState.tableState
|
|
91
92
|
);
|
|
92
93
|
}).output("isRunning", (ctx) => ctx.outputs?.getIsReadyOrError() === false).title((ctx) => ctx.uiState.title).sections((_ctx) => [
|
package/dist/index.js.map
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AAsB,EAAA,IAAA;AAAA,MACtB,QAAU,EAAA;AAAA,QACR,kBAAoB,EAAA;AAAA;AACtB;AACF,GAAC;AACL,CAAC,CAEA,CAAA,MAAA;AAAA,EACC,kBAAA;AAAA,EACA,CAAC,GAAQ,KAAA,GAAA,CAAI,SAAS,OAAQ,CAAA,kBAAkB,GAAG,iBAAkB,EAAA;AAAA,EACrE,EAAE,UAAU,IAAK;AACnB,CAEC,CAAA,MAAA,CAAO,OAAS,EAAA,CAAC,GAAQ,KAAA;AACxB,EAAA,IAAI,IAAI,OAAS,EAAA,OAAA,CAAQ,cAAc,CAAA,EAAG,eAA0B,EAAA;AAClE,IAAO,OAAA,MAAA;AAAA;AAET,EAAA,MAAM,OAAO,GAAI,CAAA,OAAA,EAAS,OAAQ,CAAA,OAAO,GAAG,WAAY,EAAA;AACxD,EAAA,IAAI,IAAS,KAAA,MAAA;AACX,IAAO,OAAA,MAAA;AAET,EAAO,OAAA,mBAAA;AAAA,IACL,GAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAI,OAAQ,CAAA;AAAA,GACd;AACF,CAAC,CAAA,CAEA,OAAO,WAAa,EAAA,CAAC,QAAQ,GAAI,CAAA,OAAA,EAAS,mBAAwB,KAAA,KAAK,EAEvE,KAAM,CAAA,CAAC,QAAQ,GAAI,CAAA,OAAA,CAAQ,KAAK,CAEhC,CAAA,QAAA,CAAS,CAAC,IAAU,KAAA;AAAA,EACnB,EAAE,IAAM,EAAA,MAAA,EAAQ,IAAM,EAAA,GAAA,EAAK,OAAO,MAAO;AAC3C,CAAE,EAED,IAAK","file":"index.js","sourcesContent":["import type {\n ImportFileHandle,\n InferOutputsType,\n PlDataTableStateV2,\n PlRef,\n SUniversalPColumnId\n} from '@platforma-sdk/model';\nimport {\n BlockModel,\n createPlDataTableStateV2,\n createPlDataTableV2,\n} from '@platforma-sdk/model';\n\ntype Settings = {\n coverageThreshold: number; // fraction of aligned residues required\n identity: number;\n similarityType: 'sequence-identity' | 'alignment-score';\n};\n\nexport type ImportColumnInfo = {\n header: string;\n type: 'Int' | 'Double' | 'String';\n /** If this column is a sequence column, the type of the sequence */\n sequenceType?: 'nucleotide' | 'aminoacid';\n};\n\nexport type BlockArgs = {\n datasetRef?: PlRef;\n targetRef?: SUniversalPColumnId;\n fileHandle?: ImportFileHandle;\n fileExtension?: string;\n importColumns?: ImportColumnInfo[];\n sequenceColumnHeader?: string;\n selectedColumns: string[];\n settings: Settings;\n};\n\nexport type UiState = {\n title: string;\n fileImportError?: string;\n tableState: PlDataTableStateV2;\n};\n\nexport const model = BlockModel.create()\n\n .withArgs<BlockArgs>({\n settings: {\n coverageThreshold: 0.95, // default value matching MMseqs2 default\n identity: 0.9,\n similarityType: 'alignment-score',\n },\n selectedColumns: [],\n })\n\n .withUiState<UiState>({\n title: 'Immune Assay Data',\n tableState: createPlDataTableStateV2(),\n })\n\n .argsValid((ctx) =>\n ctx.args.datasetRef !== undefined\n && ctx.args.fileHandle !== undefined\n && ctx.args.importColumns !== undefined\n && ctx.args.sequenceColumnHeader !== undefined\n && ctx.args.targetRef !== undefined\n && ctx.uiState.fileImportError === undefined,\n )\n\n .output('datasetOptions', (ctx) =>\n ctx.resultPool.getOptions([{\n axes: [\n { name: 'pl7.app/sampleId' },\n { name: 'pl7.app/vdj/clonotypeKey' },\n ],\n annotations: { 'pl7.app/isAnchor': 'true' },\n }, {\n axes: [\n { name: 'pl7.app/sampleId' },\n { name: 'pl7.app/vdj/scClonotypeKey' },\n ],\n annotations: { 'pl7.app/isAnchor': 'true' },\n }], { refsWithEnrichments: true }),\n )\n\n .output('targetOptions', (ctx) => {\n const ref = ctx.args.datasetRef;\n if (ref === undefined) return undefined;\n\n const isSingleCell = ctx.resultPool.getPColumnSpecByRef(ref)?.axesSpec[1].name === 'pl7.app/vdj/scClonotypeKey';\n const sequenceMatchers = [];\n const allowedFeatures = ['CDR1', 'CDR2', 'CDR3', 'FR1', 'FR2',\n 'FR3', 'FR4', 'VDJRegion'];\n for (const feature of allowedFeatures) {\n if (isSingleCell) {\n sequenceMatchers.push({\n axes: [{ anchor: 'main', idx: 1 }],\n name: 'pl7.app/vdj/sequence',\n domain: {\n 'pl7.app/vdj/feature': feature,\n 'pl7.app/vdj/scClonotypeChain/index': 'primary',\n },\n });\n } else {\n sequenceMatchers.push({\n axes: [{ anchor: 'main', idx: 1 }],\n name: 'pl7.app/vdj/sequence',\n domain: {\n 'pl7.app/vdj/feature': feature,\n },\n });\n }\n }\n\n return ctx.resultPool.getCanonicalOptions(\n { main: ref },\n sequenceMatchers,\n {\n ignoreMissingDomains: true,\n labelOps: {\n includeNativeLabel: true,\n },\n });\n })\n\n .output(\n 'dataImportHandle',\n (ctx) => ctx.outputs?.resolve('dataImportHandle')?.getImportProgress(),\n { isActive: true },\n )\n\n .output('table', (ctx) => {\n if (ctx.outputs?.resolve('emptyResults')?.getDataAsJson<boolean>()) {\n return undefined;\n }\n const cols = ctx.outputs?.resolve('table')?.getPColumns();\n if (cols === undefined)\n return undefined;\n\n return createPlDataTableV2(\n ctx,\n cols,\n ctx.uiState.tableState,\n );\n })\n\n .output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)\n\n .title((ctx) => ctx.uiState.title)\n\n .sections((_ctx) => ([\n { type: 'link', href: '/', label: 'Main' },\n ]))\n\n .done();\n\nexport type BlockOutputs = InferOutputsType<typeof model>;\n"]}
|