Skip to content
GitLab
Menu
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
81e0124f
Commit
81e0124f
authored
Mar 09, 2015
by
bow
Browse files
Merge branch 'develop' into feature-gentrap
parents
f1441306
6b6fa613
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/summary/WriteSummary.scala
View file @
81e0124f
...
...
@@ -53,7 +53,7 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config
(
for
(
f
<-
qscript
.
functions
if
f
.
isInstanceOf
[
BiopetCommandLineFunctionTrait
])
yield
{
f
match
{
case
f
:
BiopetCommandLineFunctionTrait
=>
{
f
.
configName
->
Map
(
"version"
->
f
.
getVersion
,
f
.
configName
->
Map
(
"version"
->
f
.
getVersion
.
getOrElse
(
None
)
,
"md5"
->
BiopetCommandLineFunctionTrait
.
executableMd5Cache
.
getOrElse
(
f
.
executable
,
None
))
}
case
_
=>
throw
new
IllegalStateException
(
"This should not be possible"
)
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/Seqstat.scala
View file @
81e0124f
...
...
@@ -164,14 +164,11 @@ object Seqstat extends ToolCommand {
case
class
ReadStat
(
qual
:
mutable.ArrayBuffer
[
Long
]
=
mutable
.
ArrayBuffer
(),
nuc
:
mutable.ArrayBuffer
[
Long
]
=
mutable
.
ArrayBuffer
.
fill
(
'T'
.
toInt
+
1
)(
0
),
var
withN
:
Long
,
var
withN
:
Long
=
0L
,
lengths
:
mutable.ArrayBuffer
[
Int
]
=
mutable
.
ArrayBuffer
())
val
baseStats
:
mutable.ArrayBuffer
[
BaseStat
]
=
mutable
.
ArrayBuffer
()
val
readStats
:
ReadStat
=
new
ReadStat
(
mutable
.
ArrayBuffer
(),
mutable
.
ArrayBuffer
.
fill
(
'T'
.
toInt
+
1
)(
0
),
0L
,
mutable
.
ArrayBuffer
())
val
readStats
:
ReadStat
=
new
ReadStat
()
/**
* Compute the quality metric per read
...
...
@@ -194,6 +191,9 @@ object Seqstat extends ToolCommand {
val
readQual
=
record
.
getBaseQualityString
val
readNucleotides
=
record
.
getReadString
if
(
record
.
length
>=
readStats
.
lengths
.
size
)
// Extends array when length not yet possible
(
0
to
(
record
.
length
-
readStats
.
lengths
.
size
)).
foreach
(
_
=>
readStats
.
lengths
.
append
(
0
))
readStats
.
lengths
(
record
.
length
)
+=
1
for
(
t
<-
0
until
record
.
length
())
{
...
...
@@ -211,10 +211,7 @@ object Seqstat extends ToolCommand {
readStats
.
qual
++=
mutable
.
ArrayBuffer
.
fill
(
avgQual
-
readStats
.
qual
.
length
+
1
)(
0
)
}
readStats
.
qual
(
avgQual
)
+=
1
readStats
.
withN
+=
{
if
(
readNucleotides
.
contains
(
"N"
))
1L
else
0L
}
if
(
readNucleotides
.
contains
(
"N"
))
readStats
.
withN
+=
1L
}
/**
...
...
@@ -278,7 +275,7 @@ object Seqstat extends ToolCommand {
}
for
(
pos
<-
0
until
readStats
.
qual
.
length
)
{
va
r
key
:
Int
=
pos
-
phredEncoding
.
id
va
l
key
:
Int
=
pos
-
phredEncoding
.
id
if
(
key
>
0
)
{
// count till the max of baseHistogram.length
for
(
histokey
<-
0
until
key
+
1
)
{
...
...
@@ -319,7 +316,7 @@ object Seqstat extends ToolCommand {
),
(
"stats"
,
Map
(
(
"bases"
,
Map
(
(
"num_n"
,
nucleotideHistoMap
(
'N'
)),
(
"num_n"
,
nucleotideHistoMap
.
getOrElse
(
'N'
,
0
)),
(
"num_total"
,
nucleotideHistoMap
.
values
.
sum
),
(
"num_qual_gte"
,
baseQualHistoMap
.
toMap
),
(
"nucleotides"
,
nucleotideHistoMap
.
toMap
)
...
...
@@ -335,9 +332,6 @@ object Seqstat extends ToolCommand {
))
)
val
jsonReport
:
Json
=
{
ConfigUtils
.
mapToJson
(
report
)
}
println
(
jsonReport
.
spaces2
)
println
(
ConfigUtils
.
mapToJson
(
report
).
spaces2
)
}
}
Write
Preview
Supports
Markdown
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