Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
biopet.biopet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Mirrors
biopet.biopet
Commits
11c11c41
Commit
11c11c41
authored
May 17, 2016
by
bow
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-more_unit_tests' into 'develop'
More unit tests See merge request !403
parents
7eb9af74
26a7681c
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
331 additions
and
45 deletions
+331
-45
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/report/ReportBuilder.scala
...scala/nl/lumc/sasc/biopet/core/report/ReportBuilder.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala
.../scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BaseCounter.scala
...rc/main/scala/nl/lumc/sasc/biopet/tools/BaseCounter.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BastyGenerateFasta.scala
.../scala/nl/lumc/sasc/biopet/tools/BastyGenerateFasta.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BedToInterval.scala
.../main/scala/nl/lumc/sasc/biopet/tools/BedToInterval.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BedtoolsCoverageToCounts.scala
.../nl/lumc/sasc/biopet/tools/BedtoolsCoverageToCounts.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BiopetFlagstat.scala
...main/scala/nl/lumc/sasc/biopet/tools/BiopetFlagstat.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala
...cala/nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/FastqSplitter.scala
.../main/scala/nl/lumc/sasc/biopet/tools/FastqSplitter.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/FindRepeatsPacBio.scala
...n/scala/nl/lumc/sasc/biopet/tools/FindRepeatsPacBio.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/GvcfToBed.scala
.../src/main/scala/nl/lumc/sasc/biopet/tools/GvcfToBed.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/MergeAlleles.scala
...c/main/scala/nl/lumc/sasc/biopet/tools/MergeAlleles.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/MergeOtuMaps.scala
...c/main/scala/nl/lumc/sasc/biopet/tools/MergeOtuMaps.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/MpileupToVcf.scala
...c/main/scala/nl/lumc/sasc/biopet/tools/MpileupToVcf.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/PrefixFastq.scala
...rc/main/scala/nl/lumc/sasc/biopet/tools/PrefixFastq.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/RegionAfCount.scala
.../main/scala/nl/lumc/sasc/biopet/tools/RegionAfCount.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SageCountFastq.scala
...main/scala/nl/lumc/sasc/biopet/tools/SageCountFastq.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SageCreateLibrary.scala
...n/scala/nl/lumc/sasc/biopet/tools/SageCreateLibrary.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SageCreateTagCounts.scala
...scala/nl/lumc/sasc/biopet/tools/SageCreateTagCounts.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SamplesTsvToJson.scala
...in/scala/nl/lumc/sasc/biopet/tools/SamplesTsvToJson.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SquishBed.scala
.../src/main/scala/nl/lumc/sasc/biopet/tools/SquishBed.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SummaryToTsv.scala
...c/main/scala/nl/lumc/sasc/biopet/tools/SummaryToTsv.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/ValidateFastq.scala
.../main/scala/nl/lumc/sasc/biopet/tools/ValidateFastq.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/VcfFilter.scala
.../src/main/scala/nl/lumc/sasc/biopet/tools/VcfFilter.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala
...s/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala
+1
-1
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/VcfToTsv.scala
...s/src/main/scala/nl/lumc/sasc/biopet/tools/VcfToTsv.scala
+1
-1
mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/MultisampleMapping.scala
...mc/sasc/biopet/pipelines/mapping/MultisampleMapping.scala
+3
-5
mapping/src/test/resources/empty.sam
mapping/src/test/resources/empty.sam
+4
-0
mapping/src/test/scala/nl/lumc/sasc/biopet/pipelines/mapping/MappingTest.scala
...a/nl/lumc/sasc/biopet/pipelines/mapping/MappingTest.scala
+25
-8
mapping/src/test/scala/nl/lumc/sasc/biopet/pipelines/mapping/MultisampleMappingTest.scala
...asc/biopet/pipelines/mapping/MultisampleMappingTest.scala
+226
-0
shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcalling.scala
...umc/sasc/biopet/pipelines/shiva/ShivaVariantcalling.scala
+2
-2
shiva/src/test/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala
...sasc/biopet/pipelines/shiva/ShivaVariantcallingTest.scala
+45
-4
No files found.
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/report/ReportBuilder.scala
View file @
11c11c41
...
@@ -132,7 +132,7 @@ trait ReportBuilder extends ToolCommand {
...
@@ -132,7 +132,7 @@ trait ReportBuilder extends ToolCommand {
logger
.
info
(
"Start"
)
logger
.
info
(
"Start"
)
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
require
(
cmdArgs
.
outputDir
.
exists
(),
"Output dir does not exist"
)
require
(
cmdArgs
.
outputDir
.
exists
(),
"Output dir does not exist"
)
require
(
cmdArgs
.
outputDir
.
isDirectory
,
"Output dir is not a directory"
)
require
(
cmdArgs
.
outputDir
.
isDirectory
,
"Output dir is not a directory"
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala
View file @
11c11c41
...
@@ -80,7 +80,7 @@ object AnnotateVcfWithBed extends ToolCommand {
...
@@ -80,7 +80,7 @@ object AnnotateVcfWithBed extends ToolCommand {
logger
.
info
(
"Start"
)
logger
.
info
(
"Start"
)
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
fieldType
=
cmdArgs
.
fieldType
match
{
val
fieldType
=
cmdArgs
.
fieldType
match
{
case
"Integer"
=>
VCFHeaderLineType
.
Integer
case
"Integer"
=>
VCFHeaderLineType
.
Integer
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BaseCounter.scala
View file @
11c11c41
...
@@ -53,7 +53,7 @@ object BaseCounter extends ToolCommand {
...
@@ -53,7 +53,7 @@ object BaseCounter extends ToolCommand {
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
//Sets picard logging level
//Sets picard logging level
htsjdk
.
samtools
.
util
.
Log
.
setGlobalLogLevel
(
htsjdk
.
samtools
.
util
.
Log
.
LogLevel
.
valueOf
(
logger
.
getLevel
.
toString
))
htsjdk
.
samtools
.
util
.
Log
.
setGlobalLogLevel
(
htsjdk
.
samtools
.
util
.
Log
.
LogLevel
.
valueOf
(
logger
.
getLevel
.
toString
))
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BastyGenerateFasta.scala
View file @
11c11c41
...
@@ -113,7 +113,7 @@ object BastyGenerateFasta extends ToolCommand {
...
@@ -113,7 +113,7 @@ object BastyGenerateFasta extends ToolCommand {
*/
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
cmdArgs
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
cmdArgs
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
if
(
cmdArgs
.
outputVariants
!=
null
)
{
if
(
cmdArgs
.
outputVariants
!=
null
)
{
writeVariantsOnly
()
writeVariantsOnly
()
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BedToInterval.scala
View file @
11c11c41
...
@@ -47,7 +47,7 @@ object BedToInterval extends ToolCommand {
...
@@ -47,7 +47,7 @@ object BedToInterval extends ToolCommand {
*/
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
writer
=
new
PrintWriter
(
commandArgs
.
outputFile
)
val
writer
=
new
PrintWriter
(
commandArgs
.
outputFile
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BedtoolsCoverageToCounts.scala
View file @
11c11c41
...
@@ -39,7 +39,7 @@ object BedtoolsCoverageToCounts extends ToolCommand {
...
@@ -39,7 +39,7 @@ object BedtoolsCoverageToCounts extends ToolCommand {
*/
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
if
(!
commandArgs
.
input
.
exists
)
throw
new
IllegalStateException
(
"Input file not found, file: "
+
commandArgs
.
input
)
if
(!
commandArgs
.
input
.
exists
)
throw
new
IllegalStateException
(
"Input file not found, file: "
+
commandArgs
.
input
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/BiopetFlagstat.scala
View file @
11c11c41
...
@@ -50,7 +50,7 @@ object BiopetFlagstat extends ToolCommand {
...
@@ -50,7 +50,7 @@ object BiopetFlagstat extends ToolCommand {
*/
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
inputSam
=
SamReaderFactory
.
makeDefault
.
open
(
commandArgs
.
inputFile
)
val
inputSam
=
SamReaderFactory
.
makeDefault
.
open
(
commandArgs
.
inputFile
)
val
iterSam
=
if
(
commandArgs
.
region
.
isEmpty
)
inputSam
.
iterator
else
{
val
iterSam
=
if
(
commandArgs
.
region
.
isEmpty
)
inputSam
.
iterator
else
{
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/CheckAllelesVcfInBam.scala
View file @
11c11c41
...
@@ -71,7 +71,7 @@ object CheckAllelesVcfInBam extends ToolCommand {
...
@@ -71,7 +71,7 @@ object CheckAllelesVcfInBam extends ToolCommand {
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
if
(
commandArgs
.
bamFiles
.
size
!=
commandArgs
.
samples
.
size
)
if
(
commandArgs
.
bamFiles
.
size
!=
commandArgs
.
samples
.
size
)
logger
.
warn
(
"Number of samples is different from number of bam files: additional samples or bam files will not be used"
)
logger
.
warn
(
"Number of samples is different from number of bam files: additional samples or bam files will not be used"
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/FastqSplitter.scala
View file @
11c11c41
...
@@ -45,7 +45,7 @@ object FastqSplitter extends ToolCommand {
...
@@ -45,7 +45,7 @@ object FastqSplitter extends ToolCommand {
*/
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
groupSize
=
100
val
groupSize
=
100
val
output
=
for
(
file
<-
commandArgs
.
outputFile
)
yield
new
AsyncFastqWriter
(
new
BasicFastqWriter
(
file
),
groupSize
)
val
output
=
for
(
file
<-
commandArgs
.
outputFile
)
yield
new
AsyncFastqWriter
(
new
BasicFastqWriter
(
file
),
groupSize
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/FindRepeatsPacBio.scala
View file @
11c11c41
...
@@ -46,7 +46,7 @@ object FindRepeatsPacBio extends ToolCommand {
...
@@ -46,7 +46,7 @@ object FindRepeatsPacBio extends ToolCommand {
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
bamReader
=
SamReaderFactory
.
makeDefault
val
bamReader
=
SamReaderFactory
.
makeDefault
.
validationStringency
(
ValidationStringency
.
SILENT
)
.
validationStringency
(
ValidationStringency
.
SILENT
)
.
open
(
commandArgs
.
inputBam
)
.
open
(
commandArgs
.
inputBam
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/GvcfToBed.scala
View file @
11c11c41
...
@@ -57,7 +57,7 @@ object GvcfToBed extends ToolCommand {
...
@@ -57,7 +57,7 @@ object GvcfToBed extends ToolCommand {
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
cmdArgs
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
cmdArgs
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
logger
.
debug
(
"Opening reader"
)
logger
.
debug
(
"Opening reader"
)
val
reader
=
new
VCFFileReader
(
cmdArgs
.
inputVcf
,
false
)
val
reader
=
new
VCFFileReader
(
cmdArgs
.
inputVcf
,
false
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/MergeAlleles.scala
View file @
11c11c41
...
@@ -50,7 +50,7 @@ object MergeAlleles extends ToolCommand {
...
@@ -50,7 +50,7 @@ object MergeAlleles extends ToolCommand {
*/
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
readers
=
commandArgs
.
inputFiles
.
map
(
new
VCFFileReader
(
_
,
true
))
val
readers
=
commandArgs
.
inputFiles
.
map
(
new
VCFFileReader
(
_
,
true
))
val
referenceFile
=
new
FastaSequenceFile
(
commandArgs
.
reference
,
true
)
val
referenceFile
=
new
FastaSequenceFile
(
commandArgs
.
reference
,
true
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/MergeOtuMaps.scala
View file @
11c11c41
...
@@ -41,7 +41,7 @@ object MergeOtuMaps extends ToolCommand {
...
@@ -41,7 +41,7 @@ object MergeOtuMaps extends ToolCommand {
*/
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
var
map
:
Map
[
Long
,
String
]
=
Map
()
var
map
:
Map
[
Long
,
String
]
=
Map
()
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/MpileupToVcf.scala
View file @
11c11c41
...
@@ -62,7 +62,7 @@ object MpileupToVcf extends ToolCommand {
...
@@ -62,7 +62,7 @@ object MpileupToVcf extends ToolCommand {
*/
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
if
(
commandArgs
.
input
!=
null
&&
!
commandArgs
.
input
.
exists
)
throw
new
IllegalStateException
(
"Input file does not exist"
)
if
(
commandArgs
.
input
!=
null
&&
!
commandArgs
.
input
.
exists
)
throw
new
IllegalStateException
(
"Input file does not exist"
)
val
writer
=
new
PrintWriter
(
commandArgs
.
output
)
val
writer
=
new
PrintWriter
(
commandArgs
.
output
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/PrefixFastq.scala
View file @
11c11c41
...
@@ -52,7 +52,7 @@ object PrefixFastq extends ToolCommand {
...
@@ -52,7 +52,7 @@ object PrefixFastq extends ToolCommand {
logger
.
info
(
"Start"
)
logger
.
info
(
"Start"
)
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
writer
=
new
AsyncFastqWriter
(
new
BasicFastqWriter
(
cmdArgs
.
output
),
3000
)
val
writer
=
new
AsyncFastqWriter
(
new
BasicFastqWriter
(
cmdArgs
.
output
),
3000
)
val
reader
=
new
FastqReader
(
cmdArgs
.
input
)
val
reader
=
new
FastqReader
(
cmdArgs
.
input
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/RegionAfCount.scala
View file @
11c11c41
...
@@ -49,7 +49,7 @@ object RegionAfCount extends ToolCommand {
...
@@ -49,7 +49,7 @@ object RegionAfCount extends ToolCommand {
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
logger
.
info
(
"Start"
)
logger
.
info
(
"Start"
)
logger
.
info
(
"Reading bed file"
)
logger
.
info
(
"Reading bed file"
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SageCountFastq.scala
View file @
11c11c41
...
@@ -41,7 +41,7 @@ object SageCountFastq extends ToolCommand {
...
@@ -41,7 +41,7 @@ object SageCountFastq extends ToolCommand {
*/
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
if
(!
commandArgs
.
input
.
exists
)
throw
new
IllegalStateException
(
"Input file not found, file: "
+
commandArgs
.
input
)
if
(!
commandArgs
.
input
.
exists
)
throw
new
IllegalStateException
(
"Input file not found, file: "
+
commandArgs
.
input
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SageCreateLibrary.scala
View file @
11c11c41
...
@@ -74,7 +74,7 @@ object SageCreateLibrary extends ToolCommand {
...
@@ -74,7 +74,7 @@ object SageCreateLibrary extends ToolCommand {
*/
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
if
(!
commandArgs
.
input
.
exists
)
throw
new
IllegalStateException
(
"Input file not found, file: "
+
commandArgs
.
input
)
if
(!
commandArgs
.
input
.
exists
)
throw
new
IllegalStateException
(
"Input file not found, file: "
+
commandArgs
.
input
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SageCreateTagCounts.scala
View file @
11c11c41
...
@@ -52,7 +52,7 @@ object SageCreateTagCounts extends ToolCommand {
...
@@ -52,7 +52,7 @@ object SageCreateTagCounts extends ToolCommand {
*/
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
if
(!
commandArgs
.
input
.
exists
)
throw
new
IllegalStateException
(
"Input file not found, file: "
+
commandArgs
.
input
)
if
(!
commandArgs
.
input
.
exists
)
throw
new
IllegalStateException
(
"Input file not found, file: "
+
commandArgs
.
input
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SamplesTsvToJson.scala
View file @
11c11c41
...
@@ -46,7 +46,7 @@ object SamplesTsvToJson extends ToolCommand {
...
@@ -46,7 +46,7 @@ object SamplesTsvToJson extends ToolCommand {
/** Executes SamplesTsvToJson */
/** Executes SamplesTsvToJson */
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
jsonString
=
stringFromInputs
(
cmdArgs
.
inputFiles
,
cmdArgs
.
tagFiles
)
val
jsonString
=
stringFromInputs
(
cmdArgs
.
inputFiles
,
cmdArgs
.
tagFiles
)
cmdArgs
.
outputFile
match
{
cmdArgs
.
outputFile
match
{
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SquishBed.scala
View file @
11c11c41
...
@@ -46,7 +46,7 @@ object SquishBed extends ToolCommand {
...
@@ -46,7 +46,7 @@ object SquishBed extends ToolCommand {
*/
*/
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
if
(!
cmdArgs
.
input
.
exists
)
throw
new
IllegalStateException
(
"Input file not found, file: "
+
cmdArgs
.
input
)
if
(!
cmdArgs
.
input
.
exists
)
throw
new
IllegalStateException
(
"Input file not found, file: "
+
cmdArgs
.
input
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SummaryToTsv.scala
View file @
11c11c41
...
@@ -61,7 +61,7 @@ object SummaryToTsv extends ToolCommand {
...
@@ -61,7 +61,7 @@ object SummaryToTsv extends ToolCommand {
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
summary
=
new
Summary
(
cmdArgs
.
summary
)
val
summary
=
new
Summary
(
cmdArgs
.
summary
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/ValidateFastq.scala
View file @
11c11c41
...
@@ -51,7 +51,7 @@ object ValidateFastq extends ToolCommand {
...
@@ -51,7 +51,7 @@ object ValidateFastq extends ToolCommand {
//parse all possible options into OptParser
//parse all possible options into OptParser
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
cmdArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
//read in fastq file 1 and if present fastq file 2
//read in fastq file 1 and if present fastq file 2
val
readFq1
=
new
FastqReader
(
cmdArgs
.
input
)
val
readFq1
=
new
FastqReader
(
cmdArgs
.
input
)
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/VcfFilter.scala
View file @
11c11c41
...
@@ -137,7 +137,7 @@ object VcfFilter extends ToolCommand {
...
@@ -137,7 +137,7 @@ object VcfFilter extends ToolCommand {
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
logger
.
info
(
"Start"
)
logger
.
info
(
"Start"
)
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
cmdArgs
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
cmdArgs
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
reader
=
new
VCFFileReader
(
cmdArgs
.
inputVcf
,
false
)
val
reader
=
new
VCFFileReader
(
cmdArgs
.
inputVcf
,
false
)
val
header
=
reader
.
getFileHeader
val
header
=
reader
.
getFileHeader
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/VcfStats.scala
View file @
11c11c41
...
@@ -206,7 +206,7 @@ object VcfStats extends ToolCommand {
...
@@ -206,7 +206,7 @@ object VcfStats extends ToolCommand {
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
logger
.
info
(
"Started"
)
logger
.
info
(
"Started"
)
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
cmdArgs
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
cmdArgs
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
reader
=
new
VCFFileReader
(
cmdArgs
.
inputFile
,
true
)
val
reader
=
new
VCFFileReader
(
cmdArgs
.
inputFile
,
true
)
val
header
=
reader
.
getFileHeader
val
header
=
reader
.
getFileHeader
...
...
biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/VcfToTsv.scala
View file @
11c11c41
...
@@ -72,7 +72,7 @@ object VcfToTsv extends ToolCommand {
...
@@ -72,7 +72,7 @@ object VcfToTsv extends ToolCommand {
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
val
argsParser
=
new
OptParser
val
argsParser
=
new
OptParser
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
val
commandArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
(
throw
new
IllegalArgumentException
)
// Throw exception if separator and listSeparator are identical
// Throw exception if separator and listSeparator are identical
if
(
commandArgs
.
separator
==
commandArgs
.
listSeparator
)
throw
new
IllegalArgumentException
(
if
(
commandArgs
.
separator
==
commandArgs
.
listSeparator
)
throw
new
IllegalArgumentException
(
...
...
mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/MultisampleMapping
Trait
.scala
→
mapping/src/main/scala/nl/lumc/sasc/biopet/pipelines/mapping/MultisampleMapping.scala
View file @
11c11c41
...
@@ -43,7 +43,7 @@ trait MultisampleMappingTrait extends MultiSampleQScript
...
@@ -43,7 +43,7 @@ trait MultisampleMappingTrait extends MultiSampleQScript
/** With this method the merge strategy for libraries to samples is defined. This can be overriden to fix the merge strategy. */
/** With this method the merge strategy for libraries to samples is defined. This can be overriden to fix the merge strategy. */
def
mergeStrategy
:
MergeStrategy.Value
=
{
def
mergeStrategy
:
MergeStrategy.Value
=
{
val
value
:
String
=
config
(
"merge_strategy"
,
default
=
"preprocessmarkduplicates"
)
val
value
:
String
=
config
(
"merge_strategy"
,
default
=
"preprocessmarkduplicates"
)
MergeStrategy
.
values
.
find
(
_
.
toString
.
toLowerCase
==
value
)
match
{
MergeStrategy
.
values
.
find
(
_
.
toString
.
toLowerCase
==
value
.
toLowerCase
)
match
{
case
Some
(
v
)
=>
v
case
Some
(
v
)
=>
v
case
_
=>
throw
new
IllegalArgumentException
(
s
"merge_strategy '$value' does not exist"
)
case
_
=>
throw
new
IllegalArgumentException
(
s
"merge_strategy '$value' does not exist"
)
}
}
...
@@ -151,10 +151,9 @@ trait MultisampleMappingTrait extends MultiSampleQScript
...
@@ -151,10 +151,9 @@ trait MultisampleMappingTrait extends MultiSampleQScript
try
{
try
{
header
.
getSequenceDictionary
.
assertSameDictionary
(
referenceFile
.
getSequenceDictionary
)
header
.
getSequenceDictionary
.
assertSameDictionary
(
referenceFile
.
getSequenceDictionary
)
}
catch
{
}
catch
{
case
e
:
AssertionError
=>
{
case
e
:
AssertionError
=>
logger
.
error
(
e
.
getMessage
)
logger
.
error
(
e
.
getMessage
)
oke
=
false
oke
=
false
}
}
}
oke
oke
}
}
...
@@ -172,8 +171,7 @@ trait MultisampleMappingTrait extends MultiSampleQScript
...
@@ -172,8 +171,7 @@ trait MultisampleMappingTrait extends MultiSampleQScript
"Sample readgroup and/or library of input bamfile is not correct, file: "
+
bamFile
+
"Sample readgroup and/or library of input bamfile is not correct, file: "
+
bamFile
+
"\nPlease note that it is possible to set 'correct_readgroups' to true in the config to automatic fix this"
)
"\nPlease note that it is possible to set 'correct_readgroups' to true in the config to automatic fix this"
)
if
(!
dictOke
)
Logging
.
addError
(
if
(!
dictOke
)
Logging
.
addError
(
"Sequence dictionary in the bam file is not the same as the reference, file: "
+
bamFile
+
"Sequence dictionary in the bam file is not the same as the reference, file: "
+
bamFile
)
"\nPlease note that it is possible to set 'correct_dict' to true in the config to automatic fix this"
)
if
(!
readGroupOke
&&
correctReadgroups
)
{
if
(!
readGroupOke
&&
correctReadgroups
)
{
logger
.
info
(
"Correcting readgroups, file:"
+
inputBam
.
get
)
logger
.
info
(
"Correcting readgroups, file:"
+
inputBam
.
get
)
...
...
mapping/src/test/resources/empty.sam
0 → 100644
View file @
11c11c41
@HD VN:1.5 SO:coordinate
@SQ SN:chr1 LN:9 UR:file:/home/pjvan_thof/pipelines/biopet/public/mapping/src/test/resources/ref.fa M5:fe15dbbd0900310caf32827f6da57550
@RG ID:001 SM:sample3 LB:lib1
r02 0 chr1 210 60 10M * 0 0 TACGTACGTA EEFFGGHHII RG:Z:001
mapping/src/test/scala/nl/lumc/sasc/biopet/pipelines/mapping/MappingTest.scala
View file @
11c11c41
...
@@ -18,6 +18,7 @@ package nl.lumc.sasc.biopet.pipelines.mapping
...
@@ -18,6 +18,7 @@ package nl.lumc.sasc.biopet.pipelines.mapping
import
java.io.
{
File
,
FileOutputStream
}
import
java.io.
{
File
,
FileOutputStream
}
import
com.google.common.io.Files
import
com.google.common.io.Files
import
nl.lumc.sasc.biopet.extensions.kraken.Kraken
import
nl.lumc.sasc.biopet.pipelines.flexiprep.Fastqc
import
nl.lumc.sasc.biopet.pipelines.flexiprep.Fastqc
import
nl.lumc.sasc.biopet.utils.ConfigUtils
import
nl.lumc.sasc.biopet.utils.ConfigUtils
import
nl.lumc.sasc.biopet.utils.config.Config
import
nl.lumc.sasc.biopet.utils.config.Config
...
@@ -25,7 +26,7 @@ import org.apache.commons.io.FileUtils
...
@@ -25,7 +26,7 @@ import org.apache.commons.io.FileUtils
import
org.broadinstitute.gatk.queue.QSettings
import
org.broadinstitute.gatk.queue.QSettings
import
org.scalatest.Matchers
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.
{
BeforeClass
,
After
Class
,
DataProvider
,
Test
}
import
org.testng.annotations.
{
AfterClass
,
Before
Class
,
DataProvider
,
Test
}
/**
/**
* Test class for [[Mapping]]
* Test class for [[Mapping]]
...
@@ -42,14 +43,15 @@ abstract class AbstractTestMapping(val aligner: String) extends TestNGSuite with
...
@@ -42,14 +43,15 @@ abstract class AbstractTestMapping(val aligner: String) extends TestNGSuite with
}
}
}
}
def
paired
=
Array
(
true
,
false
)
def
chunks
=
Array
(
1
,
5
)
def
skipMarkDuplicates
=
Array
(
true
,
false
)
def
skipFlexipreps
=
Array
(
true
,
false
)
def
zipped
=
Array
(
true
,
false
)
def
unmappedToGears
=
false
@DataProvider
(
name
=
"mappingOptions"
)
@DataProvider
(
name
=
"mappingOptions"
)
def
mappingOptions
=
{
def
mappingOptions
=
{
val
paired
=
Array
(
true
,
false
)
val
chunks
=
Array
(
1
,
5
)
val
skipMarkDuplicates
=
Array
(
true
,
false
)
val
skipFlexipreps
=
Array
(
true
,
false
)
val
zipped
=
Array
(
true
,
false
)
for
(
for
(
pair
<-
paired
;
pair
<-
paired
;
chunk
<-
chunks
;
chunk
<-
chunks
;
...
@@ -68,7 +70,8 @@ abstract class AbstractTestMapping(val aligner: String) extends TestNGSuite with
...
@@ -68,7 +70,8 @@ abstract class AbstractTestMapping(val aligner: String) extends TestNGSuite with
"aligner"
->
aligner
,
"aligner"
->
aligner
,
"number_chunks"
->
chunks
,
"number_chunks"
->
chunks
,
"skip_markduplicates"
->
skipMarkDuplicate
,
"skip_markduplicates"
->
skipMarkDuplicate
,
"skip_flexiprep"
->
skipFlexiprep
"skip_flexiprep"
->
skipFlexiprep
,
"unmapped_to_gears"
->
unmappedToGears
),
Map
(
executables
.
toSeq
:
_
*
))
),
Map
(
executables
.
toSeq
:
_
*
))
val
mapping
:
Mapping
=
initPipeline
(
map
)
val
mapping
:
Mapping
=
initPipeline
(
map
)
...
@@ -85,6 +88,8 @@ abstract class AbstractTestMapping(val aligner: String) extends TestNGSuite with
...
@@ -85,6 +88,8 @@ abstract class AbstractTestMapping(val aligner: String) extends TestNGSuite with
//Flexiprep
//Flexiprep
mapping
.
functions
.
count
(
_
.
isInstanceOf
[
Fastqc
])
shouldBe
(
if
(
skipFlexiprep
)
0
else
if
(
paired
)
4
else
2
)
mapping
.
functions
.
count
(
_
.
isInstanceOf
[
Fastqc
])
shouldBe
(
if
(
skipFlexiprep
)
0
else
if
(
paired
)
4
else
2
)
mapping
.
functions
.
count
(
_
.
isInstanceOf
[
Kraken
])
shouldBe
(
if
(
unmappedToGears
)
1
else
0
)
}
}
val
outputDir
=
Files
.
createTempDir
()
val
outputDir
=
Files
.
createTempDir
()
...
@@ -133,6 +138,8 @@ abstract class AbstractTestMapping(val aligner: String) extends TestNGSuite with
...
@@ -133,6 +138,8 @@ abstract class AbstractTestMapping(val aligner: String) extends TestNGSuite with
"bowtie2"
->
Map
(
"exe"
->
"test"
),
"bowtie2"
->
Map
(
"exe"
->
"test"
),
"stampy"
->
Map
(
"exe"
->
"test"
,
"genome"
->
"test"
,
"hash"
->
"test"
),
"stampy"
->
Map
(
"exe"
->
"test"
,
"genome"
->
"test"
,
"hash"
->
"test"
),
"samtools"
->
Map
(
"exe"
->
"test"
),
"samtools"
->
Map
(
"exe"
->
"test"
),
"kraken"
->
Map
(
"exe"
->
"test"
,
"db"
->
"test"
),
"krakenreport"
->
Map
(
"exe"
->
"test"
,
"db"
->
"test"
),
"md5sum"
->
Map
(
"exe"
->
"test"
)
"md5sum"
->
Map
(
"exe"
->
"test"
)
)
)
...
@@ -151,3 +158,13 @@ class MappingBowtie2Test extends AbstractTestMapping("bowtie2")
...
@@ -151,3 +158,13 @@ class MappingBowtie2Test extends AbstractTestMapping("bowtie2")
class
MappingStampyTest
extends
AbstractTestMapping
(
"stampy"
)
class
MappingStampyTest
extends
AbstractTestMapping
(
"stampy"
)
class
MappingGsnapTest
extends
AbstractTestMapping
(
"gsnap"
)
class
MappingGsnapTest
extends
AbstractTestMapping
(
"gsnap"
)
class
MappingTophatTest
extends
AbstractTestMapping
(
"tophat"
)
class
MappingTophatTest
extends
AbstractTestMapping
(
"tophat"
)
class
MappingGearsTest
extends
AbstractTestMapping
(
"bwa-mem"
)
{
override
def
unmappedToGears
=
true
override
def
paired
=
Array
(
true
)
override
def
chunks
=
Array
(
1
)