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
66bf4e3f
Commit
66bf4e3f
authored
Mar 06, 2015
by
bow
Browse files
Fix missing adapter name in flexiprep summary
parent
2fb27c1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Cutadapt.scala
View file @
66bf4e3f
...
...
@@ -15,8 +15,11 @@
*/
package
nl.lumc.sasc.biopet.pipelines.flexiprep
import
nl.lumc.sasc.biopet.extensions.Ln
import
java.io.File
import
scala.collection.mutable
import
scala.io.Source
import
nl.lumc.sasc.biopet.extensions.Ln
import
nl.lumc.sasc.biopet.core.config.Configurable
class
Cutadapt
(
root
:
Configurable
)
extends
nl
.
lumc
.
sasc
.
biopet
.
extensions
.
Cutadapt
(
root
)
{
...
...
@@ -31,6 +34,36 @@ class Cutadapt(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Cutada
else
if
(
default_clip_mode
==
"both"
)
opt_anywhere
++=
foundAdapters
}
override
def
summaryStats
:
Map
[
String
,
Any
]
=
{
val
trimR
=
""".*Trimmed reads: *(\d*) .*"""
.
r
val
tooShortR
=
""".*Too short reads: *(\d*) .*"""
.
r
val
tooLongR
=
""".*Too long reads: *(\d*) .*"""
.
r
val
adapterR
=
"""Adapter '([C|T|A|G]*)'.*trimmed (\d*) times."""
.
r
val
stats
:
mutable.Map
[
String
,
Int
]
=
mutable
.
Map
(
"trimmed"
->
0
,
"tooshort"
->
0
,
"toolong"
->
0
)
val
adapter_stats
:
mutable.Map
[
String
,
(
String
,
Int
)]
=
mutable
.
Map
()
if
(
stats_output
.
exists
)
for
(
line
<-
Source
.
fromFile
(
stats_output
).
getLines
)
{
line
match
{
case
trimR
(
m
)
=>
stats
+=
(
"trimmed"
->
m
.
toInt
)
case
tooShortR
(
m
)
=>
stats
+=
(
"tooshort"
->
m
.
toInt
)
case
tooLongR
(
m
)
=>
stats
+=
(
"toolong"
->
m
.
toInt
)
case
adapterR
(
adapter
,
count
)
=>
val
adapterName
=
fastqc
.
foundAdapters
.
find
(
_
.
seq
==
adapter
)
match
{
case
None
=>
"unknown"
case
Some
(
a
)
=>
a
.
name
}
adapter_stats
+=
(
adapter
->
(
adapterName
,
count
.
toInt
))
case
_
=>
}
}
Map
(
"num_reads_affected"
->
stats
(
"trimmed"
),
"num_reads_discarded_too_short"
->
stats
(
"tooshort"
),
"num_reads_discarded_too_long"
->
stats
(
"toolong"
),
"adapters"
->
adapter_stats
.
toMap
)
}
override
def
cmdLine
=
{
if
(
opt_adapter
.
nonEmpty
||
opt_anywhere
.
nonEmpty
||
opt_front
.
nonEmpty
)
{
analysisName
=
getClass
.
getSimpleName
...
...
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