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
ce8bb5c9
Commit
ce8bb5c9
authored
Aug 28, 2014
by
Peter van 't Hof
Browse files
Merge commit '
c1fa781e
' into peter
parents
11faecb0
c1fa781e
Changes
5
Hide whitespace changes
Inline
Side-by-side
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Cutadapt.scala
View file @
ce8bb5c9
...
...
@@ -84,7 +84,7 @@ object Cutadapt {
return
cutadapt
}
def
mergeSummar
y
s
(
jsons
:
List
[
Json
])
:
Json
=
{
def
mergeSummar
ie
s
(
jsons
:
List
[
Json
])
:
Json
=
{
var
affected
=
0
var
tooShort
=
0
var
tooLong
=
0
...
...
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/FlexiprepSummary.scala
View file @
ce8bb5c9
...
...
@@ -47,7 +47,7 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co
var
flexiprep
:
Flexiprep
=
root
.
asInstanceOf
[
Flexiprep
]
var
resour
s
es
:
Map
[
String
,
Json
]
=
Map
()
var
resour
c
es
:
Map
[
String
,
Json
]
=
Map
()
def
addFastqc
(
fastqc
:
Fastqc
,
R2
:
Boolean
=
false
,
after
:
Boolean
=
false
)
:
Fastqc
=
{
if
(!
R2
&&
!
after
)
this
.
fastqcR1
=
fastqc
...
...
@@ -104,7 +104,7 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co
md5Summary
()
val
summary
=
(
"samples"
:=
(
flexiprep
.
sampleName
:=
(
"
run
s"
:=
(
flexiprep
.
libraryName
:=
(
(
"
librarie
s"
:=
(
flexiprep
.
libraryName
:=
(
(
"flexiprep"
:=
(
(
"clipping"
:=
!
flexiprep
.
skipClip
)
->:
(
"trimming"
:=
!
flexiprep
.
skipTrim
)
->:
...
...
@@ -115,10 +115,10 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co
(
"clipping"
:=?
clipstatSummary
)
->?:
(
"trimming"
:=?
trimstatSummary
)
->?:
jEmptyObject
))
->:
(
"resour
s
es"
:=
((
"raw_R1"
:=
getResour
s
es
(
fastqcR1
,
md5R1
))
->:
(
"raw_R2"
:?=
getResour
s
es
(
fastqcR2
,
md5R2
))
->?:
(
"proc_R1"
:?=
getResour
s
es
(
fastqcR1after
,
md5R1after
))
->?:
(
"proc_R2"
:?=
getResour
s
es
(
fastqcR2after
,
md5R2after
))
->?:
(
"resour
c
es"
:=
((
"raw_R1"
:=
getResour
c
es
(
fastqcR1
,
md5R1
))
->:
(
"raw_R2"
:?=
getResour
c
es
(
fastqcR2
,
md5R2
))
->?:
(
"proc_R1"
:?=
getResour
c
es
(
fastqcR1after
,
md5R1after
))
->?:
(
"proc_R2"
:?=
getResour
c
es
(
fastqcR2after
,
md5R2after
))
->?:
jEmptyObject
))
->:
jEmptyObject
))->:
jEmptyObject
)->:
jEmptyObject
)->:
jEmptyObject
)
->:
jEmptyObject
// format: ON
...
...
@@ -132,25 +132,25 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co
def
seqstatSummary
()
:
Option
[
Json
]
=
{
val
R1_chunks
=
for
((
key
,
value
)
<-
chunks
)
yield
value
.
seqstatR1
.
getSummary
val
R1
:
Json
=
Seqstat
.
mergeSummar
y
s
(
R1_chunks
.
toList
)
val
R1
:
Json
=
Seqstat
.
mergeSummar
ie
s
(
R1_chunks
.
toList
)
val
R2
:
Option
[
Json
]
=
if
(!
flexiprep
.
paired
)
None
else
if
(
chunks
.
size
==
1
)
Option
(
chunks
.
head
.
_2
.
seqstatR2
.
getSummary
)
else
{
val
s
=
for
((
key
,
value
)
<-
chunks
)
yield
value
.
seqstatR2
.
getSummary
Option
(
Seqstat
.
mergeSummar
y
s
(
s
.
toList
))
Option
(
Seqstat
.
mergeSummar
ie
s
(
s
.
toList
))
}
val
R1_proc
:
Option
[
Json
]
=
if
(
flexiprep
.
skipClip
&&
flexiprep
.
skipTrim
)
None
else
if
(
chunks
.
size
==
1
)
Option
(
chunks
.
head
.
_2
.
seqstatR1after
.
getSummary
)
else
{
val
s
=
for
((
key
,
value
)
<-
chunks
)
yield
value
.
seqstatR1after
.
getSummary
Option
(
Seqstat
.
mergeSummar
y
s
(
s
.
toList
))
Option
(
Seqstat
.
mergeSummar
ie
s
(
s
.
toList
))
}
val
R2_proc
:
Option
[
Json
]
=
if
(!
flexiprep
.
paired
||
(
flexiprep
.
skipClip
&&
flexiprep
.
skipTrim
))
None
else
if
(
chunks
.
size
==
1
)
Option
(
chunks
.
head
.
_2
.
seqstatR2after
.
getSummary
)
else
{
val
s
=
for
((
key
,
value
)
<-
chunks
)
yield
value
.
seqstatR2after
.
getSummary
Option
(
Seqstat
.
mergeSummar
y
s
(
s
.
toList
))
Option
(
Seqstat
.
mergeSummar
ie
s
(
s
.
toList
))
}
return
Option
((
"R1_raw"
:=
R1
)
->:
(
"R2_raw"
:=?
R2
)
->?:
...
...
@@ -165,10 +165,10 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co
val
R1_proc
=
md5Summary
(
md5R1after
)
val
R2_proc
=
md5Summary
(
md5R2after
)
if
(!
R1_raw
.
isEmpty
)
resour
s
es
+=
(
"fastq_R1_raw"
->
R1_raw
.
get
)
if
(!
R2_raw
.
isEmpty
)
resour
s
es
+=
(
"fastq_R2_raw"
->
R2_raw
.
get
)
if
(!
R1_proc
.
isEmpty
)
resour
s
es
+=
(
"fastq_R1_proc"
->
R1_proc
.
get
)
if
(!
R2_proc
.
isEmpty
)
resour
s
es
+=
(
"fastq_R2_proc"
->
R2_proc
.
get
)
if
(!
R1_raw
.
isEmpty
)
resour
c
es
+=
(
"fastq_R1_raw"
->
R1_raw
.
get
)
if
(!
R2_raw
.
isEmpty
)
resour
c
es
+=
(
"fastq_R2_raw"
->
R2_raw
.
get
)
if
(!
R1_proc
.
isEmpty
)
resour
c
es
+=
(
"fastq_R1_proc"
->
R1_proc
.
get
)
if
(!
R2_proc
.
isEmpty
)
resour
c
es
+=
(
"fastq_R2_proc"
->
R2_proc
.
get
)
}
def
md5Summary
(
md5sum
:
Md5sum
)
:
Option
[
Json
]
=
{
...
...
@@ -176,7 +176,7 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co
else
return
Option
(
md5sum
.
getSummary
)
}
def
getResour
s
es
(
fastqc
:
Fastqc
,
md5sum
:
Md5sum
)
:
Option
[
Json
]
=
{
def
getResour
c
es
(
fastqc
:
Fastqc
,
md5sum
:
Md5sum
)
:
Option
[
Json
]
=
{
if
(
fastqc
==
null
||
md5sum
==
null
)
return
None
val
fastqcSum
=
fastqcSummary
(
fastqc
).
get
return
Option
((
"fastq"
:=
md5Summary
(
md5sum
))
->:
fastqcSum
)
...
...
@@ -192,13 +192,13 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co
val
R1
:
Json
=
if
(
chunks
.
size
==
1
)
chunks
.
head
.
_2
.
cutadaptR1
.
getSummary
else
{
val
s
=
for
((
key
,
value
)
<-
chunks
)
yield
value
.
cutadaptR1
.
getSummary
Cutadapt
.
mergeSummar
y
s
(
s
.
toList
)
Cutadapt
.
mergeSummar
ie
s
(
s
.
toList
)
}
val
R2
:
Option
[
Json
]
=
if
(!
flexiprep
.
paired
)
None
else
if
(
chunks
.
size
==
1
)
Option
(
chunks
.
head
.
_2
.
cutadaptR2
.
getSummary
)
else
{
val
s
=
for
((
key
,
value
)
<-
chunks
)
yield
value
.
cutadaptR2
.
getSummary
Option
(
Cutadapt
.
mergeSummar
y
s
(
s
.
toList
))
Option
(
Cutadapt
.
mergeSummar
ie
s
(
s
.
toList
))
}
return
Option
((
"R1"
:=
R1
)
->:
(
"R2"
:=?
R2
)
->?:
...
...
@@ -209,7 +209,7 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co
def
syncstatSummary
()
:
Option
[
Json
]
=
{
if
(
flexiprep
.
skipClip
||
!
flexiprep
.
paired
)
return
None
val
s
=
for
((
key
,
value
)
<-
chunks
)
yield
value
.
fastqSync
.
getSummary
return
Option
(
FastqSync
.
mergeSummar
y
s
(
s
.
toList
))
return
Option
(
FastqSync
.
mergeSummar
ie
s
(
s
.
toList
))
}
def
trimstatSummary
()
:
Option
[
Json
]
=
{
...
...
@@ -217,7 +217,7 @@ class FlexiprepSummary(val root: Configurable) extends InProcessFunction with Co
if
(
chunks
.
size
==
1
)
return
Option
(
chunks
.
head
.
_2
.
sickle
.
getSummary
)
else
{
val
s
=
for
((
key
,
value
)
<-
chunks
)
yield
value
.
sickle
.
getSummary
return
Option
(
Sickle
.
mergeSummar
y
s
(
s
.
toList
))
return
Option
(
Sickle
.
mergeSummar
ie
s
(
s
.
toList
))
}
}
}
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Sickle.scala
View file @
ce8bb5c9
...
...
@@ -39,7 +39,7 @@ class Sickle(root: Configurable) extends nl.lumc.sasc.biopet.extensions.Sickle(r
}
object
Sickle
{
def
mergeSummar
y
s
(
jsons
:
List
[
Json
])
:
Json
=
{
def
mergeSummar
ie
s
(
jsons
:
List
[
Json
])
:
Json
=
{
var
total
:
Map
[
String
,
Int
]
=
Map
()
for
(
json
<-
jsons
)
{
...
...
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/scripts/FastqSync.scala
View file @
ce8bb5c9
...
...
@@ -82,7 +82,7 @@ object FastqSync {
return
fastqSync
}
def
mergeSummar
y
s
(
jsons
:
List
[
Json
])
:
Json
=
{
def
mergeSummar
ie
s
(
jsons
:
List
[
Json
])
:
Json
=
{
var
R1_filtered
=
0
var
R2_filtered
=
0
var
readsLeft
=
0
...
...
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/scripts/Seqstat.scala
View file @
ce8bb5c9
...
...
@@ -47,7 +47,7 @@ object Seqstat {
return
seqstat
}
def
mergeSummar
y
s
(
jsons
:
List
[
Json
])
:
Json
=
{
def
mergeSummar
ie
s
(
jsons
:
List
[
Json
])
:
Json
=
{
def
addJson
(
json
:
Json
,
total
:
Map
[
String
,
Long
])
{
for
(
key
<-
json
.
objectFieldsOrEmpty
)
{
if
(
json
.
field
(
key
).
get
.
isObject
)
addJson
(
json
.
field
(
key
).
get
,
total
)
...
...
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