-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakeIprscan5NextflowConfig.pm
More file actions
70 lines (59 loc) · 2.65 KB
/
MakeIprscan5NextflowConfig.pm
File metadata and controls
70 lines (59 loc) · 2.65 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
package ApiCommonWorkflow::Main::WorkflowSteps::MakeIprscan5NextflowConfig;
@ISA = (ApiCommonWorkflow::Main::WorkflowSteps::WorkflowStep);
use strict;
use warnings;
use ApiCommonWorkflow::Main::WorkflowSteps::WorkflowStep;
sub run {
my ($self, $test, $undo) = @_;
my $workflowDataDir = $self->getWorkflowDataDir();
my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir();
my $configFileName = $self->getParamValue("configFileName");
my $configPath = join("/", $workflowDataDir, $self->getParamValue("analysisDir"), $self->getParamValue("configFileName"));
my $outputFile = $self->getParamValue("outputFile");
my $clusterServer = $self->getSharedConfig("clusterServer");
my $interproscanDatabase = join("/", $self->getSharedConfig("$clusterServer.softwareDatabasesDirectory"),$self->getSharedConfig("interproscanDatabaseDirectory"));
my $input = $self->getParamValue("input");
my $outputDir = $self->getParamValue("outputDir");
my $workingDirRelativePath = $self->getParamValue("workingDirRelativePath");
my $digestedInput = $self->relativePathToNextflowClusterPath($workingDirRelativePath, $input);
my $digestedOutputDir = $self->relativePathToNextflowClusterPath($workingDirRelativePath, $outputDir);
my $executor = $self->getClusterExecutor();
my $lsfEnv = $self->getNextflowLsfScratchEnvBlock();
my $queue = $self->getClusterQueue();
if ($undo) {
$self->runCmd(0,"rm -rf $configPath");
} else {
open(F, ">", $configPath) or die "$! :Can't open config file '$configPath' for writing";
print F
"
params {
input = \"$digestedInput\"
outputDir = \"$digestedOutputDir\"
fastaSubsetSize = 100
appls = \"antifam,cdd,coils,funfam,gene3d,hamap,mobidblite,ncbifam,panther,pfam,pirsf,pirsr,prints,prositepatterns,prositeprofiles,sfld,smart,superfamily\"
outputFile = \"$outputFile\"
}
process{
executor = \'$executor\'
queue = \'$queue\'
maxForks = 40
maxRetries = 2
withName: 'Iprscan' {
errorStrategy = { task.exitStatus in 130..140 ? \'retry\' : \'finish\' }
clusterOptions = {
(task.attempt > 1 && task.exitStatus in 130..140)
? \'-M 12000 -R \"rusage [mem=12000] span[hosts=1]\"\'
: \'-M 4000 -R \"rusage [mem=4000] span[hosts=1]\"\'
}
} \
}
singularity {
enabled = true
autoMounts = true
runOptions = \"--bind $interproscanDatabase:/opt/interproscan/data --bind $interproscanDatabase/interproscan.properties:/opt/interproscan/interproscan.properties\"
}
$lsfEnv";
close(F);
}
}
1;