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
168543b0
Commit
168543b0
authored
Nov 28, 2016
by
Peter van 't Hof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch from dot to gv files
parent
211bcfda
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
13 deletions
+18
-13
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
...c/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
+3
-2
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/WriteDependencies.scala
...in/scala/nl/lumc/sasc/biopet/core/WriteDependencies.scala
+8
-8
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/summary/WriteSummary.scala
...scala/nl/lumc/sasc/biopet/core/summary/WriteSummary.scala
+7
-3
No files found.
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
View file @
168543b0
...
...
@@ -16,7 +16,7 @@ package nl.lumc.sasc.biopet.core
import
java.io.File
import
nl.lumc.sasc.biopet.core.summary.
SummaryQScript
import
nl.lumc.sasc.biopet.core.summary.
{
SummaryQScript
,
WriteSummary
}
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.core.report.ReportBuilderExtension
import
nl.lumc.sasc.biopet.utils.Logging
...
...
@@ -98,7 +98,8 @@ trait BiopetQScript extends Configurable with GatkLogging { qscript: QScript =>
f
.
beforeGraph
()
f
.
internalBeforeGraph
()
f
.
commandLine
case
_
=>
case
f
:
WriteSummary
=>
f
.
init
()
case
_
=>
}
if
(
outputDir
.
getParentFile
.
canWrite
||
(
outputDir
.
exists
&&
outputDir
.
canWrite
))
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/WriteDependencies.scala
View file @
168543b0
...
...
@@ -110,13 +110,13 @@ object WriteDependencies extends Logging with Configurable {
val
jobs
=
functionNames
.
par
.
map
{
case
(
f
,
name
)
=>
name
->
Map
(
"command"
->
(
f
match
{
name
.
toString
->
Map
(
"command"
->
(
f
match
{
case
cmd
:
CommandLineFunction
=>
cmd
.
commandLine
case
_
=>
None
}),
"main_job"
->
(
f
match
{
case
cmd
:
BiopetCommandLineFunction
=>
cmd
.
mainFunction
case
cmd
:
BiopetCommandLineFunction
=>
cmd
.
mainFunction
case
s
:
WriteSummary
if
s.qscript.root
=
=
null
=>
true
case
_
=>
false
case
_
=>
false
}),
"intermediate"
->
f
.
isIntermediate
,
"depends_on_intermediate"
->
f
.
inputs
.
exists
(
files
(
_
).
isIntermediate
),
"depends_on_jobs"
->
f
.
inputs
.
toList
.
flatMap
(
files
(
_
).
outputJobNames
).
distinct
,
...
...
@@ -140,7 +140,7 @@ object WriteDependencies extends Logging with Configurable {
val
jobsWriter
=
new
PrintWriter
(
new
File
(
outputDir
,
s
"$prefix.jobs.json"
))
jobsWriter
.
println
(
ConfigUtils
.
mapToJson
(
jobsDeps
).
spaces2
)
jobsWriter
.
close
()
write
DotFile
(
jobsDeps
,
new
File
(
outputDir
,
s
"$prefix.jobs.dot
"
))
write
GraphvizFile
(
jobsDeps
,
new
File
(
outputDir
,
s
"$prefix.jobs.gv
"
))
val
mainJobs
=
jobs
.
filter
(
_
.
_2
(
"main_job"
)
==
true
).
map
{
case
(
name
,
job
)
=>
...
...
@@ -150,7 +150,7 @@ object WriteDependencies extends Logging with Configurable {
val
mainJobsWriter
=
new
PrintWriter
(
new
File
(
outputDir
,
s
"$prefix.main_jobs.json"
))
mainJobsWriter
.
println
(
ConfigUtils
.
mapToJson
(
mainJobs
).
spaces2
)
mainJobsWriter
.
close
()
write
DotFile
(
mainJobs
,
new
File
(
outputDir
,
s
"$prefix.main_jobs.dot
"
))
write
GraphvizFile
(
mainJobs
,
new
File
(
outputDir
,
s
"$prefix.main_jobs.gv
"
))
logger
.
info
(
"done calculating dependencies"
)
}
...
...
@@ -168,10 +168,10 @@ object WriteDependencies extends Logging with Configurable {
}.
distinct
}
def
write
Dot
File
(
jobs
:
Map
[
String
,
List
[
String
]],
outputFile
:
File
)
:
Unit
=
{
def
write
Graphviz
File
(
jobs
:
Map
[
String
,
List
[
String
]],
outputFile
:
File
)
:
Unit
=
{
val
writer
=
new
PrintWriter
(
outputFile
)
writer
.
println
(
"digraph graphname {"
)
jobs
.
foreach
{
case
(
a
,
b
)
=>
b
.
foreach
(
c
=>
writer
.
println
(
s
" $c -> $a;"
))
}
writer
.
println
(
"digraph graphname {"
)
jobs
.
foreach
{
case
(
a
,
b
)
=>
b
.
foreach
(
c
=>
writer
.
println
(
s
" $c -> $a;"
))
}
writer
.
println
(
"}"
)
writer
.
close
()
}
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/summary/WriteSummary.scala
View file @
168543b0
...
...
@@ -49,15 +49,19 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config
//TODO: add more checksums types
override
def
freezeFieldValues
()
:
Unit
=
{
for
(
q
<-
qscript
.
summaryQScripts
)
deps
:+=
q
.
summaryFile
init
()
super
.
freezeFieldValues
()
}
def
init
()
:
Unit
=
{
for
(
q
<-
qscript
.
summaryQScripts
)
deps
:+=
q
.
summaryFile
for
((
_
,
l
)
<-
qscript
.
summarizables
;
s
<-
l
)
s
match
{
case
f
:
QFunction
=>
deps
:+=
f
.
firstOutput
case
_
=>
}
jobOutputFile
=
new
File
(
out
.
getParentFile
,
".%s.%s.out"
.
format
(
out
.
getName
,
analysisName
))
super
.
freezeFieldValues
()
}
/** Function to create summary */
...
...
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