Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
d1f28ea8
Commit
d1f28ea8
authored
Nov 18, 2014
by
Peter van 't Hof
Browse files
Alow for multiple configs in BIOPET_CONFIG and BIO_CONFIG_SCATTER
parent
e69b6f0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
View file @
d1f28ea8
...
...
@@ -15,6 +15,9 @@ trait BiopetQScript extends Configurable {
@Argument
(
doc
=
"Output directory"
,
fullName
=
"output_directory"
,
shortName
=
"outDir"
,
required
=
true
)
var
outputDir
:
String
=
_
@Argument
(
doc
=
"Use scatter defaults, env vale BIOPET_CONFIG_SCATTER"
,
shortName
=
"SC"
,
required
=
false
)
var
useScatterDefault
:
Boolean
=
false
var
outputFiles
:
Map
[
String
,
File
]
=
Map
()
var
qSettings
:
QSettings
...
...
@@ -25,6 +28,7 @@ trait BiopetQScript extends Configurable {
var
functions
:
Seq
[
QFunction
]
final
def
script
()
{
if
(
useScatterDefault
)
Config
.
global
.
loadDefaultScatterConfig
if
(!
outputDir
.
endsWith
(
"/"
))
outputDir
+=
"/"
init
biopetScript
...
...
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala
View file @
d1f28ea8
...
...
@@ -12,15 +12,24 @@ class Config(var map: Map[String, Any]) extends Logging {
loadDefaultConfig
()
}
def
load
DefaultConfig
(
)
{
var
globalFile
:
String
=
System
.
getenv
(
"BIOPET_CONFIG
"
)
i
f
(
globalFile
!=
null
)
{
def
load
ConfigEnv
(
valueName
:
String
)
{
var
globalFile
s
=
System
.
getenv
(
valueName
).
split
(
":
"
)
f
or
(
globalFile
<-
globalFiles
)
{
var
file
:
File
=
new
File
(
globalFile
)
if
(
file
.
exists
())
{
logger
.
info
(
"Loading config file: "
+
file
)
loadConfigFile
(
file
)
}
else
logger
.
warn
(
"BIOPET_CONFIG value found but file does not exist, no global config is loaded"
)
}
else
logger
.
info
(
"BIOPET_CONFIG value not found, no global config is loaded"
)
}
else
logger
.
warn
(
valueName
+
" value found but file does not exist, no global config is loaded"
)
}
if
(
globalFiles
.
isEmpty
)
logger
.
info
(
valueName
+
" value not found, no global config is loaded"
)
}
def
loadDefaultConfig
()
{
loadConfigEnv
(
"BIOPET_CONFIG"
)
}
def
loadDefaultScatterConfig
()
{
loadConfigEnv
(
"BIOPET_CONFIG_SCATTER"
)
}
def
loadConfigFile
(
configFile
:
File
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment