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
8de54663
Commit
8de54663
authored
Nov 23, 2016
by
Sander Bollen
Browse files
xhmm discover stats file
parent
997c7f15
Changes
1
Hide whitespace changes
Inline
Side-by-side
biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/xhmm/XhmmDiscover.scala
View file @
8de54663
...
@@ -2,13 +2,16 @@ package nl.lumc.sasc.biopet.extensions.xhmm
...
@@ -2,13 +2,16 @@ package nl.lumc.sasc.biopet.extensions.xhmm
import
java.io.File
import
java.io.File
import
nl.lumc.sasc.biopet.core.summary.Summarizable
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Argument
,
Input
,
Output
}
import
org.broadinstitute.gatk.utils.commandline.
{
Argument
,
Input
,
Output
}
import
scala.io.Source
/**
/**
* Created by Sander Bollen on 23-11-16.
* Created by Sander Bollen on 23-11-16.
*/
*/
class
XhmmDiscover
(
val
root
:
Configurable
)
extends
Xhmm
{
class
XhmmDiscover
(
val
root
:
Configurable
)
extends
Xhmm
with
Summarizable
{
@Input
@Input
var
inputMatrix
:
File
=
_
var
inputMatrix
:
File
=
_
...
@@ -38,4 +41,24 @@ class XhmmDiscover(val root: Configurable) extends Xhmm {
...
@@ -38,4 +41,24 @@ class XhmmDiscover(val root: Configurable) extends Xhmm {
required
(
"-s"
,
xhmmAnalysisName
)
required
(
"-s"
,
xhmmAnalysisName
)
}
}
case
class
XcnvLine
(
sample
:
String
,
cnvType
:
String
,
location
:
String
)
def
summaryFiles
:
Map
[
String
,
File
]
=
Map
()
def
summaryStats
:
Map
[
String
,
Any
]
=
{
val
lines
=
Source
.
fromFile
(
outputXcnv
).
getLines
().
filter
(
p
=>
!
p
.
startsWith
(
"SAMPLE"
)).
map
(
x
=>
x
.
split
(
"\t"
)).
map
(
x
=>
XcnvLine
(
x
(
0
),
x
(
1
),
x
(
2
))).
toList
val
samples
=
lines
.
map
(
_
.
sample
)
samples
.
map
{
x
=>
val
sampleLines
=
lines
.
filter
(
_
.
sample
==
x
)
x
->
Map
(
"DEL"
->
sampleLines
.
count
(
_
.
cnvType
==
"DEL"
),
"DUP"
->
sampleLines
.
count
(
_
.
cnvType
==
"DUP"
))
}.
toMap
}
}
}
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