Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
biopet.biopet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Mirrors
biopet.biopet
Commits
21fba762
Commit
21fba762
authored
Feb 12, 2015
by
Peter van 't Hof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some small bugs
parent
2a906887
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunctionTrait.scala
...umc/sasc/biopet/core/BiopetCommandLineFunctionTrait.scala
+8
-2
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
...c/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
+4
-2
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala
...c/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala
+3
-3
No files found.
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunctionTrait.scala
View file @
21fba762
...
...
@@ -48,7 +48,8 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
protected
[
core
]
def
beforeCmd
{}
/**
* Can override this method. This is executed after the script is done en queue starts to generate the graph
* Can overr
* ide this method. This is executed after the script is done en queue starts to generate the graph
*/
protected
[
core
]
def
afterGraph
{}
//TODO: function need rename to beforeGraph
...
...
@@ -123,7 +124,10 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
beforeCmd
addJobReportBinding
(
"cores"
,
if
(
nCoresRequest
.
get
.
toInt
>
0
)
nCoresRequest
.
get
.
toInt
else
1
)
addJobReportBinding
(
"cores"
,
nCoresRequest
match
{
case
Some
(
n
)
if
n
>
0
=>
n
case
_
=>
1
})
addJobReportBinding
(
"version"
,
getVersion
)
}
...
...
@@ -166,6 +170,8 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
/** Get version from cache otherwise execute the version command */
def
getVersion
:
String
=
{
if
(!
BiopetCommandLineFunctionTrait
.
executableCache
.
contains
(
executable
))
checkExecutable
if
(!
BiopetCommandLineFunctionTrait
.
versionCache
.
contains
(
executable
))
BiopetCommandLineFunctionTrait
.
versionCache
+=
executable
->
getVersionInternal
return
BiopetCommandLineFunctionTrait
.
versionCache
(
executable
)
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
View file @
21fba762
...
...
@@ -73,12 +73,14 @@ trait BiopetQScript extends Configurable with GatkLogging {
case
f
:
BiopetCommandLineFunctionTrait
=>
{
f
.
checkExecutable
f
.
afterGraph
f
.
commandLine
}
case
_
=>
}
if
(
outputDir
.
canWrite
)
globalConfig
.
writeReport
(
qSettings
.
runName
,
outputDir
+
".log/"
+
qSettings
.
runName
)
else
BiopetQScript
.
addError
(
"Output dir: '"
+
outputDir
+
"' is not writeable"
)
if
(
outputDir
.
getParentFile
.
canWrite
||
(
outputDir
.
exists
&&
outputDir
.
canWrite
))
globalConfig
.
writeReport
(
qSettings
.
runName
,
new
File
(
outputDir
,
".log/"
+
qSettings
.
runName
))
else
BiopetQScript
.
addError
(
"Parent of output dir: '"
+
outputDir
.
getParent
+
"' is not writeable, outputdir can not be created"
)
BiopetQScript
.
checkErrors
}
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Config.scala
View file @
21fba762
...
...
@@ -140,7 +140,8 @@ class Config(var map: Map[String, Any]) extends Logging {
}
else
ConfigValue
(
requestedIndex
,
null
,
null
,
freeVar
)
}
def
writeReport
(
id
:
String
,
directory
:
String
)
:
Unit
=
{
def
writeReport
(
id
:
String
,
directory
:
File
)
:
Unit
=
{
directory
.
mkdirs
()
def
convertIndexValuesToMap
(
input
:
List
[(
ConfigValueIndex
,
Any
)],
forceFreeVar
:
Option
[
Boolean
]
=
None
)
:
Map
[
String
,
Any
]
=
{
input
.
foldLeft
(
Map
[
String
,
Any
]())(
...
...
@@ -155,8 +156,7 @@ class Config(var map: Map[String, Any]) extends Logging {
}
def
writeMapToJsonFile
(
map
:
Map
[
String
,
Any
],
name
:
String
)
:
Unit
=
{
val
file
=
new
File
(
directory
+
"/"
+
id
+
"."
+
name
+
".json"
)
file
.
getParentFile
.
mkdirs
()
val
file
=
new
File
(
directory
,
id
+
"."
+
name
+
".json"
)
val
writer
=
new
PrintWriter
(
file
)
writer
.
write
(
ConfigUtils
.
mapToJson
(
map
).
spaces2
)
writer
.
close
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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