-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakeBuscoNextflowConfig.pm
More file actions
73 lines (51 loc) · 2.82 KB
/
MakeBuscoNextflowConfig.pm
File metadata and controls
73 lines (51 loc) · 2.82 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::MakeBuscoNextflowConfig;
@ISA = (ApiCommonWorkflow::Main::WorkflowSteps::WorkflowStep);
use strict;
use ApiCommonWorkflow::Main::WorkflowSteps::WorkflowStep;
sub run {
my ($self, $test, $undo) = @_;
my $maxForks = 2;
my $clusterServer = $self->getSharedConfig("clusterServer");
my $buscoLineagesDatabase = join("/", $self->getSharedConfig("$clusterServer.softwareDatabasesDirectory"), $self->getSharedConfig("buscoLineagesDirectory"));
my $workflowDataDir = $self->getWorkflowDataDir();
my $clusterWorkflowDataDir = $self->getClusterWorkflowDataDir();
my $proteinSequenceFile = $self->getParamValue("proteinSequenceFile");
my $genomicSequenceFile = $self->getParamValue("genomicSequenceFile");
my $lineageMappersFile = $self->getParamValue("buscoLineageMappersFile");
my $nextflowConfigFile = $self->getParamValue("nextflowConfigFile");
my $resultsDirectory = $self->getParamValue("resultsDirectory");
my $workingDirRelativePath = $self->getParamValue("workingDirRelativePath");
my $skipProteomeAnalysis = $self->getBooleanParamValue('isAnnotatedGenome') ? "false" : "true";
my $speciesNcbiTaxonId = $self->getParamValue("speciesNcbiTaxonId");
my $executor = $self->getClusterExecutor();
my $lsfEnv = $self->getNextflowLsfScratchEnvBlock();
my $clusterConfigFile = "\$baseDir/conf/${executor}.config";
if ($undo) {
$self->runCmd(0, "rm $workflowDataDir/$nextflowConfigFile");
} else {
my $nextflowConfig = "$workflowDataDir/$nextflowConfigFile";
open(F, ">$nextflowConfig") || die "Can't open task prop file '$nextflowConfig' for writing";
my $proteinSequenceFileInNextflowWorkingDirOnCluster = $self->relativePathToNextflowClusterPath($workingDirRelativePath, $proteinSequenceFile);
my $genomeSequenceFileInNextflowWorkingDirOnCluster = $self->relativePathToNextflowClusterPath($workingDirRelativePath, $genomicSequenceFile);
my $lineageMappersFileInNextflowWorkingDirOnCluster = $self->relativePathToNextflowClusterPath($workingDirRelativePath, $lineageMappersFile);
my $resultsDirectoryInNextflowWorkingDirOnCluster = $self->relativePathToNextflowClusterPath($workingDirRelativePath, $resultsDirectory);
my $configString = <<NEXTFLOW;
params {
genomeFile = "$genomeSequenceFileInNextflowWorkingDirOnCluster"
proteinFile = "$proteinSequenceFileInNextflowWorkingDirOnCluster"
outDir = "$resultsDirectoryInNextflowWorkingDirOnCluster"
ncbiTaxId = $speciesNcbiTaxonId
buscoDownloadsDir = "$buscoLineagesDatabase"
lineageMappingFile = "$lineageMappersFileInNextflowWorkingDirOnCluster"
skipProteomeAnalysis = $skipProteomeAnalysis
}
process {
maxForks = $maxForks
}
includeConfig "$clusterConfigFile"
NEXTFLOW
print F $configString . $lsfEnv;
close(F);
}
}
1;