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
684a0963
Commit
684a0963
authored
Apr 21, 2017
by
Peter van 't Hof
Committed by
GitHub
Apr 21, 2017
Browse files
Merge pull request #89 from biopet/fix-BIOPET-662
fixes for sv calling
parents
b79725a1
850675bc
Changes
4
Hide whitespace changes
Inline
Side-by-side
biopet-tools-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/VcfStatsForSv.scala
View file @
684a0963
...
...
@@ -36,7 +36,8 @@ class VcfStatsForSv(val parent: Configurable) extends ToolCommandFunction with S
@Output
(
required
=
true
)
var
outputFile
:
File
=
_
override
def
defaultCoreMemory
=
1.0
override
def
defaultResidentFactor
=
2.0
override
def
defaultVmemFactor
=
3.0
override
def
cmdLine
=
super
.
cmdLine
+
required
(
"-i"
,
inputFile
)
+
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/vcfstats/VcfStatsForSv.scala
View file @
684a0963
...
...
@@ -38,8 +38,7 @@ object VcfStatsForSv extends ToolCommand {
val
stats
:
Map
[
String
,
Any
]
=
getVariantCounts
(
cmdArgs
.
inputFile
,
cmdArgs
.
histBinBoundaries
)
ConfigUtils
.
mapToYamlFile
(
stats
,
cmdArgs
.
outputFile
)
ConfigUtils
.
mapToJsonFile
(
stats
,
cmdArgs
.
outputFile
)
}
/** Parses a vcf-file and counts sv-s by type and size. Sv-s are divided to different size classes, the parameter histogramBinBoundaries gives the boundaries between these classes. */
...
...
biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/ConfigUtils.scala
View file @
684a0963
...
...
@@ -168,6 +168,12 @@ object ConfigUtils extends Logging {
writer
.
close
()
}
def
mapToJsonFile
(
map
:
Map
[
String
,
Any
],
outputFile
:
File
)
=
{
val
writer
=
new
PrintWriter
(
outputFile
)
writer
.
println
(
anyToJson
(
map
).
toString
())
writer
.
close
()
}
/** Convert json to native scala map/values */
def
jsonToMap
(
json
:
Json
)
:
Map
[
String
,
Any
]
=
{
var
output
:
Map
[
String
,
Any
]
=
Map
()
...
...
shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaSvCalling.scala
View file @
684a0963
...
...
@@ -20,9 +20,14 @@ import nl.lumc.sasc.biopet.extensions.Pysvtools
import
nl.lumc.sasc.biopet.extensions.tools.VcfStatsForSv
import
nl.lumc.sasc.biopet.pipelines.shiva.svcallers._
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.utils.summary.db.SummaryDb
import
nl.lumc.sasc.biopet.utils.
{
BamUtils
,
Logging
}
import
org.broadinstitute.gatk.queue.QScript
import
scala.concurrent.Await
import
scala.concurrent.duration.Duration
import
scala.concurrent.ExecutionContext.Implicits.global
/**
* Common trait for ShivaVariantcalling
*
...
...
@@ -43,7 +48,16 @@ class ShivaSvCalling(val parent: Configurable) extends QScript with SummaryQScri
/** Executed before script */
def
init
()
:
Unit
=
{
if
(
inputBamsArg
.
nonEmpty
)
inputBams
=
BamUtils
.
sampleBamMap
(
inputBamsArg
)
if
(
inputBamsArg
.
nonEmpty
)
{
inputBams
=
BamUtils
.
sampleBamMap
(
inputBamsArg
)
val
db
=
SummaryDb
.
openSqliteSummary
(
summaryDbFile
)
for
(
sampleName
<-
inputBams
.
keys
)
{
if
(
Await
.
result
(
db
.
getSampleId
(
summaryRunId
,
sampleName
),
Duration
.
Inf
).
isEmpty
)
{
db
.
createSample
(
sampleName
,
summaryRunId
)
}
}
}
outputMergedVCF
=
new
File
(
outputDir
,
"allsamples.merged.vcf"
)
}
...
...
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