Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolotin committed Aug 29, 2024
1 parent f2e3fc6 commit 05f5d6a
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
3 changes: 3 additions & 0 deletions test/assets/expected_results/mixcr.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash

set -e

mixcr exportPreset --preset-name milab-human-dna-xcr-7genes-multiplex preset.json
mixcr analyze milab-human-dna-xcr-7genes-multiplex ../small_data_R1.fastq.gz ../small_data_R2.fastq.gz result
1 change: 1 addition & 0 deletions test/src/wf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ blockTest(
clonotypingBlockId,
10000
);

console.dir(clonotypingStableState2, { depth: 5 });
}
);
19 changes: 18 additions & 1 deletion workflow/src/mixcr-analyze.tpl.tengo
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ self := import("@milaboratory/tengo-sdk:tpl")
pConstants := import("@milaboratory/tengo-sdk:pframes.constants")
ll := import("@milaboratory/tengo-sdk:ll")
exec := import("@milaboratory/tengo-sdk:exec")
smart := import("@milaboratory/tengo-sdk:smart")

json := import("json")

Expand All @@ -15,6 +16,7 @@ self.body(func(inputs) {
params := inputs.params
preset := params.preset
fileExtension := params.fileExtension
reports := params.reports

presetContent := inputs.presetContent.getDataAsJson()
pfconvParams := inputs.pfconvParams // already in JSON
Expand Down Expand Up @@ -51,10 +53,25 @@ self.body(func(inputs) {

mixcrCmdBuilder.saveFile("result.qc.json")

for report in reports {
mixcrCmdBuilder.saveFile(report.fileJson)
mixcrCmdBuilder.saveFile(report.fileTxt)
}

mixcrCmd := mixcrCmdBuilder.run()

reportsMap := smart.structBuilder(
pConstants.RTYPE_P_COLUMN_DATA_RESOURCE_MAP,
json.encode({ keyLength: groupKeyLength })
)
for report in reports {
reportsMap.createInputField(json.encode([report.id, "json"])).set(mixcrCmd.saveFile(report.fileJson))
reportsMap.createInputField(json.encode([report.id, "txt"])).set(mixcrCmd.saveFile(report.fileTxt))
}

return {
qc: mixcrCmd.getFile("result.qc.json")
qc: mixcrCmd.getFile("result.qc.json"),
reports: reportsMap.lockAndBuild()
}
} else {
ll.panic("not yet supported")
Expand Down
20 changes: 19 additions & 1 deletion workflow/src/process.tpl.tengo
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ self.body(func(inputs) {
presetContent := self.rawInputs().presetContent
pfconvParams := self.rawInputs().pfconvParams

reports := []

for step in presetContent.pipeline {
if step == "align" || step == "assemble" {
reports = append(reports, {
id: step,
fileJson: "result." + step + ".report.json"
fileTxt: "result." + step + ".report.txt"
})
}
}


if is_undefined(presetContent) {
ll.panic("no presetContent")
}
Expand All @@ -38,12 +51,17 @@ self.body(func(inputs) {
[{
type: "Resource",
name: "qc"
}, {
type: "ResourceMap",
name: "reports",
keyLength: 2 // [reportType, reportFormat]
}],
false,
{
params: smart.createJsonResource({
preset: preset,
fileExtension: fileExtension
fileExtension: fileExtension,
reports: reports
}),
presetContent: presetContent,
pfconvParams: pfconvParams
Expand Down

0 comments on commit 05f5d6a

Please sign in to comment.