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
e70a3c2e
Commit
e70a3c2e
authored
Jul 21, 2017
by
pjvan_thof
Browse files
Fixed path in stats.json
parent
3b61a8de
Changes
2
Hide whitespace changes
Inline
Side-by-side
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/vcfstats/Stats.scala
View file @
e70a3c2e
...
...
@@ -17,11 +17,10 @@ package nl.lumc.sasc.biopet.tools.vcfstats
import
java.io.
{
File
,
FileOutputStream
,
IOException
,
PrintWriter
}
import
nl.lumc.sasc.biopet.tools.vcfstats.Stats.plotHeatmap
import
nl.lumc.sasc.biopet.tools.vcfstats.VcfStats.
{
getClass
,
logger
,
sampleDistributions
}
import
scala.collection.mutable
import
nl.lumc.sasc.biopet.tools.vcfstats.VcfStats.logger
import
nl.lumc.sasc.biopet.utils.
{
ConfigUtils
,
sortAnyAny
}
import
scala.collection.mutable
import
scala.sys.process.
{
Process
,
ProcessLogger
}
/**
...
...
@@ -161,26 +160,32 @@ case class Stats(generalStats: mutable.Map[String, mutable.Map[Any, Int]] = muta
def
writeAllOutput
(
outputDir
:
File
,
samples
:
List
[
String
],
genotypeFields
:
List
[
String
]
=
Nil
,
infoFields
:
List
[
String
]
=
Nil
,
sampleDistributions
:
List
[
String
]
=
Nil
)
:
Unit
=
{
genotypeFields
:
List
[
String
],
infoFields
:
List
[
String
],
sampleDistributions
:
List
[
String
],
contig
:
Option
[
String
])
:
Unit
=
{
outputDir
.
mkdirs
()
this
.
writeToFile
(
new
File
(
outputDir
,
"stats.json"
),
samples
,
genotypeFields
,
infoFields
,
sampleDistributions
)
sampleDistributions
,
contig
)
writeOverlap
(
outputDir
,
samples
)
}
def
writeToFile
(
outputFile
:
File
,
samples
:
List
[
String
],
genotypeFields
:
List
[
String
]
=
Nil
,
infoFields
:
List
[
String
]
=
Nil
,
sampleDistributions
:
List
[
String
]
=
Nil
)
:
Unit
=
{
genotypeFields
:
List
[
String
],
infoFields
:
List
[
String
],
sampleDistributions
:
List
[
String
],
contig
:
Option
[
String
])
:
Unit
=
{
val
allWriter
=
new
PrintWriter
(
outputFile
)
val
json
=
ConfigUtils
.
mapToJson
(
this
.
getStatsAsMap
(
samples
,
genotypeFields
,
infoFields
,
sampleDistributions
))
val
map
=
this
.
getStatsAsMap
(
samples
,
genotypeFields
,
infoFields
,
sampleDistributions
)
val
json
=
contig
match
{
case
Some
(
c
)
=>
ConfigUtils
.
mapToJson
(
Map
(
"contigs"
->
Map
(
c
->
map
)))
case
_
=>
ConfigUtils
.
mapToJson
(
Map
(
"total"
->
map
))
}
allWriter
.
println
(
json
.
nospaces
)
allWriter
.
close
()
}
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/vcfstats/VcfStats.scala
View file @
e70a3c2e
...
...
@@ -89,7 +89,8 @@ object VcfStats extends ToolCommand {
samples
,
adGenotypeTags
,
adInfoTags
,
sampleDistributions
))
sampleDistributions
,
None
))
regionStats
.
flatMap
(
_
.
_2
)
...
...
@@ -100,7 +101,8 @@ object VcfStats extends ToolCommand {
samples
,
adGenotypeTags
,
adInfoTags
,
sampleDistributions
)
sampleDistributions
,
Some
(
k
))
}
regionStats
.
unpersist
()
...
...
@@ -159,7 +161,8 @@ object VcfStats extends ToolCommand {
samples
,
adGenotypeTags
,
adInfoTags
,
sampleDistributions
)
sampleDistributions
,
Some
(
bedRecord
.
chr
))
None
}
}
else
Future
.
successful
(
Some
(
bedRecord
.
chr
->
stats
))
...
...
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