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
a5ecd049
Commit
a5ecd049
authored
Jul 24, 2015
by
Peter van 't Hof
Browse files
Update breakdancer
parent
3c2f4a07
Changes
3
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/breakdancer/Breakdancer.scala
View file @
a5ecd049
...
...
@@ -18,38 +18,36 @@ package nl.lumc.sasc.biopet.extensions.breakdancer
import
java.io.File
import
nl.lumc.sasc.biopet.core.config.Configurable
import
nl.lumc.sasc.biopet.core.
{
BiopetQScript
,
PipelineCommand
}
import
nl.lumc.sasc.biopet.core.
{
Reference
,
BiopetQScript
,
PipelineCommand
}
import
org.broadinstitute.gatk.queue.QScript
/// Breakdancer is actually a mini pipeline executing binaries from the breakdancer package
class
Breakdancer
(
val
root
:
Configurable
)
extends
QScript
with
BiopetQScript
{
class
Breakdancer
(
val
root
:
Configurable
)
extends
QScript
with
BiopetQScript
with
Reference
{
def
this
()
=
this
(
null
)
@Input
(
doc
=
"Input file (bam)"
)
var
input
:
File
=
_
@Input
(
doc
=
"Reference Fasta file"
)
var
reference
:
File
=
_
@Argument
(
doc
=
"Work directory"
)
var
work
d
ir
:
String
=
_
var
work
D
ir
:
File
=
_
var
deps
:
List
[
File
]
=
Nil
@Output
(
doc
=
"Breakdancer config"
)
lazy
val
configfile
:
File
=
{
new
File
(
work
d
ir
+
"/"
+
input
.
getName
.
substring
(
0
,
input
.
getName
.
lastIndexOf
(
".bam"
))
+
".breakdancer.cfg"
)
new
File
(
work
D
ir
,
input
.
getName
.
substring
(
0
,
input
.
getName
.
lastIndexOf
(
".bam"
))
+
".breakdancer.cfg"
)
}
@Output
(
doc
=
"Breakdancer raw output"
)
lazy
val
outputraw
:
File
=
{
new
File
(
work
d
ir
+
"/"
+
input
.
getName
.
substring
(
0
,
input
.
getName
.
lastIndexOf
(
".bam"
))
+
".breakdancer.tsv"
)
new
File
(
work
D
ir
,
input
.
getName
.
substring
(
0
,
input
.
getName
.
lastIndexOf
(
".bam"
))
+
".breakdancer.tsv"
)
}
@Output
(
doc
=
"Breakdancer VCF output"
)
lazy
val
outputvcf
:
File
=
{
new
File
(
work
d
ir
+
"/"
+
input
.
getName
.
substring
(
0
,
input
.
getName
.
lastIndexOf
(
".bam"
))
+
".breakdancer.vcf"
)
new
File
(
work
D
ir
,
input
.
getName
.
substring
(
0
,
input
.
getName
.
lastIndexOf
(
".bam"
))
+
".breakdancer.vcf"
)
}
override
def
init
()
{
override
def
init
()
:
Unit
=
{
}
def
biopetScript
()
{
...
...
@@ -72,11 +70,10 @@ class Breakdancer(val root: Configurable) extends QScript with BiopetQScript {
}
object
Breakdancer
extends
PipelineCommand
{
def
apply
(
root
:
Configurable
,
input
:
File
,
reference
:
File
,
runDir
:
String
)
:
Breakdancer
=
{
def
apply
(
root
:
Configurable
,
input
:
File
,
runDir
:
File
)
:
Breakdancer
=
{
val
breakdancer
=
new
Breakdancer
(
root
)
breakdancer
.
input
=
input
breakdancer
.
reference
=
reference
breakdancer
.
workdir
=
runDir
breakdancer
.
workDir
=
runDir
breakdancer
.
init
()
breakdancer
.
biopetScript
()
breakdancer
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/clever/CleverCaller.scala
View file @
a5ecd049
...
...
@@ -24,7 +24,7 @@ class CleverCaller(val root: Configurable) extends BiopetCommandLineFunction {
var
reference
:
File
=
_
@Argument
(
doc
=
"Work directory"
)
var
work
d
ir
:
String
=
_
var
work
D
ir
:
String
=
_
var
cwd
:
String
=
_
...
...
@@ -35,7 +35,7 @@ class CleverCaller(val root: Configurable) extends BiopetCommandLineFunction {
@Output
(
doc
=
"Clever raw output"
)
lazy
val
outputraw
:
File
=
{
new
File
(
work
d
ir
+
"predictions.raw.txt"
)
new
File
(
work
D
ir
+
"predictions.raw.txt"
)
}
// var T: Option[Int] = config("T", default = defaultThreads)
...
...
@@ -46,7 +46,7 @@ class CleverCaller(val root: Configurable) extends BiopetCommandLineFunction {
var
r
:
Boolean
=
config
(
"r"
,
default
=
false
)
// take read groups into account
override
def
beforeCmd
()
{
if
(
work
d
ir
==
null
)
throw
new
Exception
(
"Clever :: Workdirectory is not defined"
)
if
(
work
D
ir
==
null
)
throw
new
Exception
(
"Clever :: Workdirectory is not defined"
)
// if (input.getName.endsWith(".sort.bam")) sorted = true
}
...
...
@@ -58,9 +58,9 @@ class CleverCaller(val root: Configurable) extends BiopetCommandLineFunction {
conditional
(
a
,
"-a"
)
+
conditional
(
k
,
"-k"
)
+
conditional
(
r
,
"-r"
)
+
required
(
this
.
input
)
+
required
(
this
.
reference
)
+
required
(
this
.
work
d
ir
)
required
(
input
)
+
required
(
reference
)
+
required
(
work
D
ir
)
}
object
CleverCaller
{
...
...
@@ -69,7 +69,7 @@ object CleverCaller {
clever
.
input
=
input
clever
.
reference
=
reference
clever
.
cwd
=
svDir
clever
.
work
d
ir
=
runDir
clever
.
work
D
ir
=
runDir
clever
}
}
\ No newline at end of file
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaSvCalling.scala
View file @
a5ecd049
...
...
@@ -19,7 +19,7 @@ import java.io.File
import
htsjdk.samtools.SamReaderFactory
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.core.
{
PipelineCommand
,
BiopetQScript
,
Reference
,
SampleLibraryTag
}
import
nl.lumc.sasc.biopet.core.
{
PipelineCommand
,
BiopetQScript
,
Reference
,
SampleLibraryTag
}
import
nl.lumc.sasc.biopet.extensions.breakdancer.Breakdancer
import
nl.lumc.sasc.biopet.extensions.clever.CleverCaller
import
nl.lumc.sasc.biopet.extensions.delly.Delly
...
...
@@ -41,7 +41,7 @@ class ShivaSvCalling extends SummaryQScript with SampleLibraryTag with Reference
protected
def
addBamFile
(
file
:
File
,
sampleId
:
Option
[
String
]
=
None
)
:
Unit
=
{
sampleId
match
{
case
Some
(
sample
)
=>
inputBams
+=
sample
->
file
case
Some
(
sample
)
=>
inputBams
+=
sample
->
file
case
_
if
!
file
.
exists
()
=>
throw
new
IllegalArgumentException
(
"Bam file does not exits: "
+
file
)
case
_
=>
{
val
inputSam
=
SamReaderFactory
.
makeDefault
.
open
(
file
)
...
...
@@ -68,7 +68,7 @@ class ShivaSvCalling extends SummaryQScript with SampleLibraryTag with Reference
BiopetQScript
.
addError
(
"variantcaller '"
+
cal
+
"' does not exist, possible to use: "
+
callersList
.
map
(
_
.
name
).
mkString
(
", "
))
}
val
callers
=
callersList
.
filter
(
x
=>
configCallers
.
contains
(
x
.
name
))
.
sortBy
(
_
.
prio
)
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
(
", "
))
...
...
@@ -99,7 +99,7 @@ class ShivaSvCalling extends SummaryQScript with SampleLibraryTag with Reference
//TODO: move minipipeline of breakdancer to here
for
((
sample
,
bamFile
)
<-
inputBams
)
{
val
breakdancerDir
=
new
File
(
outputDir
,
sample
)
val
breakdancer
=
Breakdancer
(
qscript
,
bamFile
,
qscript
.
reference
,
breakdancerDir
)
val
breakdancer
=
Breakdancer
(
qscript
,
bamFile
,
breakdancerDir
)
addAll
(
breakdancer
.
functions
)
}
}
...
...
@@ -112,7 +112,7 @@ class ShivaSvCalling extends SummaryQScript with SampleLibraryTag with Reference
def
addJobs
()
{
//TODO: check double directories
for
((
sample
,
bamFile
)
<-
inputBams
)
{
val
cleverDir
=
new
File
(
outputDir
,
sample
Id
)
val
cleverDir
=
new
File
(
outputDir
,
sample
)
val
clever
=
CleverCaller
(
qscript
,
bamFile
,
qscript
.
reference
,
cleverDir
,
cleverDir
)
add
(
clever
)
}
...
...
@@ -126,7 +126,7 @@ class ShivaSvCalling extends SummaryQScript with SampleLibraryTag with Reference
def
addJobs
()
{
//TODO: Move mini delly pipeline to here
for
((
sample
,
bamFile
)
<-
inputBams
)
{
val
dellyDir
=
new
File
(
outputDir
,
sample
Id
)
val
dellyDir
=
new
File
(
outputDir
,
sample
)
val
delly
=
Delly
(
qscript
,
bamFile
,
dellyDir
)
addAll
(
delly
.
functions
)
}
...
...
@@ -142,7 +142,8 @@ class ShivaSvCalling extends SummaryQScript with SampleLibraryTag with Reference
/** Files for the summary */
def
summaryFiles
:
Map
[
String
,
File
]
=
{
val
callers
:
Set
[
String
]
=
config
(
"sv_callers"
)
callersList
.
filter
(
x
=>
callers
.
contains
(
x
.
name
)).
map
(
x
=>
x
.
name
->
x
.
outputFile
).
toMap
+
(
"final"
->
finalFile
)
//callersList.filter(x => callers.contains(x.name)).map(x => x.name -> x.outputFile).toMap + ("final" -> finalFile)
Map
()
}
}
...
...
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