diff --git a/Main/lib/perl/WorkflowSteps/MakeAntismashNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeAntismashNextflowConfig.pm index 62e079834..c4bcaaf44 100644 --- a/Main/lib/perl/WorkflowSteps/MakeAntismashNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeAntismashNextflowConfig.pm @@ -28,6 +28,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); if ($undo) { @@ -36,7 +37,7 @@ sub run { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { fasta = \"$digestedFasta\" gff = \"$digestedGff\" diff --git a/Main/lib/perl/WorkflowSteps/MakeArbaNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeArbaNextflowConfig.pm index 96ae7f657..8d581a176 100644 --- a/Main/lib/perl/WorkflowSteps/MakeArbaNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeArbaNextflowConfig.pm @@ -26,6 +26,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); if ($undo) { @@ -34,7 +35,7 @@ sub run { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { interproResults = \"$digestedInterproResults\" outputDir = \"$digestedOutputDir\" diff --git a/Main/lib/perl/WorkflowSteps/MakeArrayProbeMappingNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeArrayProbeMappingNextflowConfig.pm index 708c514b1..e6ef3cc5a 100644 --- a/Main/lib/perl/WorkflowSteps/MakeArrayProbeMappingNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeArrayProbeMappingNextflowConfig.pm @@ -71,6 +71,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -121,7 +122,7 @@ includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeBlastPPdbNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeBlastPPdbNextflowConfig.pm index 72bb88153..fc69e1b7c 100644 --- a/Main/lib/perl/WorkflowSteps/MakeBlastPPdbNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeBlastPPdbNextflowConfig.pm @@ -31,6 +31,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -70,7 +71,7 @@ includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeBlastSimilarityNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeBlastSimilarityNextflowConfig.pm index 146951f89..a6fda4b9b 100644 --- a/Main/lib/perl/WorkflowSteps/MakeBlastSimilarityNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeBlastSimilarityNextflowConfig.pm @@ -38,6 +38,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); if ($undo) { @@ -46,7 +47,7 @@ sub run { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { blastProgram = \"$blastProgram\" seqFile = \"$seqFile\" diff --git a/Main/lib/perl/WorkflowSteps/MakeBlatNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeBlatNextflowConfig.pm index 5eb18bb34..80880b10b 100644 --- a/Main/lib/perl/WorkflowSteps/MakeBlatNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeBlatNextflowConfig.pm @@ -31,6 +31,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -67,7 +68,7 @@ process { includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeBowtieMappingNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeBowtieMappingNextflowConfig.pm index 019fb29d8..d5ed0d1f7 100644 --- a/Main/lib/perl/WorkflowSteps/MakeBowtieMappingNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeBowtieMappingNextflowConfig.pm @@ -32,6 +32,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); if ($undo) { @@ -40,7 +41,7 @@ sub run { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { preconfiguredDatabase = $preconfiguredDatabase writeBedFile = $writeBedFile diff --git a/Main/lib/perl/WorkflowSteps/MakeBulkRnaSeqNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeBulkRnaSeqNextflowConfig.pm index 82d9172de..3cf90aeb0 100644 --- a/Main/lib/perl/WorkflowSteps/MakeBulkRnaSeqNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeBulkRnaSeqNextflowConfig.pm @@ -36,6 +36,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -101,7 +102,7 @@ def check_max(obj, type) { NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeBuscoNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeBuscoNextflowConfig.pm index 1818fe9cd..1db868bfa 100644 --- a/Main/lib/perl/WorkflowSteps/MakeBuscoNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeBuscoNextflowConfig.pm @@ -30,6 +30,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -67,7 +68,7 @@ process { includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeChipSeqNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeChipSeqNextflowConfig.pm index cad7e2c44..4a82290fe 100644 --- a/Main/lib/perl/WorkflowSteps/MakeChipSeqNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeChipSeqNextflowConfig.pm @@ -40,6 +40,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -83,7 +84,7 @@ process { NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeDnaSeqLoadNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeDnaSeqLoadNextflowConfig.pm index 33b1569eb..02d8d2db3 100644 --- a/Main/lib/perl/WorkflowSteps/MakeDnaSeqLoadNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeDnaSeqLoadNextflowConfig.pm @@ -14,13 +14,14 @@ sub run { my $genomeExtDbRlsSpec = $self->getParamValue("genomeExtDbRlsSpec"); my $configPath = $self->getWorkflowDataDir() . "/" . $self->getParamValue("nextflowConfigFile"); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); if ($undo) { $self->runCmd(0, "rm -rf $configPath"); } else { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { indelDir = \"$indelDir\" extDbRlsSpec = '\"$extDbRlsSpec\"' diff --git a/Main/lib/perl/WorkflowSteps/MakeDnaSeqMergeExperimentsNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeDnaSeqMergeExperimentsNextflowConfig.pm index 96826797f..4078f5962 100644 --- a/Main/lib/perl/WorkflowSteps/MakeDnaSeqMergeExperimentsNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeDnaSeqMergeExperimentsNextflowConfig.pm @@ -63,9 +63,11 @@ sub run { my @experimentConfigs = glob($experimentConfigGlob); my $ploidy = parsePloidyFromConfigs(@experimentConfigs); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); + open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { outputDir = \"$outputDir\" diff --git a/Main/lib/perl/WorkflowSteps/MakeDnaSeqNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeDnaSeqNextflowConfig.pm index 67a8d301c..546fafe53 100644 --- a/Main/lib/perl/WorkflowSteps/MakeDnaSeqNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeDnaSeqNextflowConfig.pm @@ -39,6 +39,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $queue = $self->getClusterQueue(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $genomeFastaFile = $self->getWorkflowDataDir() . "/" . $self->getParamValue("genomeFastaFile"); @@ -59,7 +60,7 @@ sub run { $self->runCmd(0, "rm -rf $nextflowConfigFile"); } else { open(F, ">", $nextflowConfigFile) or die "$! :Can't open config file '$nextflowConfigFile' for writing"; - print F " + print F "$sharedClusterConfig params { samplesheet = \"$digestedSampleSheet\" bwaThreads = $bwaThreads diff --git a/Main/lib/perl/WorkflowSteps/MakeDnaSeqSingleExperimentNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeDnaSeqSingleExperimentNextflowConfig.pm index 77d500edb..45c7f91cb 100644 --- a/Main/lib/perl/WorkflowSteps/MakeDnaSeqSingleExperimentNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeDnaSeqSingleExperimentNextflowConfig.pm @@ -42,6 +42,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $gusConfigFile = $ENV{GUS_HOME}."/config/gus.config"; @@ -75,7 +76,7 @@ sub run { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { input = \"$input\" fromBAM = $fromBAM diff --git a/Main/lib/perl/WorkflowSteps/MakeDustNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeDustNextflowConfig.pm index bed70acdb..20080dc8b 100644 --- a/Main/lib/perl/WorkflowSteps/MakeDustNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeDustNextflowConfig.pm @@ -26,6 +26,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -53,7 +54,7 @@ includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeEpitopeMappingNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeEpitopeMappingNextflowConfig.pm index 25e62038f..85009ac9a 100644 --- a/Main/lib/perl/WorkflowSteps/MakeEpitopeMappingNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeEpitopeMappingNextflowConfig.pm @@ -36,6 +36,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -92,7 +93,7 @@ includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeExportpredNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeExportpredNextflowConfig.pm index 70b7cc7de..ffe64f4aa 100644 --- a/Main/lib/perl/WorkflowSteps/MakeExportpredNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeExportpredNextflowConfig.pm @@ -21,6 +21,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -51,7 +52,7 @@ includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeGenomicArrayExperimentNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeGenomicArrayExperimentNextflowConfig.pm index f51dc51b3..ae8126b75 100644 --- a/Main/lib/perl/WorkflowSteps/MakeGenomicArrayExperimentNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeGenomicArrayExperimentNextflowConfig.pm @@ -47,6 +47,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -78,7 +79,7 @@ includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeIprscan5NextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeIprscan5NextflowConfig.pm index 26ea98f04..369d1ca2e 100644 --- a/Main/lib/perl/WorkflowSteps/MakeIprscan5NextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeIprscan5NextflowConfig.pm @@ -25,6 +25,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); if ($undo) { @@ -33,7 +34,7 @@ sub run { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { input = \"$digestedInput\" outputDir = \"$digestedOutputDir\" diff --git a/Main/lib/perl/WorkflowSteps/MakeLoadCNVNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeLoadCNVNextflowConfig.pm index 27a40f55f..e835a134b 100644 --- a/Main/lib/perl/WorkflowSteps/MakeLoadCNVNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeLoadCNVNextflowConfig.pm @@ -16,7 +16,8 @@ sub run { my $footprintFile = join("/", $workflowDataDir, $self->getParamValue("footprintFile")); my $ploidy = $self->getParamValue("ploidy"); my $taxonId = $self->getParamValue("taxonId"); - my $outputDir = join("/", $workflowDataDir, $self->getParamValue("clusterResultDir")); + my $outputDir = join("/", $workflowDataDir, $self->getParamValue("clusterResultDir")); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); if ($undo) { $self->runCmd(0,"rm -rf $configPath"); @@ -24,7 +25,7 @@ sub run { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { input = \"$input\" outputDir = \"$outputDir\" diff --git a/Main/lib/perl/WorkflowSteps/MakeLongReadRnaSeqNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeLongReadRnaSeqNextflowConfig.pm index 1b5fe3bcf..d90169733 100644 --- a/Main/lib/perl/WorkflowSteps/MakeLongReadRnaSeqNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeLongReadRnaSeqNextflowConfig.pm @@ -42,6 +42,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -52,7 +53,7 @@ sub run { } else { open(F, ">", $nextflowConfigFile) or die "$! :Can't open config file '$nextflowConfigFile' for writing"; print F - " + "$sharedClusterConfig params { input = \"$digestedInputDirPath\" samplesheetFileName = \"$sampleSheet\" diff --git a/Main/lib/perl/WorkflowSteps/MakeMassSpecNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeMassSpecNextflowConfig.pm index de70b5b19..1d901307d 100644 --- a/Main/lib/perl/WorkflowSteps/MakeMassSpecNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeMassSpecNextflowConfig.pm @@ -34,6 +34,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -64,7 +65,7 @@ includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeNgsSamplesNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeNgsSamplesNextflowConfig.pm index 57dae80bb..036c74f6e 100644 --- a/Main/lib/perl/WorkflowSteps/MakeNgsSamplesNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeNgsSamplesNextflowConfig.pm @@ -39,6 +39,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -100,7 +101,7 @@ workDir = "$digestedAnalysisDirPath/ngs-samples-work" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeOriginsOfReplicationNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeOriginsOfReplicationNextflowConfig.pm index c13621563..6ac48b8bd 100644 --- a/Main/lib/perl/WorkflowSteps/MakeOriginsOfReplicationNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeOriginsOfReplicationNextflowConfig.pm @@ -38,6 +38,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -82,7 +83,7 @@ process { NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeOrthoFinderCoreNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeOrthoFinderCoreNextflowConfig.pm index 5e2ee0680..94022e40a 100644 --- a/Main/lib/perl/WorkflowSteps/MakeOrthoFinderCoreNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeOrthoFinderCoreNextflowConfig.pm @@ -31,6 +31,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfScratch = ($executor eq 'lsf') ? "\n NXF_SCRATCH = '\$LSF_TMPDIR'" : ''; + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); if ($undo) { @@ -39,7 +40,7 @@ sub run { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { proteomes = \"$proteomesInNextflowWorkingDirOnCluster\" outputDir = \"$resultsDirectoryInNextflowWorkingDirOnCluster\" diff --git a/Main/lib/perl/WorkflowSteps/MakeOrthoFinderPeripheralEntryNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeOrthoFinderPeripheralEntryNextflowConfig.pm index f1dfda676..9297b7652 100644 --- a/Main/lib/perl/WorkflowSteps/MakeOrthoFinderPeripheralEntryNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeOrthoFinderPeripheralEntryNextflowConfig.pm @@ -37,6 +37,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfScratch = ($executor eq 'lsf') ? "\n NXF_SCRATCH = '\$LSF_TMPDIR'" : ''; + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); if ($undo) { @@ -45,7 +46,7 @@ sub run { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { outputDir = \"$resultsDirectoryInNextflowWorkingDirOnCluster\" coreProteomes = \"$coreProteomesInNextflowWorkingDirOnCluster\" diff --git a/Main/lib/perl/WorkflowSteps/MakeOrthoFinderPostProcessingEntryNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeOrthoFinderPostProcessingEntryNextflowConfig.pm index de0dd8749..9a1052e69 100644 --- a/Main/lib/perl/WorkflowSteps/MakeOrthoFinderPostProcessingEntryNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeOrthoFinderPostProcessingEntryNextflowConfig.pm @@ -42,6 +42,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfScratch = ($executor eq 'lsf') ? "\n NXF_SCRATCH = '\$LSF_TMPDIR'" : ''; + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); if ($undo) { @@ -50,7 +51,7 @@ sub run { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { outputDir = \"$resultsDirectoryInNextflowWorkingDirOnCluster\" residualFasta = \"$residualFastaInNextflowWorkingDirOnCluster\" diff --git a/Main/lib/perl/WorkflowSteps/MakeOrthoFinderPostResidualEntryNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeOrthoFinderPostResidualEntryNextflowConfig.pm index 86b43545e..0349af177 100644 --- a/Main/lib/perl/WorkflowSteps/MakeOrthoFinderPostResidualEntryNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeOrthoFinderPostResidualEntryNextflowConfig.pm @@ -33,6 +33,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfScratch = ($executor eq 'lsf') ? "\n NXF_SCRATCH = '\$LSF_TMPDIR'" : ''; + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); if ($undo) { @@ -41,7 +42,7 @@ sub run { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { outputDir = \"$resultsDirectoryInNextflowWorkingDirOnCluster\" residualFasta = \"$residualFastaInNextflowWorkingDirOnCluster\" diff --git a/Main/lib/perl/WorkflowSteps/MakeOrthoFinderResidualEntryNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeOrthoFinderResidualEntryNextflowConfig.pm index 0a88f349c..e944b38db 100644 --- a/Main/lib/perl/WorkflowSteps/MakeOrthoFinderResidualEntryNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeOrthoFinderResidualEntryNextflowConfig.pm @@ -23,6 +23,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfScratch = ($executor eq 'lsf') ? "\n NXF_SCRATCH = '\$LSF_TMPDIR'" : ''; + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); if ($undo) { @@ -31,7 +32,7 @@ sub run { open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing"; print F -" +"$sharedClusterConfig params { outputDir = \"$resultsDirectoryInNextflowWorkingDirOnCluster\" residualFastaDir = \"$residualFastaDirInNextflowWorkingDirOnCluster\" diff --git a/Main/lib/perl/WorkflowSteps/MakeProteinAttributesNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeProteinAttributesNextflowConfig.pm index cb06d8b4c..d5cb1bdfc 100644 --- a/Main/lib/perl/WorkflowSteps/MakeProteinAttributesNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeProteinAttributesNextflowConfig.pm @@ -23,6 +23,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -53,7 +54,7 @@ includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakePsiPredNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakePsiPredNextflowConfig.pm index 867ef563f..e53219e6d 100644 --- a/Main/lib/perl/WorkflowSteps/MakePsiPredNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakePsiPredNextflowConfig.pm @@ -23,6 +23,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -56,7 +57,7 @@ process { includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeRepeatMaskerNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeRepeatMaskerNextflowConfig.pm index f1ed5da6c..7e2629f57 100644 --- a/Main/lib/perl/WorkflowSteps/MakeRepeatMaskerNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeRepeatMaskerNextflowConfig.pm @@ -39,6 +39,7 @@ sub run { my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -87,7 +88,7 @@ singularity { NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } diff --git a/Main/lib/perl/WorkflowSteps/MakeRnaSeqAnalysisNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeRnaSeqAnalysisNextflowConfig.pm index 462684452..8445662d8 100644 --- a/Main/lib/perl/WorkflowSteps/MakeRnaSeqAnalysisNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeRnaSeqAnalysisNextflowConfig.pm @@ -25,6 +25,7 @@ sub run { my $workflowDataDir = $self->getWorkflowDataDir(); my $baseConfigFile = "\$baseDir/conf/singularity.config"; + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); if ($undo) { $self->runCmd(0, "rm $workflowDataDir/$nextflowConfigFile"); @@ -48,7 +49,7 @@ includeConfig "$baseConfigFile" NEXTFLOW - print F $configString; + print F $sharedClusterConfig . $configString; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeSegNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeSegNextflowConfig.pm index a63c2889b..435282598 100644 --- a/Main/lib/perl/WorkflowSteps/MakeSegNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeSegNextflowConfig.pm @@ -22,6 +22,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -52,7 +53,7 @@ includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeSignalPNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeSignalPNextflowConfig.pm index bde902ca0..36ebdff9e 100644 --- a/Main/lib/perl/WorkflowSteps/MakeSignalPNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeSignalPNextflowConfig.pm @@ -36,6 +36,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -79,7 +80,7 @@ includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeSplicedLeaderAndPolyASitesNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeSplicedLeaderAndPolyASitesNextflowConfig.pm index 153b3e73e..4d5d42ce3 100644 --- a/Main/lib/perl/WorkflowSteps/MakeSplicedLeaderAndPolyASitesNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeSplicedLeaderAndPolyASitesNextflowConfig.pm @@ -37,6 +37,7 @@ sub run { my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -77,7 +78,7 @@ process { NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/MakeStudyAssayResultsNextflowConfig.pm b/Main/lib/perl/WorkflowSteps/MakeStudyAssayResultsNextflowConfig.pm index fb9d9550a..c47c54365 100644 --- a/Main/lib/perl/WorkflowSteps/MakeStudyAssayResultsNextflowConfig.pm +++ b/Main/lib/perl/WorkflowSteps/MakeStudyAssayResultsNextflowConfig.pm @@ -24,6 +24,7 @@ sub run { my $workflowDataDir = $self->getWorkflowDataDir(); my $baseConfigFile = "\$baseDir/conf/singularity.config"; + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); # Determine the input file based on platform mapping (logic from DoStudyAssayResults) my $inputFile; @@ -74,7 +75,7 @@ $configString .= <getClusterWorkflowDataDir(); my $executor = $self->getClusterExecutor(); my $lsfEnv = $self->getNextflowLsfScratchEnvBlock(); + my $sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock(); my $queue = $self->getClusterQueue(); my $clusterConfigFile = "\$baseDir/conf/${executor}.config"; @@ -64,7 +65,7 @@ includeConfig "$clusterConfigFile" NEXTFLOW - print F $configString . $lsfEnv; + print F $sharedClusterConfig . $configString . $lsfEnv; close(F); } } diff --git a/Main/lib/perl/WorkflowSteps/WorkflowStep.pm b/Main/lib/perl/WorkflowSteps/WorkflowStep.pm index 998887ce1..6ab10a99b 100644 --- a/Main/lib/perl/WorkflowSteps/WorkflowStep.pm +++ b/Main/lib/perl/WorkflowSteps/WorkflowStep.pm @@ -348,7 +348,24 @@ sub getClusterExecutor { sub getNextflowLsfScratchEnvBlock { my ($self) = @_; return '' unless $self->getClusterExecutor() eq 'lsf'; - return "\nenv {\n NXF_SCRATCH = '\$LSF_TMPDIR'\n}\n"; + # LSF_TMPDIR isn't guaranteed to be exported by every LSF cluster/job; without the + # ':-' default this crashes under nextflow's own 'set -u' if it's ever unset. + return "\nenv {\n NXF_SCRATCH = '\${LSF_TMPDIR:-}'\n}\n"; +} + +# Opt-in include of a shared, cluster-provided nextflow config file (e.g. one that sets +# process { beforeScript = '...' } for module loads that shouldn't have to be repeated in +# every Make*NextflowConfig.pm generator by hand). Reads $clusterServer.sharedNextflowConfig +# from stepsShared.prop; if it isn't set, this is a silent no-op -- existing builds that +# don't configure it are unaffected. If it is set, the returned line pulls that config in +# via nextflow's own includeConfig directive, so a single shared file can add or change a +# cluster-wide setting without touching every step class that generates a nextflow config. +sub getSharedClusterNextflowConfigIncludeBlock { + my ($self) = @_; + my $clusterServer = $self->getSharedConfig('clusterServer'); + my $path = $self->getSharedConfigRelaxed("$clusterServer.sharedNextflowConfig"); + return '' unless $path; + return "includeConfig '$path'\n"; }