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
1d463d82
Commit
1d463d82
authored
Mar 09, 2016
by
Wai Yi Leung
Browse files
Change executable from pysvtools for SV merging.
Add all project VCF file merge into 1 global merge file
parent
658b77f5
Changes
4
Hide whitespace changes
Inline
Side-by-side
public/biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/Pysvtools.scala
View file @
1d463d82
...
...
@@ -28,7 +28,7 @@ class Pysvtools(val root: Configurable) extends BiopetCommandLineFunction {
var
bedoutput
:
File
=
_
var
regionsoutput
:
File
=
_
executable
=
config
(
"exe"
,
default
=
"merge
vcf
"
)
executable
=
config
(
"exe"
,
default
=
"
vcf_
merge
_sv_events
"
)
def
versionRegex
=
"""PySVtools (.*)"""
.
r
def
versionCommand
=
executable
+
" --version"
...
...
public/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SeqStat.scala
View file @
1d463d82
...
...
@@ -89,10 +89,10 @@ object SeqStat extends ToolCommand {
(
qual_low_boundery
<
59
,
qual_high_boundery
>
74
)
match
{
case
(
false
,
true
)
=>
phredEncoding
=
Solexa
// TODO: check this later on
// complex case, we cannot tell wheter this is a sanger or solexa
// but since the qual_high_boundery exceeds any Sanger/Illumina1.8 quals, we can `assume` this is solexa
// New @ 2016/01/26: Illumina X ten samples can contain Phred=Q42 (qual_high_boundery==75/K)
// TODO: check this later on
// complex case, we cannot tell wheter this is a sanger or solexa
// but since the qual_high_boundery exceeds any Sanger/Illumina1.8 quals, we can `assume` this is solexa
// New @ 2016/01/26: Illumina X ten samples can contain Phred=Q42 (qual_high_boundery==75/K)
case
(
true
,
true
)
=>
phredEncoding
=
Solexa
// this is definite a sanger sequence, the lower end is sanger only
case
(
true
,
false
)
=>
phredEncoding
=
Sanger
...
...
@@ -181,7 +181,7 @@ object SeqStat extends ToolCommand {
quals
++=
mutable
.
ArrayBuffer
.
fill
(
baseStats
(
pos
).
qual
.
length
-
quals
.
length
)(
0
)
}
if
(
nucs
.
length
<=
baseStats
(
pos
).
nucs
.
length
)
{
nucs
++=
mutable
.
ArrayBuffer
.
fill
(
baseStats
(
pos
).
nucs
.
length
-
nucs
.
length
)(
0
)
nucs
++=
mutable
.
ArrayBuffer
.
fill
(
baseStats
(
pos
).
nucs
.
length
-
nucs
.
length
)(
0
)
}
// count into the quals
baseStats
(
pos
).
qual
.
zipWithIndex
foreach
{
case
(
value
,
index
)
=>
quals
(
index
)
+=
value
}
...
...
public/biopet-utils/src/test/scala/nl/lumc/sasc/biopet/utils/BamUtilsTest.scala
View file @
1d463d82
...
...
@@ -3,11 +3,11 @@ package nl.lumc.sasc.biopet.utils
import
java.io.File
import
htsjdk.samtools._
import
org.mockito.Mockito.
{
inOrder
=>
inOrd
}
import
org.mockito.Mockito.
{
inOrder
=>
inOrd
}
import
org.scalatest.Matchers
import
org.scalatest.mock.MockitoSugar
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.
{
BeforeClass
,
Test
}
import
org.testng.annotations.
{
BeforeClass
,
Test
}
/**
* Created by wyleung on 22-2-16.
...
...
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaSvCalling.scala
View file @
1d463d82
...
...
@@ -33,6 +33,9 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
def
this
()
=
this
(
null
)
var
outputMergedVCFbySample
:
Map
[
String
,
File
]
=
Map
()
var
outputMergedVCF
:
File
=
_
@Input
(
doc
=
"Bam files (should be deduped bams)"
,
shortName
=
"BAM"
,
required
=
true
)
protected
[
shiva
]
var
inputBamsArg
:
List
[
File
]
=
Nil
...
...
@@ -41,6 +44,7 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
/** Executed before script */
def
init
()
:
Unit
=
{
if
(
inputBamsArg
.
nonEmpty
)
inputBams
=
BamUtils
.
sampleBamMap
(
inputBamsArg
)
outputMergedVCF
=
new
File
(
outputDir
,
"allsamples.merged.vcf"
)
}
/** Variantcallers requested by the config */
...
...
@@ -56,7 +60,7 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
val
callers
=
callersList
.
filter
(
x
=>
configCallers
.
contains
(
x
.
name
))
require
(
inputBams
.
nonEmpty
,
"No input bams found"
)
require
(
callers
.
nonEmpty
,
"
must
select at least 1 SV caller, choices are: "
+
callersList
.
map
(
_
.
name
).
mkString
(
", "
))
require
(
callers
.
nonEmpty
,
"
Please
select at least 1 SV caller, choices are: "
+
callersList
.
map
(
_
.
name
).
mkString
(
", "
))
callers
.
foreach
{
caller
=>
caller
.
inputBams
=
inputBams
...
...
@@ -74,9 +78,15 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
mergeSVcalls
.
input
=
sampleVCFS
.
flatten
mergeSVcalls
.
output
=
new
File
(
outputDir
,
sample
+
".merged.vcf"
)
add
(
mergeSVcalls
)
//
output
Fi
le
s
+= (sample -> mergeSVcalls.output)
output
MergedVCFbySamp
le
+=
(
sample
->
mergeSVcalls
.
output
)
}
// merge all files from all samples in project
val
mergeSVcallsProject
=
new
Pysvtools
(
this
)
mergeSVcallsProject
.
input
=
outputMergedVCFbySample
.
values
.
toList
mergeSVcallsProject
.
output
=
outputMergedVCF
add
(
mergeSVcallsProject
)
// merging the VCF calls by project
// basicly this will do all samples from this pipeline run
// group by "tags"
...
...
@@ -98,7 +108,10 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
def
summaryFiles
:
Map
[
String
,
File
]
=
{
val
callers
:
Set
[
String
]
=
configCallers
//callersList.filter(x => callers.contains(x.name)).map(x => x.name -> x.outputFile).toMap + ("final" -> finalFile)
Map
()
Map
(
"final_mergedvcf"
->
outputMergedVCF
)
}
}
...
...
Write
Preview
Markdown
is supported
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