@platforma-open/milaboratories.samples-and-data.workflow 2.2.1 → 2.3.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.cjs +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/tengo/lib/ds-multisample-seurat.lib.tengo +70 -0
- package/dist/tengo/lib/ds-seurat.lib.tengo +34 -0
- package/dist/tengo/tpl/main.plj.gz +0 -0
- package/dist/tengo/tpl/parse-bulk-count-matrix.plj.gz +0 -0
- package/dist/tengo/tpl/parse-multisample-h5ad.plj.gz +0 -0
- package/dist/tengo/tpl/parse-multisample-seurat.plj.gz +0 -0
- package/dist/tengo/tpl/prerun.plj.gz +0 -0
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
module.exports = { Templates: {
|
|
2
2
|
'parse-bulk-count-matrix': { type: 'from-file', path: require.resolve('./tengo/tpl/parse-bulk-count-matrix.plj.gz') },
|
|
3
3
|
'parse-multisample-h5ad': { type: 'from-file', path: require.resolve('./tengo/tpl/parse-multisample-h5ad.plj.gz') },
|
|
4
|
+
'parse-multisample-seurat': { type: 'from-file', path: require.resolve('./tengo/tpl/parse-multisample-seurat.plj.gz') },
|
|
4
5
|
'prerun': { type: 'from-file', path: require.resolve('./tengo/tpl/prerun.plj.gz') },
|
|
5
6
|
'main': { type: 'from-file', path: require.resolve('./tengo/tpl/main.plj.gz') }
|
|
6
7
|
}};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare type TemplateFromFile = { readonly type: "from-file"; readonly path: string; };
|
|
2
|
-
declare type TplName = "parse-bulk-count-matrix" | "parse-multisample-h5ad" | "prerun" | "main";
|
|
2
|
+
declare type TplName = "parse-bulk-count-matrix" | "parse-multisample-h5ad" | "parse-multisample-seurat" | "prerun" | "main";
|
|
3
3
|
declare const Templates: Record<TplName, TemplateFromFile>;
|
|
4
4
|
export { Templates };
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { resolve } from 'node:path';
|
|
|
2
2
|
export const Templates = {
|
|
3
3
|
'parse-bulk-count-matrix': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/parse-bulk-count-matrix.plj.gz') },
|
|
4
4
|
'parse-multisample-h5ad': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/parse-multisample-h5ad.plj.gz') },
|
|
5
|
+
'parse-multisample-seurat': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/parse-multisample-seurat.plj.gz') },
|
|
5
6
|
'prerun': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/prerun.plj.gz') },
|
|
6
7
|
'main': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/main.plj.gz') }
|
|
7
8
|
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
ll := import("@platforma-sdk/workflow-tengo:ll")
|
|
2
|
+
render := import("@platforma-sdk/workflow-tengo:render")
|
|
3
|
+
assets := import("@platforma-sdk/workflow-tengo:assets")
|
|
4
|
+
pColumn := import("@platforma-sdk/workflow-tengo:pframes.pcolumn")
|
|
5
|
+
parseSeuratTpl := assets.importTemplate("@platforma-open/milaboratories.samples-and-data.workflow:parse-multisample-seurat")
|
|
6
|
+
|
|
7
|
+
util := import("@platforma-open/milaboratories.samples-and-data.workflow:util")
|
|
8
|
+
|
|
9
|
+
getColumns := func(fImport, importFile) {
|
|
10
|
+
seuratFile := importFile(fImport)
|
|
11
|
+
columnsCsv := render.create(parseSeuratTpl, {
|
|
12
|
+
seuratFile: seuratFile,
|
|
13
|
+
sampleColumnName: "sample"
|
|
14
|
+
}).output("columnsCsv")
|
|
15
|
+
|
|
16
|
+
return columnsCsv
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
getSamples := func(dataset, importFile) {
|
|
20
|
+
result := {}
|
|
21
|
+
sampleColumnName := dataset.content.sampleColumnName
|
|
22
|
+
if !sampleColumnName {
|
|
23
|
+
sampleColumnName = "sample"
|
|
24
|
+
}
|
|
25
|
+
for groupId, importHandle in dataset.content.data {
|
|
26
|
+
if !importHandle {
|
|
27
|
+
ll.panic("File handle not set for group %v", groupId)
|
|
28
|
+
}
|
|
29
|
+
seuratFile := importFile(importHandle)
|
|
30
|
+
samplesCsv := render.create(parseSeuratTpl, {
|
|
31
|
+
seuratFile: seuratFile,
|
|
32
|
+
sampleColumnName: sampleColumnName
|
|
33
|
+
}).output("samplesCsv")
|
|
34
|
+
result[groupId] = samplesCsv
|
|
35
|
+
}
|
|
36
|
+
return result
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
createDataset := func(blockId, sampleIdAxis, groupIdAxis, dataset, importFile) {
|
|
40
|
+
|
|
41
|
+
extension := "rds"
|
|
42
|
+
|
|
43
|
+
spec := util.datasetColumnSpecBase(blockId, dataset, extension)
|
|
44
|
+
spec.axesSpec = [groupIdAxis]
|
|
45
|
+
|
|
46
|
+
data := pColumn.resourceMapBuilder(1)
|
|
47
|
+
for groupId, importHandle in dataset.content.data {
|
|
48
|
+
if !importHandle {
|
|
49
|
+
ll.panic("File handle not set for sample %v", groupId)
|
|
50
|
+
}
|
|
51
|
+
data.add([groupId], importFile(importHandle))
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
result := {}
|
|
55
|
+
result["dataset." + dataset.id] = {
|
|
56
|
+
spec: spec,
|
|
57
|
+
data: data.build()
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return result
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
isGrouped: true,
|
|
65
|
+
getColumns: getColumns,
|
|
66
|
+
getSamples: getSamples,
|
|
67
|
+
createDataset: createDataset
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
ll := import("@platforma-sdk/workflow-tengo:ll")
|
|
3
|
+
pColumn := import("@platforma-sdk/workflow-tengo:pframes.pcolumn")
|
|
4
|
+
|
|
5
|
+
util := import("@platforma-open/milaboratories.samples-and-data.workflow:util")
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
isGrouped: false,
|
|
9
|
+
|
|
10
|
+
createDataset: func(blockId, sampleIdAxis, dataset, importFile) {
|
|
11
|
+
extension := "rds"
|
|
12
|
+
|
|
13
|
+
spec := util.datasetColumnSpecBase(blockId, dataset, extension)
|
|
14
|
+
spec.axesSpec = [sampleIdAxis]
|
|
15
|
+
|
|
16
|
+
data := pColumn.resourceMapBuilder(1)
|
|
17
|
+
for sampleId, importHandle in dataset.content.data {
|
|
18
|
+
if !importHandle {
|
|
19
|
+
ll.panic("File handle not set for sample %v", sampleId)
|
|
20
|
+
}
|
|
21
|
+
data.add([sampleId], importFile(importHandle))
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
result := {}
|
|
25
|
+
result["dataset." + dataset.id] = {
|
|
26
|
+
spec: spec,
|
|
27
|
+
data: data.build()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return result
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-open/milaboratories.samples-and-data.workflow",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"./dist/**/*"
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
"description": "Tengo-based template",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@platforma-sdk/workflow-tengo": "5.6.1",
|
|
11
|
-
"@platforma-open/milaboratories.samples-and-data.parse-h5ad": "1.1.1"
|
|
11
|
+
"@platforma-open/milaboratories.samples-and-data.parse-h5ad": "1.1.1",
|
|
12
|
+
"@platforma-open/milaboratories.samples-and-data.parse-seurat": "1.1.0"
|
|
12
13
|
},
|
|
13
14
|
"devDependencies": {
|
|
14
|
-
"@platforma-sdk/tengo-builder": "2.3.
|
|
15
|
+
"@platforma-sdk/tengo-builder": "2.3.10"
|
|
15
16
|
},
|
|
16
17
|
"scripts": {
|
|
17
18
|
"build": "rm -rf dist/* && pl-tengo check && pl-tengo build",
|