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
459d68dc
Commit
459d68dc
authored
Mar 09, 2016
by
Wai Yi Leung
Browse files
Merge branch 'feature-docs-0.6.0' of git.lumc.nl:biopet/biopet into feature-docs-0.6.0
parents
d1df33e7
5103109c
Changes
2
Hide whitespace changes
Inline
Side-by-side
docs/developer/example-pipeline.md
View file @
459d68dc
...
...
@@ -155,4 +155,46 @@ Since our pipeline is called `HelloPipeline`, the root of the configoptions will
### Summary output
Any pipeline that mixes in
`SummaryQscript`
will produce a summary json.
This summary json usually contains statistics and some output results.
By mixing in
`SummaryQscript`
, the new pipeline needs to implement three functions:
1.
`summaryFile: File`
2.
`summaryFiles: Map[String, File]`
3.
`summarySettings: Map[String, Any]`
Of those three,
`summaryFile`
is the most important one, and should point to the file where the summary will be written to.
The
`summaryFiles`
function should contain any extra files one would like to add to the summary.
Files are listed in a separate
`files`
JSON object, and will by default include any executables used in the pipelines.
The
`summarySettings`
function should contain any extra settings one would like to add to the summary.
Settings are listed in a separate
`settings`
JSON object.
Apart from these fields, the summary JSON will be populated with statistics from tool extensions that mix in
`Summarizable`
.
To populate these statistics, one has to call
`addSummarizable`
on the tool.
For instance, let's go back to the
`fastqc`
example. The original declaration was:
```
scala
val
fastqc
=
new
Fastqc
(
this
)
fastqc
.
fastqfile
=
config
(
"fastqc_input"
)
fastqc
.
output
=
new
File
(
outputDir
,
"fastqc.txt"
)
// change kmers settings to 9, wrap with `Some()` because `fastqc.kmers` is a `Option` value.
fastqc
.
kmers
=
Some
(
9
)
add
(
fastqc
)
```
To add the fastqc summary to our summary JSON all we have to do is write the following line afterwards:
```
scala
addSummarizable
(
fastqc
)
```
Summary statistics for fastqc will then end up in a
`stats`
JSON object in the summary.
See the
[
tool tutorial
](
example-tool.md
)
for how to make a tool extension produce any summary output.
### Reporting output (optional)
\ No newline at end of file
docs/developer/example-tool.md
View file @
459d68dc
...
...
@@ -210,4 +210,30 @@ object SimpleTool {
### Summary setup (for reporting results to JSON)
Any tool extension can create summary output for use within a larger pipeline.
To accomplish this, it first has to mix in the
`Summarizable`
trait.
Once that its done, it must implement the following functions:
1.
`summaryFiles: Map[String, File]`
2.
`summaryStats: Map[String, Any]`
The first of these can contain any files one wishes to include into the summary, but can be just an empty map.
The second function,
`summaryStats`
, should create a map of statistics.
This function is only executed after the tool has completed running, and it is therefore possible to extract values from the output.
Suppose, that our tool simply creates a file that lists the amount of lines in the input file.
We could then extract this value, and store it in the summary through the
`summaryStats`
function.
This would look like the following:
```
scala
def
summaryStats
:
Map
[
String
,
Any
]
=
{
Map
(
"count"
->
Source
.
fromFile
(
output
).
getLines
.
head
.
toInt
)
}
```
See the
[
pipeline tutorial
](
example-pipeline.md
)
for how to use these statistics in a pipeline.
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