@platforma-open/milaboratories.mixcr-amplicon-alignment.workflow 1.19.9 → 1.20.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.
@@ -1,6 +1,6 @@
1
1
   WARN  Issue while reading "/home/runner/work/mixcr-amplicon-alignment/mixcr-amplicon-alignment/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-open/milaboratories.mixcr-amplicon-alignment.workflow@1.19.9 build /home/runner/work/mixcr-amplicon-alignment/mixcr-amplicon-alignment/workflow
3
+ > @platforma-open/milaboratories.mixcr-amplicon-alignment.workflow@1.20.0 build /home/runner/work/mixcr-amplicon-alignment/mixcr-amplicon-alignment/workflow
4
4
  > rm -rf dist && pl-tengo check && pl-tengo build
5
5
 
6
6
  Processing "src/aggregate-by-clonotype-key.tpl.tengo"...
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @platforma-open/milaboratories.mixcr-amplicon-alignment.workflow
2
2
 
3
+ ## 1.20.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e2b65c7: Support custom reference library file
8
+
3
9
  ## 1.19.9
4
10
 
5
11
  ### Patch Changes
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.mixcr-amplicon-alignment.workflow",
3
- "version": "1.19.9",
3
+ "version": "1.20.0",
4
4
  "description": "MiXCR Amplicon Alignment Workflow",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -41,16 +41,25 @@ wf.body(func(args) {
41
41
  "TCRDelta": { mixcrFilter: "TRG", name: "TCR Delta", shortName: "Delta" }
42
42
  }
43
43
 
44
- // Generate reference library using repseqio if both V and J genes are available
45
-
46
- repseqioResults := render.create(repseqioLibraryTpl, {
47
- vGenes: args.vGenes,
48
- jGenes: args.jGenes,
49
- chains: chainInfos[chains].mixcrFilter
50
- })
51
-
52
- referenceLibrary := repseqioResults.output("referenceLibrary")
53
- debugOutput := repseqioResults.output("debugOutput")
44
+ // Generate reference library using repseqio, or use directly imported library file
45
+ isLibraryFileGzipped := false
46
+ referenceLibrary := false
47
+ debugOutput := undefined
48
+ libraryImportHandle := undefined
49
+
50
+ if !is_undefined(args.libraryFile) {
51
+ fImport := file.importFile(args.libraryFile)
52
+ libraryImportHandle = fImport.handle
53
+ referenceLibrary = fImport.file
54
+ } else {
55
+ repseqioResults := render.create(repseqioLibraryTpl, {
56
+ vGenes: args.vGenes,
57
+ jGenes: args.jGenes,
58
+ chains: chainInfos[chains].mixcrFilter
59
+ })
60
+ referenceLibrary = repseqioResults.output("referenceLibrary")
61
+ debugOutput = repseqioResults.output("debugOutput")
62
+ }
54
63
 
55
64
 
56
65
  runMixcr := render.createEphemeral(processTpl, {
@@ -71,6 +80,7 @@ wf.body(func(args) {
71
80
  assemblingFeature: args.assemblingFeature,
72
81
  imputeGermline: args.imputeGermline,
73
82
  badQualityThreshold: args.badQualityThreshold,
83
+ isLibraryFileGzipped: isLibraryFileGzipped,
74
84
  stopCodonTypes: args.stopCodonTypes,
75
85
  stopCodonReplacements: args.stopCodonReplacements
76
86
  }, { removeUndefs: true }))
@@ -92,6 +102,23 @@ wf.body(func(args) {
92
102
  }
93
103
  }
94
104
 
105
+ if !is_undefined(args.libraryFile) {
106
+ exports.library = {
107
+ data: referenceLibrary,
108
+ spec: {
109
+ kind: "File",
110
+ name: "pl7.app/vdj/library",
111
+ domain: {
112
+ "pl7.app/vdj/libraryId": blockId
113
+ },
114
+ annotations: {
115
+ "pl7.app/vdj/isLibrary": "true",
116
+ "pl7.app/vdj/libraryFormat": (isLibraryFileGzipped ? "repseqio.json.gz" : "repseqio.json")
117
+ }
118
+ }
119
+ }
120
+ }
121
+
95
122
  outputs := {
96
123
  qc: pframes.exportColumnData(runMixcr.output("qc.data")),
97
124
  reports: pframes.exportColumnData(runMixcr.output("reports.data")),
@@ -99,9 +126,15 @@ wf.body(func(args) {
99
126
  clones: pframes.exportFrame(runMixcr.output("clones")),
100
127
  clns: runMixcr.output("clns.data"),
101
128
  progress: runMixcr.output("progress.data"),
102
- clonotypeTables: pframes.exportFrame(runMixcr.output("clonotypeTables")),
103
- debugOutput: debugOutput
129
+ clonotypeTables: pframes.exportFrame(runMixcr.output("clonotypeTables"))
130
+ }
131
+ outputs.referenceLibrary = file.exportFile(referenceLibrary)
132
+ if !is_undefined(debugOutput) {
133
+ outputs.debugOutput = debugOutput
104
134
  }
135
+ if !is_undefined(libraryImportHandle) {
136
+ outputs.libraryImportHandle = libraryImportHandle
137
+ }
105
138
 
106
139
  qcReportTable := runMixcr.output("qcReportTable")
107
140
  outputs.qcReportTable = pframes.exportFrame(qcReportTable)
@@ -81,11 +81,16 @@ self.body(func(inputs) {
81
81
  return "{" + parts[0] + "Begin:" + parts[1] + "End}"
82
82
  }
83
83
 
84
+ libraryFileName := "library.json"
85
+ if !is_undefined(params.isLibraryFileGzipped) && params.isLibraryFileGzipped {
86
+ libraryFileName = "library.json.gz"
87
+ }
88
+
84
89
  mixcrCmdBuilder.
85
90
  arg("--assemble-clonotypes-by").arg(formatAssemblingFeature(params.assemblingFeature)).
86
91
  arg("--species").arg("custom").
87
- arg("--library").arg("library.json").
88
- addFile("library.json", params.referenceLibrary).
92
+ arg("--library").arg(libraryFileName).
93
+ addFile(libraryFileName, params.referenceLibrary).
89
94
  arg("--rna").
90
95
  arg("--force-overwrite").
91
96
  arg("--rigid-left-alignment-boundary").
@@ -216,12 +216,17 @@ self.body(func(inputs) {
216
216
 
217
217
  additionalAction(mixcrCmdBuilder)
218
218
 
219
+ libraryFileName := "library.json"
220
+ if !is_undefined(params.isLibraryFileGzipped) && params.isLibraryFileGzipped {
221
+ libraryFileName = "library.json.gz"
222
+ }
223
+
219
224
  return mixcrCmdBuilder.
220
225
  arg("clones.clns").
221
226
  addFile("clones.clns", clnsFile).
222
227
  arg("clones.tsv").
223
228
  saveFile("clones.tsv").
224
- addFile("library.json", params.referenceLibrary).
229
+ addFile(libraryFileName, params.referenceLibrary).
225
230
  cacheHours(3).
226
231
  run()
227
232
  }
@@ -22,8 +22,6 @@ calculateExportSpecs := import(":calculate-export-specs")
22
22
  self.awaitState("InputsLocked")
23
23
  self.awaitState("params", "ResourceReady")
24
24
  self.awaitState("inputSpec", "ResourceReady")
25
- self.awaitState("referenceLibrary", "ResourceReady")
26
- self.awaitState("cdr3Sequences", "ResourceReady")
27
25
 
28
26
  self.body(func(inputs) {
29
27
 
@@ -223,7 +221,8 @@ self.body(func(inputs) {
223
221
  tagPattern: tagPattern,
224
222
  assemblingFeature: params.assemblingFeature,
225
223
  imputeGermline: params.imputeGermline,
226
- badQualityThreshold: params.badQualityThreshold
224
+ badQualityThreshold: params.badQualityThreshold,
225
+ isLibraryFileGzipped: params.isLibraryFileGzipped
227
226
  }, { removeUndefs: true }),
228
227
  limitInput: limitInput
229
228
  },
@@ -287,7 +286,8 @@ self.body(func(inputs) {
287
286
  cdr3SeqColumns: cdr3SeqColumns,
288
287
  stopCodonTypes: params.stopCodonTypes,
289
288
  stopCodonReplacements: params.stopCodonReplacements,
290
- perProcessMemGB: perProcessMemGB
289
+ perProcessMemGB: perProcessMemGB,
290
+ isLibraryFileGzipped: params.isLibraryFileGzipped
291
291
  }, { removeUndefs: true })
292
292
  }
293
293
  }
@@ -369,7 +369,7 @@ self.body(func(inputs) {
369
369
  sampleIdAxisSpec: sampleIdAxisSpec,
370
370
  chains: [chains],
371
371
  library: referenceLibrary,
372
- isLibraryFileGzipped: false,
372
+ isLibraryFileGzipped: params.isLibraryFileGzipped,
373
373
  clonotypeTablesData: clonotypeTablesData,
374
374
  hasUmi: hasUMI,
375
375
  umiTags: umiTags,