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
66bf4e3f
Commit
66bf4e3f
authored
10 years ago
by
bow
Browse files
Options
Downloads
Patches
Plain Diff
Fix missing adapter name in flexiprep summary
parent
2fb27c1b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Cutadapt.scala
+34
-1
34 additions, 1 deletion
...la/nl/lumc/sasc/biopet/pipelines/flexiprep/Cutadapt.scala
with
34 additions
and
1 deletion
public/flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Cutadapt.scala
+
34
−
1
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
...
...
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