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
385c71e9
Commit
385c71e9
authored
Jul 13, 2017
by
Peter van 't Hof
Browse files
Biopet core code inspection round
parent
c181bccd
Changes
74
Hide whitespace changes
Inline
Side-by-side
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/PrefixFastq.scala
View file @
385c71e9
...
...
@@ -43,7 +43,7 @@ class PrefixFastq(val parent: Configurable) extends ToolCommandFunction {
* Creates command to execute extension
* @return
*/
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-i"
,
inputFastq
)
+
required
(
"-o"
,
outputFastq
)
+
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/SageCountFastq.scala
View file @
385c71e9
...
...
@@ -31,7 +31,7 @@ class SageCountFastq(val parent: Configurable) extends ToolCommandFunction {
override
def
defaultCoreMemory
=
3.0
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-I"
,
input
)
+
required
(
"-o"
,
output
)
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/SageCreateLibrary.scala
View file @
385c71e9
...
...
@@ -38,12 +38,12 @@ class SageCreateLibrary(val parent: Configurable) extends ToolCommandFunction {
@Output
(
doc
=
"Output file all genes"
,
shortName
=
"allGenes"
,
required
=
false
)
var
allGenesOutput
:
File
=
_
va
r
tag
:
String
=
config
(
"tag"
,
default
=
"CATG"
)
va
r
length
:
Option
[
Int
]
=
config
(
"length"
,
default
=
17
)
va
l
tag
:
String
=
config
(
"tag"
,
default
=
"CATG"
)
va
l
length
:
Option
[
Int
]
=
config
(
"length"
,
default
=
17
)
override
def
defaultCoreMemory
=
3.0
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-I"
,
input
)
+
optional
(
"--tag"
,
tag
)
+
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/SageCreateTagCounts.scala
View file @
385c71e9
...
...
@@ -43,7 +43,7 @@ class SageCreateTagCounts(val parent: Configurable) extends ToolCommandFunction
override
def
defaultCoreMemory
=
3.0
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-I"
,
input
)
+
required
(
"--tagLib"
,
tagLib
)
+
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/SeqStat.scala
View file @
385c71e9
...
...
@@ -33,14 +33,14 @@ class SeqStat(val parent: Configurable) extends ToolCommandFunction with Summari
mainFunction
=
false
@Input
(
doc
=
"Input FASTQ"
,
shortName
=
"input"
,
required
=
true
)
var
input
:
File
=
null
var
input
:
File
=
_
@Output
(
doc
=
"Output JSON"
,
shortName
=
"output"
,
required
=
true
)
var
output
:
File
=
null
var
output
:
File
=
_
override
def
defaultCoreMemory
=
4.0
override
def
cmdLine
=
super
.
cmdLine
+
required
(
"-i"
,
input
)
+
required
(
"-o"
,
output
)
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-i"
,
input
)
+
required
(
"-o"
,
output
)
def
summaryStats
:
Map
[
String
,
Any
]
=
{
val
map
=
ConfigUtils
.
fileToConfigMap
(
output
)
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/SnptestToVcf.scala
View file @
385c71e9
...
...
@@ -28,7 +28,7 @@ class SnptestToVcf(val parent: Configurable) extends ToolCommandFunction with Re
def
toolObject
=
nl
.
lumc
.
sasc
.
biopet
.
tools
.
SnptestToVcf
@Input
(
doc
=
"input Info file"
,
required
=
true
)
var
inputInfo
:
File
=
null
var
inputInfo
:
File
=
_
@Input
(
required
=
true
)
var
reference
:
File
=
_
...
...
@@ -45,7 +45,7 @@ class SnptestToVcf(val parent: Configurable) extends ToolCommandFunction with Re
//if (outputVcf.getName.endsWith(".vcf.gz")) outputFiles :+= new File(outputVcf.getAbsolutePath + ".tbi")
}
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"--inputInfo"
,
inputInfo
)
+
required
(
"--outputVcf"
,
outputVcf
)
+
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/SquishBed.scala
View file @
385c71e9
...
...
@@ -32,9 +32,9 @@ class SquishBed(val parent: Configurable) extends ToolCommandFunction {
@Output
(
doc
=
"Output interval list"
,
required
=
true
)
var
output
:
File
=
_
va
r
strandSensitive
:
Boolean
=
config
(
"strandSensitive"
,
default
=
false
)
va
l
strandSensitive
:
Boolean
=
config
(
"strandSensitive"
,
default
=
false
)
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-I"
,
input
)
+
required
(
"-o"
,
output
)
+
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/ValidateAnnotation.scala
View file @
385c71e9
...
...
@@ -41,7 +41,7 @@ class ValidateAnnotation(val parent: Configurable) extends ToolCommandFunction w
if
(
reference
==
null
)
reference
=
referenceFasta
()
}
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
optional
(
"-r"
,
refflatFile
)
+
repeat
(
"-g"
,
gtfFile
)
+
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/ValidateFastq.scala
View file @
385c71e9
...
...
@@ -31,7 +31,7 @@ class ValidateFastq(val parent: Configurable) extends ToolCommandFunction {
override
def
defaultCoreMemory
=
4.0
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-i"
,
r1Fastq
)
+
optional
(
"-j"
,
r2Fastq
)
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/ValidateVcf.scala
View file @
385c71e9
...
...
@@ -38,7 +38,7 @@ class ValidateVcf(val parent: Configurable) extends ToolCommandFunction with Ref
if
(
reference
==
null
)
reference
=
referenceFasta
()
}
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-i"
,
inputVcf
)
+
required
(
"-R"
,
reference
)
+
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/VcfFilter.scala
View file @
385c71e9
...
...
@@ -61,7 +61,7 @@ class VcfFilter(val parent: Configurable) extends ToolCommandFunction {
outputVcfIndex
=
new
File
(
outputVcf
.
getAbsolutePath
+
".tbi"
)
}
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-I"
,
inputVcf
)
+
required
(
"-o"
,
outputVcf
)
+
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/VcfStats.scala
View file @
385c71e9
...
...
@@ -50,9 +50,9 @@ class VcfStats(val parent: Configurable)
protected
var
outputDir
:
File
=
_
var
infoTags
:
List
[
String
]
=
Nil
va
r
genotypeTags
:
List
[
String
]
=
Nil
va
r
allInfoTags
=
false
va
r
allGenotypeTags
=
false
va
l
genotypeTags
:
List
[
String
]
=
Nil
va
l
allInfoTags
=
false
va
l
allGenotypeTags
=
false
var
reference
:
File
=
_
var
intervals
:
Option
[
File
]
=
None
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/VcfStatsForSv.scala
View file @
385c71e9
...
...
@@ -39,7 +39,7 @@ class VcfStatsForSv(val parent: Configurable) extends ToolCommandFunction with S
override
def
defaultResidentFactor
=
2.0
override
def
defaultVmemFactor
=
3.0
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-i"
,
inputFile
)
+
required
(
"-o"
,
outputFile
)
+
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/VcfWithVcf.scala
View file @
385c71e9
...
...
@@ -53,7 +53,7 @@ class VcfWithVcf(val parent: Configurable) extends ToolCommandFunction with Refe
if
(
fields
.
isEmpty
)
throw
new
IllegalArgumentException
(
"No fields found for VcfWithVcf"
)
}
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-I"
,
input
)
+
required
(
"-o"
,
output
)
+
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/VepNormalizer.scala
View file @
385c71e9
...
...
@@ -33,17 +33,17 @@ class VepNormalizer(val parent: Configurable) extends ToolCommandFunction {
def
toolObject
=
nl
.
lumc
.
sasc
.
biopet
.
tools
.
VepNormalizer
@Input
(
doc
=
"Input VCF, may be indexed"
,
shortName
=
"InputFile"
,
required
=
true
)
var
inputVCF
:
File
=
null
var
inputVCF
:
File
=
_
@Output
(
doc
=
"Output VCF"
,
shortName
=
"OutputFile"
,
required
=
true
)
var
outputVcf
:
File
=
null
var
outputVcf
:
File
=
_
va
r
mode
:
String
=
config
(
"mode"
,
default
=
"standard"
)
va
r
doNotRemove
:
Boolean
=
config
(
"do_not_remove"
,
default
=
false
)
va
l
mode
:
String
=
config
(
"mode"
,
default
=
"standard"
)
va
l
doNotRemove
:
Boolean
=
config
(
"do_not_remove"
,
default
=
false
)
override
def
defaultCoreMemory
=
4.0
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-I"
,
inputVCF
)
+
required
(
"-O"
,
outputVcf
)
+
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/WipeReads.scala
View file @
385c71e9
...
...
@@ -30,35 +30,35 @@ class WipeReads(val parent: Configurable) extends ToolCommandFunction {
def
toolObject
=
nl
.
lumc
.
sasc
.
biopet
.
tools
.
WipeReads
@Input
(
doc
=
"Input BAM file (must be indexed)"
,
shortName
=
"I"
,
required
=
true
)
var
inputBam
:
File
=
null
var
inputBam
:
File
=
_
@Input
(
doc
=
"Interval file"
,
shortName
=
"r"
,
required
=
true
)
var
intervalFile
:
File
=
null
var
intervalFile
:
File
=
_
@Argument
(
doc
=
"Minimum MAPQ of reads in target region to remove (default: 0)"
)
va
r
minMapQ
:
Option
[
Int
]
=
config
(
"min_mapq"
)
va
l
minMapQ
:
Option
[
Int
]
=
config
(
"min_mapq"
)
@Argument
(
doc
=
"Read group IDs to be removed (default: remove reads from all read groups)"
)
va
r
readgroup
:
Set
[
String
]
=
config
(
"read_group"
,
default
=
Nil
)
va
l
readgroup
:
Set
[
String
]
=
config
(
"read_group"
,
default
=
Nil
)
@Argument
(
doc
=
"Whether to remove multiple-mapped reads outside the target regions (default: yes)"
)
va
r
limitRemoval
:
Boolean
=
config
(
"limit_removal"
,
default
=
false
)
va
l
limitRemoval
:
Boolean
=
config
(
"limit_removal"
,
default
=
false
)
@Argument
(
doc
=
"Whether to index output BAM file or not"
)
va
r
noMakeIndex
:
Boolean
=
config
(
"no_make_index"
,
default
=
false
)
va
l
noMakeIndex
:
Boolean
=
config
(
"no_make_index"
,
default
=
false
)
@Argument
(
doc
=
"GTF feature containing intervals (default: exon)"
)
va
r
featureType
:
Option
[
String
]
=
config
(
"feature_type"
)
va
l
featureType
:
Option
[
String
]
=
config
(
"feature_type"
)
@Argument
(
doc
=
"Expected maximum number of reads in target regions (default: 7e7)"
)
va
r
bloomSize
:
Option
[
Long
]
=
config
(
"bloom_size"
)
va
l
bloomSize
:
Option
[
Long
]
=
config
(
"bloom_size"
)
@Argument
(
doc
=
"False positive rate (default: 4e-7)"
)
va
r
falsePositive
:
Option
[
Long
]
=
config
(
"false_positive"
)
va
l
falsePositive
:
Option
[
Long
]
=
config
(
"false_positive"
)
@Output
(
doc
=
"Output BAM"
,
shortName
=
"o"
,
required
=
true
)
var
outputBam
:
File
=
null
var
outputBam
:
File
=
_
@Output
(
required
=
false
)
private
var
outputIndex
:
Option
[
File
]
=
None
...
...
@@ -71,7 +71,7 @@ class WipeReads(val parent: Configurable) extends ToolCommandFunction {
if
(!
noMakeIndex
)
outputIndex
=
Some
(
new
File
(
outputBam
.
getPath
.
stripSuffix
(
".bam"
)
+
".bai"
))
}
override
def
cmdLine
=
override
def
cmdLine
:
String
=
super
.
cmdLine
+
required
(
"-I"
,
inputBam
)
+
required
(
"-r"
,
intervalFile
)
+
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/extensions/tools/XcnvToBed.scala
View file @
385c71e9
...
...
@@ -37,7 +37,7 @@ class XcnvToBed(val parent: Configurable) extends ToolCommandFunction {
override
def
defaultCoreMemory
=
4
override
def
cmdLine
=
{
override
def
cmdLine
:
String
=
{
super
.
cmdLine
+
required
(
"-I"
,
inputXcnv
)
+
required
(
"-O"
,
outpuBed
)
+
required
(
"-S"
,
sample
)
}
...
...
biopet-core/src/test/scala/nl/lumc/sasc/biopet/core/BiopetPipeTest.scala
View file @
385c71e9
...
...
@@ -24,7 +24,7 @@ import org.testng.annotations.Test
class
BiopetPipeTest
extends
TestNGSuite
with
Matchers
{
class
Pipe1
extends
BiopetCommandLineFunction
{
val
parent
=
null
def
cmdLine
=
def
cmdLine
:
String
=
"pipe1"
+
(
if
(!
inputAsStdin
)
" input1 "
else
""
)
+
(
if
(!
outputAsStdout
)
" output1 "
+
""
)
...
...
@@ -32,13 +32,13 @@ class BiopetPipeTest extends TestNGSuite with Matchers {
class
Pipe2
extends
BiopetCommandLineFunction
{
val
parent
=
null
def
cmdLine
=
def
cmdLine
:
String
=
"pipe2"
+
(
if
(!
inputAsStdin
)
" input2 "
else
""
)
+
(
if
(!
outputAsStdout
)
" output2 "
+
""
)
}
@Test
def
testPipeCommands
:
Unit
=
{
@Test
def
testPipeCommands
()
:
Unit
=
{
val
pipe1
=
new
Pipe1
val
pipe2
=
new
Pipe2
pipe1
.
commandLine
.
contains
(
"pipe1"
)
shouldBe
true
...
...
@@ -49,7 +49,7 @@ class BiopetPipeTest extends TestNGSuite with Matchers {
pipe2
.
commandLine
.
contains
(
"output2"
)
shouldBe
true
}
@Test
def
testPipe
:
Unit
=
{
@Test
def
testPipe
()
:
Unit
=
{
val
pipe
=
new
Pipe1
|
new
Pipe2
pipe
.
commandLine
.
contains
(
"pipe1"
)
shouldBe
true
pipe
.
commandLine
.
contains
(
"input1"
)
shouldBe
true
...
...
biopet-core/src/test/scala/nl/lumc/sasc/biopet/core/CommandLineResourcesTest.scala
View file @
385c71e9
...
...
@@ -77,7 +77,7 @@ class CommandLineResourcesTest extends TestNGSuite with Matchers {
val
cmd1
=
new
CommandLineFunctionMock
with
CommandLineResources
val
cmd2
=
new
CommandLineFunctionMock
with
CommandLineResources
val
mainCmd
=
new
CommandLineFunctionMock
with
CommandLineResources
{
def
combine
(
functions
:
List
[
CommandLineResources
])
=
combineResources
(
functions
)
def
combine
(
functions
:
List
[
CommandLineResources
])
:
Unit
=
combineResources
(
functions
)
}
mainCmd
.
combine
(
List
(
cmd1
,
cmd2
))
...
...
biopet-core/src/test/scala/nl/lumc/sasc/biopet/core/MultiSampleQScriptTest.scala
View file @
385c71e9
...
...
@@ -35,7 +35,7 @@ class MultiSampleQScriptTest extends TestNGSuite with Matchers {
import
MultiSampleQScriptTest._
@Test
def
testDefault
:
Unit
=
{
def
testDefault
()
:
Unit
=
{
val
script
=
MultiSampleQScriptTest
(
sample1
::
sample2
::
sample3
::
Nil
)
script
.
outputDir
=
new
File
(
"./"
).
getAbsoluteFile
...
...
@@ -68,7 +68,7 @@ class MultiSampleQScriptTest extends TestNGSuite with Matchers {
}
@Test
def
testTrio
:
Unit
=
{
def
testTrio
()
:
Unit
=
{
val
script
=
MultiSampleQScriptTest
(
child
::
father
::
mother
::
Nil
)
script
.
init
()
script
.
biopetScript
()
...
...
@@ -83,7 +83,7 @@ class MultiSampleQScriptTest extends TestNGSuite with Matchers {
}
@Test
def
testGroups
:
Unit
=
{
def
testGroups
()
:
Unit
=
{
val
script
=
MultiSampleQScriptTest
(
sample1
::
sample2
::
sample3
::
Nil
)
script
.
init
()
script
.
biopetScript
()
...
...
@@ -99,7 +99,7 @@ class MultiSampleQScriptTest extends TestNGSuite with Matchers {
}
@Test
def
testOnlySamples
:
Unit
=
{
def
testOnlySamples
()
:
Unit
=
{
val
script
=
MultiSampleQScriptTest
(
sample1
::
sample2
::
sample3
::
Nil
,
List
(
"sample1"
))
script
.
init
()
script
.
biopetScript
()
...
...
@@ -108,7 +108,7 @@ class MultiSampleQScriptTest extends TestNGSuite with Matchers {
}
@Test
def
testInvalidSampleName
:
Unit
=
{
def
testInvalidSampleName
()
:
Unit
=
{
val
script
=
MultiSampleQScriptTest
(
sample4
::
Nil
)
script
.
init
()
script
.
biopetScript
()
...
...
@@ -210,13 +210,20 @@ object MultiSampleQScriptTest {
)
)
def
apply
(
configs
:
List
[
Map
[
String
,
Any
]],
only
:
List
[
String
]
=
Nil
)
=
{
def
apply
(
configs
:
List
[
Map
[
String
,
Any
]],
only
:
List
[
String
]
=
Nil
)
:
QScript
with
MultiSampleQScript
{
def
init
()
:
Unit
def
getLastLogMessage:
String
def
biopetScript
()
:
Unit
}
=
{
new
QScript
with
MultiSampleQScript
{
qscript
=>
qSettings
=
new
QSettings
()
qSettings
.
runName
=
"test"
override
val
onlySamples
=
only
override
val
onlySamples
:
List
[
String
]
=
only
var
buffer
=
new
ListBuffer
[
String
]()
...
...
Prev
1
2
3
4
Next
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