@@ -10,9 +10,23 @@ params.extractnaming = 'condensed' //condensed means it is mangled, original mea
1010params. maxfilesize = " 3000" // Default 3000 MB
1111
1212TOOL_FOLDER = " $baseDir /bin"
13- params. publishdir = " nf_output "
13+ params. publishdir = " $l aunchDir "
1414params. PYTHONRUNTIME = " python" // this is a hack because CCMS cluster does not have python installed
1515
16+
17+ // COMPATIBILITY NOTE: The following might be necessary if this workflow is being deployed in a slightly different environemnt
18+ // checking if outdir is defined,
19+ // if so, then set publishdir to outdir
20+ if (params. outdir) {
21+ _publishdir = params. outdir
22+ }
23+ else {
24+ _publishdir = params. publishdir
25+ }
26+
27+ // Augmenting with nf_output
28+ _publishdir = " ${ _publishdir} /nf_output"
29+
1630// This is the parallel run that will run on the cluster
1731process queryData {
1832 errorStrategy ' ignore'
@@ -77,7 +91,7 @@ process queryData2 {
7791
7892// Merging the results, 100 results at a time, and then doing a full merge
7993process formatResultsMergeRounds {
80- publishDir " $p arams . publishdir /msql" , mode: ' copy'
94+ publishDir " $_ publishdir /msql" , mode: ' copy'
8195 cache false
8296
8397 // errorStrategy 'ignore'
@@ -102,7 +116,7 @@ process formatResultsMergeRounds {
102116
103117// Merging the JSON in rounds, 100 files at a time
104118process formatExtractedSpectraRounds {
105- publishDir " $p arams . publishdir /extracted" , mode: ' copy'
119+ publishDir " $_ publishdir /extracted" , mode: ' copy'
106120 cache false
107121 errorStrategy ' ignore'
108122
@@ -183,7 +197,7 @@ process formatExtractedSpectraRounds {
183197
184198
185199process summarizeResults {
186- publishDir " $p arams . publishdir /summary" , mode: ' copy'
200+ publishDir " $_ publishdir /summary" , mode: ' copy'
187201 cache false
188202 errorStrategy ' ignore'
189203
@@ -227,14 +241,14 @@ workflow {
227241
228242 _merged_temp_summary_ch = formatResultsMergeRounds(_query_results_ch. collate( 100 ))
229243
230- _query_results_merged_ch = _merged_temp_summary_ch. collectFile(name : " merged_query_results.tsv" , storeDir : " $p arams . publishdir /msql" , keepHeader : true )
244+ _query_results_merged_ch = _merged_temp_summary_ch. collectFile(name : " merged_query_results.tsv" , storeDir : " $_ publishdir /msql" , keepHeader : true )
231245
232246
233247 if (params. extract == " YES" ){
234248 (_, _, _, _extracted_summary_ch) = formatExtractedSpectraRounds(_query_extract_results_ch. collate( 100 ))
235249
236250 // Once we've done this, then we'lll do the actual merge
237- _extracted_summary_ch. collectFile(name : " extracted.tsv" , storeDir : " $p arams . publishdir /extracted" , keepHeader : true )
251+ _extracted_summary_ch. collectFile(name : " extracted.tsv" , storeDir : " $_ publishdir /extracted" , keepHeader : true )
238252 }
239253
240254 summarizeResults(_query_results_merged_ch)
0 commit comments