Skip to content

Commit

Permalink
fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolotin committed Sep 7, 2024
1 parent ae0a61a commit 7ef00a2
Show file tree
Hide file tree
Showing 5 changed files with 749 additions and 713 deletions.
8 changes: 8 additions & 0 deletions test/src/wf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ blockTest(

const clonesPfColumnList = await ml.driverKit.pFrameDriver.listColumns(clonesPfHandle);

expect(
clonesPfColumnList[0].spec.axesSpec.find((s: any) => s.name === 'pl7.app/vdj/cloneId')
).toMatchObject({
domain: {
'pl7.app/blockId': clonotypingBlockId
}
});

// console.log(clonesPfColumnList);
expect(clonesPfColumnList).length.to.greaterThanOrEqual(7);

Expand Down
17 changes: 16 additions & 1 deletion workflow/src/calculate-pfconv-params.tpl.tengo
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
// calculate-pfconv-params
self := import("@milaboratory/tengo-sdk:tpl")
// validation := import("@milaboratory/tengo-sdk:validation")

pvconfParams := import(":pfconv_params")
pvconfParamsLib := import(":pfconv_params")

json := import("json")

// self.validateInputs({
// "__options__,closed": "",
// "request": {
// "__options__,closed": "",
// "blockId": ["not", validation.resource()],
// "specs,omitempty": ["not", validation.resource()]
// }
// })

self.defineOutputs("params")

self.body(func(inputs) {

blockId := inputs.blockId

// filter function
filter := func(list, predicate) {
result := []
Expand All @@ -33,6 +45,7 @@ self.body(func(inputs) {
// get specs and preset data
specs := inputs.specs.getDataAsJson()
preset := inputs.preset.getDataAsJson()

//if using readCount or umiCount
columnsList := []
columnsOrder := []
Expand Down Expand Up @@ -63,6 +76,8 @@ self.body(func(inputs) {
}
}

pvconfParams := pvconfParamsLib.getColumns(blockId)

// filter pvconfParams by column name and get a list of fields from it
columns := []
for col in columnsList {
Expand Down
12 changes: 10 additions & 2 deletions workflow/src/main.tpl.tengo
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ processTpl := assets.importTemplate(":process")
wf.setPreRun(assets.importTemplate(":prerun"))

wf.body(func(args) {
blockId := wf.blockId().getDataAsJson()

inputRef := args.input

preset := args.preset
Expand All @@ -38,6 +40,7 @@ wf.body(func(args) {
specsContent := getPreset.output("presetSpecForBack", 24 * 60 * 60 * 1000)

calculatePfconvParams := render.create(calculatePfconvParamsTpl, {
blockId: blockId,
preset: presetContent,
specs: specsContent
})
Expand All @@ -46,7 +49,8 @@ wf.body(func(args) {
runMixcr := render.createEphemeral(processTpl, {
params: smart.createJsonResource({
preset: preset,
species: species
species: species,
blockId: blockId
}),
presetContent: specsContent,
pfconvParams: pfconvParams,
Expand All @@ -63,7 +67,11 @@ wf.body(func(args) {
spec: runMixcr.output("reports.spec"),
data: runMixcr.output("reports.data")
},
clones: runMixcr.output("clones")
clones: runMixcr.output("clones"),
clns: {
spec: runMixcr.output("clns.spec"),
data: runMixcr.output("clns.data")
}
}

outputs := {
Expand Down
Loading

0 comments on commit 7ef00a2

Please sign in to comment.