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
1aea2582
Commit
1aea2582
authored
Sep 28, 2016
by
Peter van 't Hof
Browse files
Added more summary testing
parent
b4c7ded4
Changes
2
Hide whitespace changes
Inline
Side-by-side
basty/src/main/scala/nl/lumc/sasc/biopet/pipelines/basty/Basty.scala
View file @
1aea2582
...
...
@@ -33,10 +33,18 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
def
this
()
=
this
(
null
)
case
class
FastaOutput
(
variants
:
File
,
consensus
:
File
,
consensusVariants
:
File
)
case
class
FastaOutput
(
variants
:
File
,
consensus
:
File
,
consensusVariants
:
File
)
{
def
summaryFiles
(
prefix
:
Option
[
String
]
=
None
)
=
Map
(
s
"${prefix.map(_ + "
_
").getOrElse("")}variants_fasta"
->
variants
,
s
"${prefix.map(_ + "
_
").getOrElse("")}consensus_fasta"
->
consensus
,
s
"${prefix.map(_ + "
_
").getOrElse("")}consensus_variants_fasta"
->
consensusVariants
)
}
def
variantcallers
=
List
(
"unifiedgenotyper"
)
val
numBoot
=
config
(
"boot_runs"
,
default
=
100
,
namespace
=
"raxml"
).
asInt
override
def
defaults
=
Map
(
"ploidy"
->
1
,
"variantcallers"
->
variantcallers
...
...
@@ -46,25 +54,25 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
def
summaryFile
:
File
=
new
File
(
outputDir
,
"Basty.summary.json"
)
def
summaryFiles
:
Map
[
String
,
File
]
=
shiva
.
summaryFiles
def
summaryFiles
:
Map
[
String
,
File
]
=
Map
()
def
summarySettings
:
Map
[
String
,
Any
]
=
shiva
.
summarySettings
def
summarySettings
:
Map
[
String
,
Any
]
=
Map
(
"boot_runs"
->
numBoot
)
def
makeSample
(
id
:
String
)
=
new
Sample
(
id
)
class
Sample
(
sampleId
:
String
)
extends
AbstractSample
(
sampleId
)
{
def
summaryFiles
:
Map
[
String
,
File
]
=
shiva
.
samples
(
sampleId
).
summaryFiles
def
summaryFiles
:
Map
[
String
,
File
]
=
output
.
summaryFiles
()
++
outputSnps
.
summaryFiles
(
Some
(
"snps_only"
))
def
summaryStats
:
Map
[
String
,
Any
]
=
shiva
.
samples
(
sampleId
).
summaryStats
def
summaryStats
:
Map
[
String
,
Any
]
=
Map
()
override
def
summarySettings
:
Map
[
String
,
Any
]
=
shiva
.
samples
(
sampleId
).
summarySettings
override
def
summarySettings
:
Map
[
String
,
Any
]
=
Map
()
def
makeLibrary
(
id
:
String
)
=
new
Library
(
id
)
class
Library
(
libId
:
String
)
extends
AbstractLibrary
(
libId
)
{
def
summaryFiles
:
Map
[
String
,
File
]
=
shiva
.
samples
(
sampleId
).
libraries
(
libId
).
summaryFiles
def
summaryFiles
:
Map
[
String
,
File
]
=
Map
()
def
summaryStats
:
Map
[
String
,
Any
]
=
shiva
.
samples
(
sampleId
).
libraries
(
libId
).
summaryStats
def
summaryStats
:
Map
[
String
,
Any
]
=
Map
()
override
def
summarySettings
:
Map
[
String
,
Any
]
=
shiva
.
samples
(
sampleId
).
libraries
(
libId
).
summarySettings
override
def
summarySettings
:
Map
[
String
,
Any
]
=
Map
()
protected
def
addJobs
()
:
Unit
=
{}
}
...
...
@@ -134,7 +142,6 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
add
(
raxmlMl
)
val
r
=
new
scala
.
util
.
Random
(
seed
)
val
numBoot
=
config
(
"boot_runs"
,
default
=
100
,
namespace
=
"raxml"
).
asInt
val
bootList
=
for
(
t
<-
0
until
numBoot
)
yield
{
val
raxmlBoot
=
new
Raxml
(
this
)
raxmlBoot
.
input
=
variants
...
...
basty/src/test/scala/nl/lumc/sasc/biopet/pipelines/basty/BastyTest.scala
View file @
1aea2582
...
...
@@ -88,19 +88,23 @@ class BastyTest extends TestNGSuite with Matchers {
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
BaseRecalibrator
])
shouldBe
(
if
(
dbsnp
&&
baseRecalibration
)
(
numberLibs
*
2
)
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
PrintReads
])
shouldBe
(
if
(
dbsnp
&&
baseRecalibration
)
numberLibs
else
0
)
pipeline
.
summarySettings
.
get
(
"annotation"
)
shouldBe
Some
(
annotation
)
pipeline
.
summarySettings
.
get
(
"sv_calling"
)
shouldBe
Some
(
svCalling
)
pipeline
.
summarySettings
.
get
(
"cnv_calling"
)
shouldBe
Some
(
cnvCalling
)
pipeline
.
summarySettings
.
get
(
"boot_runs"
)
shouldBe
Some
(
bootRuns
.
getOrElse
(
100
))
pipeline
.
samples
foreach
{
case
(
sampleId
,
sample
)
=>
sample
.
summarySettings
.
get
(
"single_sample_variantcalling"
)
shouldBe
Some
(
sampleCalling
)
sample
.
summarySettings
.
get
(
"use_indel_realigner"
)
shouldBe
Some
(
realign
)
sample
.
summarySettings
shouldBe
Map
()
sample
.
summaryFiles
.
get
(
"variants_fasta"
)
should
not
be
None
sample
.
summaryFiles
.
get
(
"consensus_fasta"
)
should
not
be
None
sample
.
summaryFiles
.
get
(
"consensus_variants_fasta"
)
should
not
be
None
sample
.
summaryFiles
.
get
(
"snps_only_variants_fasta"
)
should
not
be
None
sample
.
summaryFiles
.
get
(
"snps_only_consensus_fasta"
)
should
not
be
None
sample
.
summaryFiles
.
get
(
"snps_only_consensus_variants_fasta"
)
should
not
be
None
sample
.
summaryStats
shouldBe
Map
()
sample
.
libraries
.
foreach
{
case
(
libId
,
lib
)
=>
lib
.
summarySettings
.
get
(
"library_variantcalling"
)
shouldBe
Some
(
libraryCalling
)
lib
.
summary
Settings
.
get
(
"use_indel_realigner"
)
shouldBe
Some
(
realign
)
lib
.
summaryS
ettings
.
get
(
"use_base_recalibration"
)
shouldBe
Some
(
baseRecalibration
&&
dbsnp
)
lib
.
summarySettings
shouldBe
Map
(
)
lib
.
summary
Files
shouldBe
Map
(
)
lib
.
summaryS
tats
shouldBe
Map
(
)
}
}
...
...
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