-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
198 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,10 @@ import * as tp from 'node:timers/promises'; | |
|
||
blockTest('empty imputs', { timeout: 10000 }, async ({ rawPrj: project, ml, helpers, expect }) => { | ||
const blockId = await project.addBlock('Block', myBlockSpec); | ||
await project.runBlock(blockId); | ||
const stableState = await helpers.awaitBlockDoneAndGetStableBlockState<typeof platforma>( | ||
blockId, | ||
const stableState = await awaitStableState( | ||
project.getBlockState(blockId), | ||
5000 | ||
); | ||
) as InferBlockState<typeof platforma>; | ||
expect(stableState.outputs).toMatchObject({ inputOptions: { ok: true, value: [] } }); | ||
const presetsOutput = wrapOutputs(stableState.outputs).presets; | ||
Check failure on line 21 in test/src/wf.test.ts
|
||
const presetsStr = Buffer.from( | ||
|
@@ -27,6 +26,22 @@ blockTest('empty imputs', { timeout: 10000 }, async ({ rawPrj: project, ml, help | |
expect(presets).length.gt(10); | ||
}); | ||
|
||
blockTest( | ||
'preset content', | ||
{ timeout: 10000 }, | ||
async ({ rawPrj: project, ml, helpers, expect }) => { | ||
const blockId = await project.addBlock('Block', myBlockSpec); | ||
await project.setBlockArgs(blockId, { | ||
preset: 'milab-human-dna-xcr-7genes-multiplex' | ||
} satisfies BlockArgs); | ||
const stableState = await awaitStableState( | ||
project.getBlockState(blockId), | ||
5000 | ||
) as InferBlockState<typeof platforma>; | ||
expect(stableState.outputs).toMatchObject({ preset: { ok: true } }); | ||
Check failure on line 41 in test/src/wf.test.ts
|
||
} | ||
); | ||
|
||
blockTest( | ||
'simple project', | ||
{ timeout: 20000 }, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import fs from 'node:fs/promises' | ||
|
||
const jsonContent = await fs.readFile(process.argv[2]) | ||
fs.writeFile(process.argv[3], "export " + jsonContent) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// calculate-pfconv-params | ||
|
||
self := import("@milaboratory/tengo-sdk:tpl") | ||
|
||
pvconfParams := import(":pfconv_params") | ||
|
||
self.defineOutputs("params") | ||
|
||
self.body(func(inputs) { | ||
// preset content | ||
preset := inputs.preset | ||
|
||
return { | ||
params: pvconfParams | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// get preset | ||
|
||
self := import("@milaboratory/tengo-sdk:tpl") | ||
ll := import("@milaboratory/tengo-sdk:ll") | ||
exec := import("@milaboratory/tengo-sdk:exec") | ||
|
||
self.defineOutputs("preset") | ||
|
||
self.body(func(inputs) { | ||
preset := inputs.preset | ||
|
||
if !is_string(preset) { | ||
ll.panic("preset is not string: %v", preset) | ||
} | ||
|
||
mixcrCmd := exec.builder(). | ||
printErrStreamToStdout(). | ||
cmd("mixcr"). | ||
arg("exportPreset"). | ||
arg("--preset-name"). | ||
arg(preset). | ||
arg("preset.json"). | ||
saveFileContent("preset.json"). | ||
run() | ||
|
||
presetContent := mixcrCmd.getFileContent("preset.json") | ||
|
||
return { | ||
preset: presetContent | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// list presets | ||
|
||
self := import("@milaboratory/tengo-sdk:tpl") | ||
ll := import("@milaboratory/tengo-sdk:ll") | ||
exec := import("@milaboratory/tengo-sdk:exec") | ||
file := import("@milaboratory/tengo-sdk:file") | ||
|
||
self.defineOutputs("presets") | ||
|
||
self.body(func(inputs) { | ||
listPresets := exec.builder(). | ||
cmd("mixcr"). | ||
arg("listPresetSpecificationsForUI"). | ||
arg("presets.json"). | ||
inUiQueue(). | ||
saveFile("presets.json"). | ||
run() | ||
|
||
return { | ||
presets: file.exportFile(listPresets.getFile("presets.json")) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
export { | ||
"axes": [ | ||
{ | ||
"column": "cloneId", | ||
"spec": { | ||
"name": "pl7.app/vdj/cloneId", | ||
"type": "Long" | ||
} | ||
} | ||
], | ||
"columns": [ | ||
{ | ||
"column": "readCount", | ||
"id": "read-count", | ||
"name": "pl7.app/vdj/readCount", | ||
"type": "Long", | ||
"annotations": { | ||
"pl7.app/label": "Number Of Reads" | ||
} | ||
}, | ||
{ | ||
"column": "nSeqCDR3", | ||
"id": "n-seq-cdr3", | ||
"type": "String", | ||
"name": "pl7.app/vdj/nucleotideSequence", | ||
"domain": { | ||
"pl7.app/vdj/feature": "CDR3" | ||
}, | ||
"annotations": { | ||
"pl7.app/label": "CDR3 Nucleotide Sequence" | ||
} | ||
} | ||
], | ||
"storageFormat": "Binary", | ||
"partitionKeyLength": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
// pre-run | ||
|
||
wf := import("@milaboratory/tengo-sdk:workflow") | ||
exec := import("@milaboratory/tengo-sdk:exec") | ||
file := import("@milaboratory/tengo-sdk:file") | ||
render := import("@milaboratory/tengo-sdk:render") | ||
ll := import("@milaboratory/tengo-sdk:ll") | ||
|
||
listPresetsTpl := ll.importTemplate(":list-presets") | ||
getPresetTpl := ll.importTemplate(":get-preset") | ||
|
||
wf.body(func(args) { | ||
|
||
listPresets := exec.builder(). | ||
cmd("mixcr"). | ||
arg("listPresetSpecificationsForUI"). | ||
arg("presets.json"). | ||
inUiQueue(). | ||
cache(24 * 60 * 60 * 1000). | ||
saveFile("presets.json"). | ||
run() | ||
outputs := {} | ||
|
||
listPresets := render.create(listPresetsTpl, {}) | ||
outputs.presets = listPresets.output("presets", 24 * 60 * 60 * 1000) | ||
|
||
if is_string(args.preset) { | ||
getPreset := render.create(getPresetTpl, { | ||
preset: args.preset | ||
}) | ||
outputs.preset = getPreset.output("preset", 24 * 60 * 60 * 1000) | ||
} | ||
|
||
return { | ||
outputs: { | ||
presets: file.exportFile(listPresets.getFile("presets.json")) | ||
}, | ||
outputs: outputs, | ||
exports: {} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters