Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
b8dc37ad
Commit
b8dc37ad
authored
10 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Added new summary to fastqsync
parent
0eed5996
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/FastqSync.scala
+44
-1
44 additions, 1 deletion
.../src/main/scala/nl/lumc/sasc/biopet/tools/FastqSync.scala
with
44 additions
and
1 deletion
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/FastqSync.scala
+
44
−
1
View file @
b8dc37ad
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
package
nl.lumc.sasc.biopet.tools
package
nl.lumc.sasc.biopet.tools
import
java.io.File
import
java.io.File
import
nl.lumc.sasc.biopet.core.summary.Summarizable
import
scala.io.Source
import
scala.io.Source
import
scala.util.matching.Regex
import
scala.util.matching.Regex
...
@@ -29,7 +31,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
...
@@ -29,7 +31,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
*
*
* @param root Configuration object for the pipeline
* @param root Configuration object for the pipeline
*/
*/
class
FastqSync
(
val
root
:
Configurable
)
extends
BiopetJavaCommandLineFunction
{
class
FastqSync
(
val
root
:
Configurable
)
extends
BiopetJavaCommandLineFunction
with
Summarizable
{
javaMainClass
=
getClass
.
getName
javaMainClass
=
getClass
.
getName
...
@@ -63,6 +65,47 @@ class FastqSync(val root: Configurable) extends BiopetJavaCommandLineFunction {
...
@@ -63,6 +65,47 @@ class FastqSync(val root: Configurable) extends BiopetJavaCommandLineFunction {
required
(
"-p"
,
outputFastq2
)
+
" > "
+
required
(
"-p"
,
outputFastq2
)
+
" > "
+
required
(
outputStats
)
required
(
outputStats
)
def
summaryFiles
:
Map
[
String
,
File
]
=
{
Map
(
"refFastq"
->
refFastq
,
"inputFastq1"
->
inputFastq1
,
"inputFastq2"
->
inputFastq2
,
"outputFastq1"
->
outputFastq1
,
"outputFastq2"
->
outputFastq2
)
}
def
summaryData
:
Map
[
String
,
Any
]
=
{
val
regex
=
new
Regex
(
"""Filtered (\d*) reads from first read file.
|Filtered (\d*) reads from second read file.
|Synced read files contain (\d*) reads."""
.
stripMargin
,
"R1"
,
"R2"
,
"RL"
)
val
(
countFilteredR1
,
countFilteredR2
,
countRLeft
)
=
if
(
outputStats
.
exists
)
{
val
text
=
Source
.
fromFile
(
outputStats
)
.
getLines
()
.
mkString
(
"\n"
)
regex
.
findFirstMatchIn
(
text
)
match
{
case
None
=>
(
0
,
0
,
0
)
case
Some
(
rmatch
)
=>
(
rmatch
.
group
(
"R1"
).
toInt
,
rmatch
.
group
(
"R2"
).
toInt
,
rmatch
.
group
(
"RL"
).
toInt
)
}
}
else
(
0
,
0
,
0
)
Map
(
"version"
->
getVersion
,
"num_reads_discarded_R1"
->
countFilteredR1
,
"num_reads_discarded_R2"
->
countFilteredR2
,
"num_reads_kept"
->
countRLeft
)
}
override
def
resolveSummaryConflict
(
v1
:
Any
,
v2
:
Any
,
key
:
String
)
:
Any
=
{
(
v1
,
v2
)
match
{
case
(
v1
:
Int
,
v2
:
Int
)
=>
v1
+
v2
case
_
=>
v1
}
}
// summary statistics
// summary statistics
def
summary
:
Json
=
{
def
summary
:
Json
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment