From 7ef00a2c780051e810af78a2f91b574e50800741 Mon Sep 17 00:00:00 2001 From: Dmitry Bolotin Date: Sat, 7 Sep 2024 19:42:29 +0200 Subject: [PATCH] fixes and improvements --- test/src/wf.test.ts | 8 + .../src/calculate-pfconv-params.tpl.tengo | 17 +- workflow/src/main.tpl.tengo | 12 +- workflow/src/pfconv_params.lib.tengo | 1403 ++++++++--------- workflow/src/process.tpl.tengo | 22 + 5 files changed, 749 insertions(+), 713 deletions(-) diff --git a/test/src/wf.test.ts b/test/src/wf.test.ts index 08d88de..86d9328 100644 --- a/test/src/wf.test.ts +++ b/test/src/wf.test.ts @@ -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); diff --git a/workflow/src/calculate-pfconv-params.tpl.tengo b/workflow/src/calculate-pfconv-params.tpl.tengo index 5cbc08f..810739f 100644 --- a/workflow/src/calculate-pfconv-params.tpl.tengo +++ b/workflow/src/calculate-pfconv-params.tpl.tengo @@ -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 := [] @@ -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 := [] @@ -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 { diff --git a/workflow/src/main.tpl.tengo b/workflow/src/main.tpl.tengo index 6a80b67..d0deb28 100644 --- a/workflow/src/main.tpl.tengo +++ b/workflow/src/main.tpl.tengo @@ -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 @@ -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 }) @@ -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, @@ -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 := { diff --git a/workflow/src/pfconv_params.lib.tengo b/workflow/src/pfconv_params.lib.tengo index b740d57..2e7ce8d 100644 --- a/workflow/src/pfconv_params.lib.tengo +++ b/workflow/src/pfconv_params.lib.tengo @@ -1,712 +1,695 @@ -export { - "axes": [ - { - "column": "cloneId", - "spec": { - "name": "pl7.app/vdj/cloneId", - "type": "Long", - "annotations": { - "pl7.app/label": "Clone id" - } - } - }, { - "column": "tagValueCELL", - "spec": { - "name": "pl7.app/vdj/tagValueCELL", - "type": "String", - "annotations": { - "pl7.app/label": "Cell tag" - } - } - } - ], - "columns": [ - { - "column": "cellGroup", - "id": "cell-group", - "allowNA": false, - "spec": { - "name": "pl7.app/vdj/cellGroup", - "valueType": "Long", - "annotations": { - "pl7.app/label": "Cell group number" - } - } - }, { - "column": "readCount", - "id": "read-count", - "allowNA": false, - "spec": { - "name": "pl7.app/vdj/readCount", - "valueType": "Long", - "annotations": { - "pl7.app/label": "Number Of Reads" - } - } - }, { - "column": "readFraction", - "id": "read-fraction", - "allowNA": false, - "spec": { - "name": "pl7.app/vdj/readFraction", - "valueType": "Float", - "annotations": { - "pl7.app/label": "Fraction of reads" - } - } - }, { - "column": "uniqueMoleculeCount", - "id": "umi-count", - "allowNA": false, - "spec": { - "name": "pl7.app/vdj/uniqueMoleculeCount", - "valueType": "Long", - "annotations": { - "pl7.app/label": "Number of UMI" - } - } - }, { - "column": "uniqueMoleculeFraction", - "id": "umi-fraction", - "allowNA": false, - "spec": { - "name": "pl7.app/vdj/uniqueMoleculeFraction", - "valueType": "Float", - "annotations": { - "pl7.app/label": "Fraction of UMI" - } - } - }, { - "column": "targetSequences", - "id": "n-seq-clonal-sequences", - "allowNA": false, - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/sequence": "clonalSequence", - "pl7.app/alphabet": "nucleotide" - }, - "annotations": { - "pl7.app/type": "sequence", - "pl7.app/label": "Clonal sequences" - } - } - }, { - "column": "targetQualities", - "id": "clonal-qualities", - "allowNA": false, - "spec": { - "name": "pl7.app/vdj/sequenceQuality", - "valueType": "String", - "domain": { - "pl7.app/vdj/quality": "clonalQuality" - }, - "annotations": { - "type": "quality string", - "pl7.app/label": "Clonal qualities" - } - } - }, { - "column": "bestVHit", - "id": "best-v-hit", - "allowNA": false, - "spec": { - "name": "pl7.app/vdj/geneHit", - "valueType": "String", - "domain": { - "pl7.app/vdj/reference": "VGene" - }, - "annotations": { - "type": "V gene name", - "pl7.app/label": "Best V hit" - } - } - }, { - "column": "bestDHit", - "id": "best-d-hit", - "spec": { - "name": "pl7.app/vdj/geneHit", - "valueType": "String", - "domain": { - "pl7.app/vdj/reference": "DGene" - }, - "annotations": { - "type": "D gene name", - "pl7.app/label": "Best D hit" - } - } - }, { - "column": "bestJHit", - "id": "best-j-hit", - "allowNA": false, - "spec": { - "name": "pl7.app/vdj/geneHit", - "valueType": "String", - "domain": { - "pl7.app/vdj/reference": "JGene" - }, - "annotations": { - "type": "J gene name", - "pl7.app/label": "Best J hit" - } - } - }, { - "column": "bestCHit", - "id": "best-c-hit", - "spec": { - "name": "pl7.app/vdj/geneHit", - "valueType": "String", - "domain": { - "pl7.app/vdj/reference": "CGene" - }, - "annotations": { - "type": "C gene name", - "pl7.app/label": "Best C hit" - } - } - }, { - "column": "nSeqFR1", - "id": "n-seq-fr1", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/feature": "FR1", - "pl7.app/alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR1 nt" - } - } - }, { - "column": "minQualFR1", - "id": "min-qual-fr1", - "spec": { - "name": "pl7.app/vdj/sequenceQuality", - "valueType": "Int", - "domain": { - "pl7.app/vdj/quality": "minQuality", - "pl7.app/vdj/feature": "FR1" - }, - "annotations": { - "pl7.app/label": "Min quality FR1" - } - } - }, { - "column": "nSeqFR2", - "id": "n-seq-fr2", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", +ll := import("@milaboratory/tengo-sdk:ll") - "domain": { - "pl7.app/vdj/feature": "FR2", - "pl7.app/alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR2 nt" - } - } - }, { - "column": "minQualFR2", - "id": "min-qual-fr2", - "spec": { - "name": "pl7.app/vdj/sequenceQuality", - "valueType": "Int", - "domain": { - "pl7.app/vdj/quality": "minQuality", - "pl7.app/vdj/feature": "FR2" - }, - "annotations": { - "pl7.app/label": "Min quality FR2" - } - } - }, { - "column": "nSeqFR3", - "id": "n-seq-fr3", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/feature": "FR3", - "pl7.app/alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR3 nt" - } - } - }, { - "column": "minQualFR3", - "id": "min-qual-fr3", - "spec": { - "name": "pl7.app/vdj/sequenceQuality", - "valueType": "Int", - "domain": { - "pl7.app/vdj/quality": "minQuality", - "pl7.app/vdj/feature": "FR3" - }, - "annotations": { - "pl7.app/label": "Min quality FR3" - } - } - }, { - "column": "nSeqFR4", - "id": "n-seq-fr4", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/feature": "FR4", - "pl7.app/alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR4 nt" - } - } - }, { - "column": "minQualFR4", - "id": "min-qual-fr4", - "spec": { - "name": "pl7.app/vdj/sequenceQuality", - "valueType": "Int", - "domain": { - "pl7.app/vdj/quality": "minQuality", - "pl7.app/vdj/feature": "FR4" - }, - "annotations": { - "pl7.app/label": "Min quality FR4" - } - } - }, { - "column": "nSeqCDR1", - "id": "n-seq-cdr1", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/feature": "CDR1", - "pl7.app/alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "CDR1 nt" - } - } - }, { - "column": "minQualCDR1", - "id": "min-qual-cdr1", - "spec": { - "name": "pl7.app/vdj/minQualCDR1", - "valueType": "Int", - "domain": { - "pl7.app/vdj/quality": "minQuality", - "pl7.app/vdj/feature": "CDR1" - }, - "annotations": { - "pl7.app/label": "Min quality CDR1" - } - } - }, { - "column": "nSeqCDR2", - "id": "n-seq-cdr2", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/feature": "CDR2", - "pl7.app/alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "CDR2 nt" - } - } - }, { - "column": "minQualCDR2", - "id": "min-qual-cdr2", - "spec": { - "name": "pl7.app/vdj/sequenceQuality", - "valueType": "Int", - "domain": { - "pl7.app/vdj/quality": "minQuality", - "pl7.app/vdj/feature": "CDR2" - }, - "annotations": { - "pl7.app/label": "Min quality CDR2" - } - } - }, { - "column": "nSeqCDR3", - "id": "n-seq-cdr3", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "CDR3", - "pl7.app/alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "CDR3 nt" - } - } - }, { - "column": "minQualCDR3", - "id": "min-qual-cdr3", - "spec": { - "name": "pl7.app/vdj/sequenceQuality", - "valueType": "Int", - "domain": { - "pl7.app/vdj/quality": "minQuality", - "pl7.app/vdj/feature": "CDR3" - }, - "annotations": { - "pl7.app/label": "Min quality CDR3" - } - } - }, { - "column": "aaSeqFR1", - "id": "aa-seq-fr1", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "FR1", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR1 aa" - } - } - }, { - "column": "aaSeqFR2", - "id": "aa-seq-fr2", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "FR2", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR2 aa" - } - } - }, { - "column": "aaSeqFR3", - "id": "aa-seq-fr3", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "FR3", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR3 aa" - } - } - }, { - "column": "aaSeqFR4", - "id": "aa-seq-fr4", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "FR4", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR4 aa" - } - } - }, { - "column": "aaSeqCDR1", - "id": "aa-seq-cdr1", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "CDR1", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "CDR1 aa" - } - } - }, { - "column": "aaSeqCDR2", - "id": "aa-seq-cdr2", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "CDR2", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "CDR2 aa" - } - } - }, { - "column": "aaSeqCDR3", - "id": "aa-seq-cdr3", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "CDR3", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "CDR3 aa" - } - } - }, { - "column": "nSeqImputedFR1", - "id": "n-seq-imputed-fr1", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/feature": "FR1", - "alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR1 imputed nt" - } - } - }, { - "column": "nSeqImputedFR2", - "id": "n-seq-imputed-fr2", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/feature": "FR2", - "alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR2 imputed nt" - } - } - }, { - "column": "nSeqImputedFR3", - "id": "n-seq-imputed-fr3", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/feature": "FR3", - "alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR3 imputed nt" - } - } - }, { - "column": "nSeqImputedFR4", - "id": "n-seq-imputed-fr4", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/feature": "FR4", - "alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR4 imputed nt" - } - } - }, { - "column": "nSeqImputedCDR1", - "id": "n-seq-imputed-cdr1", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/feature": "CDR1", - "alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "CDR1 imputed nt" - } - } - }, { - "column": "nSeqImputedCDR2", - "id": "n-seq-imputed-cdr2", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/feature": "CDR2", - "alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "CDR2 imputed nt" - } - } - }, { - "column": "nSeqImputedCDR3", - "id": "n-seq-imputed-CDR3", - "spec": { - "name": "pl7.app/vdj/sequence", - "valueType": "String", - "domain": { - "pl7.app/vdj/feature": "CDR3", - "alphabet": "nucleotide" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "CDR3 imputed nt" - } - } - }, { - "column": "aaSeqImputedFR1", - "id": "aa-seq-imputed-fr1", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "FR1", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR1 imputed aa" - } - } - }, { - "column": "aaSeqImputedFR2", - "id": "aa-seq-imputed-fr2", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "FR2", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR2 imputed aa" - } - } - }, { - "column": "aaSeqImputedFR3", - "id": "aa-seq-imputed-fr3", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "FR3", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR3 imputed aa" - } - } - }, { - "column": "aaSeqImputedFR4", - "id": "aa-seq-imputed-fr4", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "FR4", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "FR4 imputed aa" - } - } - }, { - "column": "aaSeqImputedCDR1", - "id": "aa-seq-imputed-cdr1", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "CDR1", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "CDR1 imputed aa" - } - } - }, { - "column": "aaSeqImputedCDR2", - "id": "aa-seq-imputed-cdr2", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "CDR2", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "CDR2 imputed aa" - } - } - }, { - "column": "aaSeqImputedCDR3", - "id": "aa-seq-imputed-CDR3", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/sequence", - "domain": { - "pl7.app/vdj/feature": "CDR3", - "alphabet": "aminoacid" - }, - "annotations": { - "type": "sequence", - "pl7.app/label": "CDR3 imputed aa" - } - } - }, { - "column": "isotype", - "id": "isotype", - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/isotype", - "annotations": { - "pl7.app/label": "IG isotype" - } - } - }, { - "column": "topChains", - "id": "top-chains", - "allowNA": false, - "spec": { - "valueType": "String", - "name": "pl7.app/vdj/chain", - "annotations": { - "pl7.app/label": "Chain" - } - } - } - ], - "storageFormat": "Binary", - "partitionKeyLength": 0 +getColumns := func(blockId) { + return { + "axes": [ + { + "column": "cloneId", + "spec": { + "name": "pl7.app/vdj/cloneId", + "type": "Long", + "domain": { + "pl7.app/blockId": blockId + }, + "annotations": { + "pl7.app/label": "Clone id" + } + } + }, { + "column": "tagValueCELL", + "spec": { + "name": "pl7.app/vdj/tagValueCELL", + "type": "String", + "annotations": { + "pl7.app/label": "Cell tag" + } + } + } + ], + "columns": [ + { + "column": "cellGroup", + "id": "cell-group", + "allowNA": false, + "spec": { + "name": "pl7.app/vdj/cellGroup", + "valueType": "Long", + "annotations": { + "pl7.app/label": "Cell group number" + } + } + }, { + "column": "readCount", + "id": "read-count", + "allowNA": false, + "spec": { + "name": "pl7.app/vdj/readCount", + "valueType": "Long", + "annotations": { + "pl7.app/label": "Number Of Reads" + } + } + }, { + "column": "readFraction", + "id": "read-fraction", + "allowNA": false, + "spec": { + "name": "pl7.app/vdj/readFraction", + "valueType": "Double", + "annotations": { + "pl7.app/label": "Fraction of reads" + } + } + }, { + "column": "uniqueMoleculeCount", + "id": "umi-count", + "allowNA": false, + "spec": { + "name": "pl7.app/vdj/uniqueMoleculeCount", + "valueType": "Long", + "annotations": { + "pl7.app/label": "Number of UMI" + } + } + }, { + "column": "uniqueMoleculeFraction", + "id": "umi-fraction", + "allowNA": false, + "spec": { + "name": "pl7.app/vdj/uniqueMoleculeFraction", + "valueType": "Double", + "annotations": { + "pl7.app/label": "Fraction of UMI" + } + } + }, { + "column": "targetSequences", + "id": "n-seq-clonal-sequences", + "allowNA": false, + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/sequence": "clonalSequence", + "pl7.app/alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/type": "sequence", + "pl7.app/label": "Clonal sequences" + } + } + }, { + "column": "targetQualities", + "id": "clonal-qualities", + "allowNA": false, + "spec": { + "name": "pl7.app/vdj/sequenceQuality", + "valueType": "String", + "domain": { + "pl7.app/vdj/quality": "clonalQuality" + }, + "annotations": { + "type": "quality string", + "pl7.app/label": "Clonal qualities" + } + } + }, { + "column": "bestVHit", + "id": "best-v-hit", + "allowNA": false, + "spec": { + "name": "pl7.app/vdj/geneHit", + "valueType": "String", + "domain": { + "pl7.app/vdj/reference": "VGene" + }, + "annotations": { + "type": "V gene name", + "pl7.app/label": "Best V hit" + } + } + }, { + "column": "bestDHit", + "id": "best-d-hit", + "spec": { + "name": "pl7.app/vdj/geneHit", + "valueType": "String", + "domain": { + "pl7.app/vdj/reference": "DGene" + }, + "annotations": { + "type": "D gene name", + "pl7.app/label": "Best D hit" + } + } + }, { + "column": "bestJHit", + "id": "best-j-hit", + "allowNA": false, + "spec": { + "name": "pl7.app/vdj/geneHit", + "valueType": "String", + "domain": { + "pl7.app/vdj/reference": "JGene" + }, + "annotations": { + "type": "J gene name", + "pl7.app/label": "Best J hit" + } + } + }, { + "column": "bestCHit", + "id": "best-c-hit", + "spec": { + "name": "pl7.app/vdj/geneHit", + "valueType": "String", + "domain": { + "pl7.app/vdj/reference": "CGene" + }, + "annotations": { + "type": "C gene name", + "pl7.app/label": "Best C hit" + } + } + }, { + "column": "nSeqFR1", + "id": "n-seq-fr1", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/feature": "FR1", + "pl7.app/alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "FR1 nt" + } + } + }, { + "column": "minQualFR1", + "id": "min-qual-fr1", + "spec": { + "name": "pl7.app/vdj/sequenceQuality", + "valueType": "Int", + "domain": { + "pl7.app/vdj/quality": "minQuality", + "pl7.app/vdj/feature": "FR1" + }, + "annotations": { + "pl7.app/label": "Min quality FR1" + } + } + }, { + "column": "nSeqFR2", + "id": "n-seq-fr2", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + + "domain": { + "pl7.app/vdj/feature": "FR2", + "pl7.app/alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "FR2 nt" + } + } + }, { + "column": "minQualFR2", + "id": "min-qual-fr2", + "spec": { + "name": "pl7.app/vdj/sequenceQuality", + "valueType": "Int", + "domain": { + "pl7.app/vdj/quality": "minQuality", + "pl7.app/vdj/feature": "FR2" + }, + "annotations": { + "pl7.app/label": "Min quality FR2" + } + } + }, { + "column": "nSeqFR3", + "id": "n-seq-fr3", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/feature": "FR3", + "pl7.app/alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "FR3 nt" + } + } + }, { + "column": "minQualFR3", + "id": "min-qual-fr3", + "spec": { + "name": "pl7.app/vdj/sequenceQuality", + "valueType": "Int", + "domain": { + "pl7.app/vdj/quality": "minQuality", + "pl7.app/vdj/feature": "FR3" + }, + "annotations": { + "pl7.app/label": "Min quality FR3" + } + } + }, { + "column": "nSeqFR4", + "id": "n-seq-fr4", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/feature": "FR4", + "pl7.app/alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "FR4 nt" + } + } + }, { + "column": "minQualFR4", + "id": "min-qual-fr4", + "spec": { + "name": "pl7.app/vdj/sequenceQuality", + "valueType": "Int", + "domain": { + "pl7.app/vdj/quality": "minQuality", + "pl7.app/vdj/feature": "FR4" + }, + "annotations": { + "pl7.app/label": "Min quality FR4" + } + } + }, { + "column": "nSeqCDR1", + "id": "n-seq-cdr1", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/feature": "CDR1", + "pl7.app/alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "CDR1 nt" + } + } + }, { + "column": "minQualCDR1", + "id": "min-qual-cdr1", + "spec": { + "name": "pl7.app/vdj/minQualCDR1", + "valueType": "Int", + "domain": { + "pl7.app/vdj/quality": "minQuality", + "pl7.app/vdj/feature": "CDR1" + }, + "annotations": { + "pl7.app/label": "Min quality CDR1" + } + } + }, { + "column": "nSeqCDR2", + "id": "n-seq-cdr2", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/feature": "CDR2", + "pl7.app/alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "CDR2 nt" + } + } + }, { + "column": "minQualCDR2", + "id": "min-qual-cdr2", + "spec": { + "name": "pl7.app/vdj/sequenceQuality", + "valueType": "Int", + "domain": { + "pl7.app/vdj/quality": "minQuality", + "pl7.app/vdj/feature": "CDR2" + }, + "annotations": { + "pl7.app/label": "Min quality CDR2" + } + } + }, { + "column": "nSeqCDR3", + "id": "n-seq-cdr3", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "CDR3", + "pl7.app/alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "CDR3 nt" + } + } + }, { + "column": "minQualCDR3", + "id": "min-qual-cdr3", + "spec": { + "name": "pl7.app/vdj/sequenceQuality", + "valueType": "Int", + "domain": { + "pl7.app/vdj/quality": "minQuality", + "pl7.app/vdj/feature": "CDR3" + }, + "annotations": { + "pl7.app/label": "Min quality CDR3" + } + } + }, { + "column": "aaSeqFR1", + "id": "aa-seq-fr1", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "FR1", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "FR1 aa" + } + } + }, { + "column": "aaSeqFR2", + "id": "aa-seq-fr2", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "FR2", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "FR2 aa" + } + } + }, { + "column": "aaSeqFR3", + "id": "aa-seq-fr3", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "FR3", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "FR3 aa" + } + } + }, { + "column": "aaSeqFR4", + "id": "aa-seq-fr4", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "FR4", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "FR4 aa" + } + } + }, { + "column": "aaSeqCDR1", + "id": "aa-seq-cdr1", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "CDR1", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "CDR1 aa" + } + } + }, { + "column": "aaSeqCDR2", + "id": "aa-seq-cdr2", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "CDR2", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "CDR2 aa" + } + } + }, { + "column": "aaSeqCDR3", + "id": "aa-seq-cdr3", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "CDR3", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "CDR3 aa" + } + } + }, { + "column": "nSeqImputedFR1", + "id": "n-seq-imputed-fr1", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/feature": "FR1", + "alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "FR1 imputed nt" + } + } + }, { + "column": "nSeqImputedFR2", + "id": "n-seq-imputed-fr2", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/feature": "FR2", + "alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "FR2 imputed nt" + } + } + }, { + "column": "nSeqImputedFR3", + "id": "n-seq-imputed-fr3", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/feature": "FR3", + "alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "FR3 imputed nt" + } + } + }, { + "column": "nSeqImputedFR4", + "id": "n-seq-imputed-fr4", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/feature": "FR4", + "alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "FR4 imputed nt" + } + } + }, { + "column": "nSeqImputedCDR1", + "id": "n-seq-imputed-cdr1", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/feature": "CDR1", + "alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "CDR1 imputed nt" + } + } + }, { + "column": "nSeqImputedCDR2", + "id": "n-seq-imputed-cdr2", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/feature": "CDR2", + "alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "CDR2 imputed nt" + } + } + }, { + "column": "nSeqImputedCDR3", + "id": "n-seq-imputed-CDR3", + "spec": { + "name": "pl7.app/vdj/sequence", + "valueType": "String", + "domain": { + "pl7.app/vdj/feature": "CDR3", + "alphabet": "nucleotide" + }, + "annotations": { + "pl7.app/label": "CDR3 imputed nt" + } + } + }, { + "column": "aaSeqImputedFR1", + "id": "aa-seq-imputed-fr1", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "FR1", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "FR1 imputed aa" + } + } + }, { + "column": "aaSeqImputedFR2", + "id": "aa-seq-imputed-fr2", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "FR2", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "FR2 imputed aa" + } + } + }, { + "column": "aaSeqImputedFR3", + "id": "aa-seq-imputed-fr3", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "FR3", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "FR3 imputed aa" + } + } + }, { + "column": "aaSeqImputedFR4", + "id": "aa-seq-imputed-fr4", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "FR4", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "FR4 imputed aa" + } + } + }, { + "column": "aaSeqImputedCDR1", + "id": "aa-seq-imputed-cdr1", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "CDR1", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "CDR1 imputed aa" + } + } + }, { + "column": "aaSeqImputedCDR2", + "id": "aa-seq-imputed-cdr2", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "CDR2", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "CDR2 imputed aa" + } + } + }, { + "column": "aaSeqImputedCDR3", + "id": "aa-seq-imputed-CDR3", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/sequence", + "domain": { + "pl7.app/vdj/feature": "CDR3", + "alphabet": "aminoacid" + }, + "annotations": { + "pl7.app/label": "CDR3 imputed aa" + } + } + }, { + "column": "isotype", + "id": "isotype", + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/isotype", + "annotations": { + "pl7.app/label": "IG isotype" + } + } + }, { + "column": "topChains", + "id": "top-chains", + "allowNA": false, + "spec": { + "valueType": "String", + "name": "pl7.app/vdj/chain", + "annotations": { + "pl7.app/label": "Chain" + } + } + } + ], + "storageFormat": "Binary", + "partitionKeyLength": 0 + } } + +export ll.toStrict({ + getColumns: getColumns +}) diff --git a/workflow/src/process.tpl.tengo b/workflow/src/process.tpl.tengo index b054e42..92b7bf3 100644 --- a/workflow/src/process.tpl.tengo +++ b/workflow/src/process.tpl.tengo @@ -23,6 +23,9 @@ self.awaitState("pfconvParams", "ResourceReady") self.body(func(inputs) { params := inputs.params preset := params.preset + species := params.species + blockId := params.blockId + inputSpec := self.rawInputs().inputSpec.getValue().getDataAsJson() presetContent := self.rawInputs().presetContent.getValue().getDataAsJson() @@ -95,6 +98,7 @@ self.body(func(inputs) { { params: smart.createJsonResource({ preset: preset, + species: species, fileExtension: fileExtension, reports: reports }), @@ -113,6 +117,9 @@ self.body(func(inputs) { "qc.spec": { kind: "PColumn", name: "mixcr.com/qc", + domain: { + "pl7.app/blockId": blockId + }, valueType: "File", axesSpec: [ inputSpec.axesSpec[0] @@ -123,6 +130,9 @@ self.body(func(inputs) { "logs.spec": { kind: "PColumn", name: "pl7.app/log", + domain: { + "pl7.app/blockId": blockId + }, valueType: "Log", axesSpec: [ inputSpec.axesSpec[0] @@ -133,6 +143,9 @@ self.body(func(inputs) { "reports.spec": { kind: "PColumn", name: "mixcr.com/report", + domain: { + "pl7.app/blockId": blockId + }, valueType: "File", axesSpec: [ inputSpec.axesSpec[0], @@ -157,6 +170,15 @@ self.body(func(inputs) { }, "reports.data": mixcrResults.output("reports"), + "clns.spec": { + kind: "PColumn", + name: "mixcr.com/clns", + domain: { + "pl7.app/blockId": blockId + }, + valueType: "File", + axesSpec: [ inputSpec.axesSpec[0] ] + }, "clns.data": mixcrResults.output("clns"), "clones": clones.lockAndBuild()