-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakeBlatNextflowConfig.pm
More file actions
73 lines (58 loc) · 2.64 KB
/
MakeBlatNextflowConfig.pm
File metadata and controls
73 lines (58 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package ApiCommonWorkflow::Main::WorkflowSteps::MakeBlatNextflowConfig;
@ISA = (ApiCommonWorkflow::Main::WorkflowSteps::WorkflowStep);
use strict;
use warnings;
use ApiCommonWorkflow::Main::WorkflowSteps::WorkflowStep;
sub run {
my ($self, $test, $undo) = @_;
my $dots = 10;
my $workflowDataDir = $self->getWorkflowDataDir();
my $resultsDirectory = $self->getParamValue("resultsDirectory");
my $configFileName = $self->getParamValue("configFileName");
my $configPath = join("/", $workflowDataDir, $self->getParamValue("analysisDir"), $self->getParamValue("configFileName"));
my $seqFile = $self->getParamValue("queryFile");
my $fastaSubsetSize = $self->getParamValue("fastaSubsetSize");
my $databasePath = $self->getParamValue("databasePath");
my $maxIntronSize = $self->getParamValue("maxIntronSize");
my $dbType = $self->getParamValue("dbType");
my $queryType = $self->getParamValue("queryType");
my $outputFileName = $self->getParamValue("outputFileName");
my $workingDirRelativePath = $self->getParamValue("workingDirRelativePath");
my $increasedMemory = $self->getParamValue("increasedMemory");
my $initialMemory = $self->getParamValue("initialMemory");
my $maxForks = $self->getParamValue("maxForks");
my $maxRetries = $self->getParamValue("maxRetries");
my $executor = $self->getClusterExecutor();
my $lsfEnv = $self->getNextflowLsfScratchEnvBlock();
my $queue = $self->getClusterQueue();
my $clusterConfigFile = "\$baseDir/conf/${executor}.config";
if ($undo) {
$self->runCmd(0,"rm -rf $configPath");
} else {
open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing";
my $queryFileInNextflowWorkingDirOnCluster = $self->relativePathToNextflowClusterPath($workingDirRelativePath, $seqFile);
my $databaseInNextflowWorkingDirOnCluster = $self->relativePathToNextflowClusterPath($workingDirRelativePath, $databasePath);
my $resultsDirectoryInNextflowWorkingDirOnCluster = $self->relativePathToNextflowClusterPath($workingDirRelativePath, $resultsDirectory);
my $configString = <<NEXTFLOW;
params {
queryFasta = "$queryFileInNextflowWorkingDirOnCluster"
fastaSubsetSize = $fastaSubsetSize
genomeFasta = "$databaseInNextflowWorkingDirOnCluster"
dbType = "$dbType"
queryType = "$queryType"
outputDir = "$resultsDirectoryInNextflowWorkingDirOnCluster"
outputFileName = "$outputFileName"
}
process {
maxForks = $maxForks
withName: runBlat {
ext.args = "-dots=$dots -maxIntron=$maxIntronSize"
}
}
includeConfig "$clusterConfigFile"
NEXTFLOW
print F $configString . $lsfEnv;
close(F);
}
}
1;