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
a3af8046
Commit
a3af8046
authored
Jul 03, 2015
by
Peter van 't Hof
Browse files
Fix code style warnings
parent
fd956f72
Changes
65
Hide whitespace changes
Inline
Side-by-side
public/bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala
View file @
a3af8046
...
...
@@ -5,7 +5,7 @@ import java.io.{ File, PrintWriter }
import
nl.lumc.sasc.biopet.core.config.Configurable
import
nl.lumc.sasc.biopet.core.report.
{
ReportBuilderExtension
,
ReportBuilder
,
ReportPage
,
ReportSection
}
import
nl.lumc.sasc.biopet.core.summary.
{
Summary
,
SummaryValue
}
import
nl.lumc.sasc.biopet.extensions.rscript.
{
StackedBarPlot
,
XY
Plot
}
import
nl.lumc.sasc.biopet.extensions.rscript.
{
StackedBarPlot
,
Line
Plot
}
class
BammetricsReport
(
val
root
:
Configurable
)
extends
ReportBuilderExtension
{
val
builder
=
BammetricsReport
...
...
@@ -204,7 +204,7 @@ object BammetricsReport extends ReportBuilder {
tsvWriter
.
close
()
val
plot
=
new
XY
Plot
(
null
)
val
plot
=
new
Line
Plot
(
null
)
plot
.
input
=
tsvFile
plot
.
output
=
pngFile
plot
.
ylabel
=
Some
(
"Reads"
)
...
...
@@ -292,7 +292,7 @@ object BammetricsReport extends ReportBuilder {
tsvWriter
.
close
()
val
plot
=
new
XY
Plot
(
null
)
val
plot
=
new
Line
Plot
(
null
)
plot
.
input
=
tsvFile
plot
.
output
=
pngFile
plot
.
ylabel
=
Some
(
"Bases"
)
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Bowtie.scala
View file @
a3af8046
...
...
@@ -59,8 +59,8 @@ class Bowtie(val root: Configurable) extends BiopetCommandLineFunction with Refe
var
maqerr
:
Option
[
Int
]
=
config
(
"maqerr"
)
var
maxins
:
Option
[
Int
]
=
config
(
"maxins"
)
override
def
beforeGraph
{
super
.
beforeGraph
override
def
beforeGraph
()
{
super
.
beforeGraph
()
if
(
reference
==
null
)
reference
=
referenceFasta
()
}
...
...
@@ -81,10 +81,9 @@ class Bowtie(val root: Configurable) extends BiopetCommandLineFunction with Refe
optional
(
"--maxins"
,
maxins
)
+
required
(
reference
)
+
(
R2
match
{
case
Some
(
r2
)
=>
{
case
Some
(
r2
)
=>
required
(
"-1"
,
R1
)
+
optional
(
"-2"
,
r2
)
}
case
_
=>
required
(
R1
)
})
+
" > "
+
required
(
output
)
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Cat.scala
View file @
a3af8046
...
...
@@ -52,6 +52,6 @@ object Cat {
val
cat
=
new
Cat
(
root
)
cat
.
input
=
input
cat
.
output
=
output
return
cat
cat
}
}
\ No newline at end of file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Cutadapt.scala
View file @
a3af8046
...
...
@@ -76,7 +76,7 @@ class Cutadapt(val root: Configurable) extends BiopetCommandLineFunction with Su
val
stats
:
mutable.Map
[
String
,
Int
]
=
mutable
.
Map
(
"trimmed"
->
0
,
"tooshort"
->
0
,
"toolong"
->
0
)
val
adapter_stats
:
mutable.Map
[
String
,
Int
]
=
mutable
.
Map
()
if
(
stats_output
.
exists
)
for
(
line
<-
Source
.
fromFile
(
stats_output
).
getLines
)
{
if
(
stats_output
.
exists
)
for
(
line
<-
Source
.
fromFile
(
stats_output
).
getLines
()
)
{
line
match
{
case
trimR
(
m
)
=>
stats
+=
(
"trimmed"
->
m
.
toInt
)
case
tooShortR
(
m
)
=>
stats
+=
(
"tooshort"
->
m
.
toInt
)
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Freebayes.scala
View file @
a3af8046
...
...
@@ -22,6 +22,8 @@ import nl.lumc.sasc.biopet.core.{ BiopetCommandLineFunction, Reference }
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
/**
* Extension for freebayes
*
* Created by pjvan_thof on 3/3/15.
*/
class
Freebayes
(
val
root
:
Configurable
)
extends
BiopetCommandLineFunction
with
Reference
{
...
...
@@ -42,8 +44,8 @@ class Freebayes(val root: Configurable) extends BiopetCommandLineFunction with R
override
val
versionRegex
=
"""version: (.*)"""
.
r
override
def
versionCommand
=
executable
+
" --version"
override
def
beforeGraph
:
Unit
=
{
super
.
beforeGraph
override
def
beforeGraph
()
:
Unit
=
{
super
.
beforeGraph
()
reference
=
referenceFasta
()
}
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Gzip.scala
View file @
a3af8046
...
...
@@ -41,6 +41,6 @@ object Gzip {
val
gzip
=
new
Gzip
(
root
)
gzip
.
input
=
input
gzip
.
output
=
output
return
gzip
gzip
}
}
\ No newline at end of file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Ln.scala
View file @
a3af8046
...
...
@@ -51,11 +51,11 @@ class Ln(val root: Configurable) extends InProcessFunction with Configurable {
lazy
val
cmd
:
String
=
{
lazy
val
inCanonical
:
String
=
{
// need to remove "/~" to correctly expand path with tilde
input
.
getCanonicalPath
()
.
replace
(
"/~"
,
""
)
input
.
getCanonicalPath
.
replace
(
"/~"
,
""
)
}
lazy
val
outCanonical
:
String
=
{
output
.
getCanonicalPath
()
.
replace
(
"/~"
,
""
)
output
.
getCanonicalPath
.
replace
(
"/~"
,
""
)
}
lazy
val
inToks
:
Array
[
String
]
=
{
...
...
@@ -68,8 +68,8 @@ class Ln(val root: Configurable) extends InProcessFunction with Configurable {
lazy
val
commonPrefixLength
:
Int
=
{
val
maxLength
=
scala
.
math
.
min
(
inToks
.
length
,
outToks
.
length
)
var
i
:
Int
=
0
;
while
(
i
<
maxLength
&&
inToks
(
i
)
==
outToks
(
i
))
i
+=
1
;
var
i
:
Int
=
0
while
(
i
<
maxLength
&&
inToks
(
i
)
==
outToks
(
i
))
i
+=
1
i
}
...
...
@@ -108,11 +108,11 @@ class Ln(val root: Configurable) extends InProcessFunction with Configurable {
}
}
override
def
run
{
override
def
run
()
{
val
stdout
=
new
StringBuffer
()
val
stderr
=
new
StringBuffer
()
val
process
=
Process
(
cmd
).
run
(
ProcessLogger
(
stdout
append
_
+
"\n"
,
stderr
append
_
+
"\n"
))
val
exitcode
=
process
.
exitValue
val
exitcode
=
process
.
exitValue
()
if
(
exitcode
!=
0
)
{
throw
new
Exception
(
"Error creating symbolic link, this was the original message: \n"
+
stderr
)
}
...
...
@@ -136,6 +136,6 @@ object Ln {
ln
.
input
=
input
ln
.
output
=
output
ln
.
relative
=
relative
return
ln
ln
}
}
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Md5sum.scala
View file @
a3af8046
...
...
@@ -45,7 +45,7 @@ object Md5sum {
val
md5sum
=
new
Md5sum
(
root
)
md5sum
.
input
=
fastqfile
md5sum
.
output
=
new
File
(
outDir
,
fastqfile
.
getName
+
".md5"
)
return
md5sum
md5sum
}
/** Makes md5sum with md5 file in same dir as input file */
...
...
@@ -53,6 +53,6 @@ object Md5sum {
val
md5sum
=
new
Md5sum
(
root
)
md5sum
.
input
=
file
md5sum
.
output
=
new
File
(
file
.
getParentFile
,
file
.
getName
+
".md5"
)
return
md5sum
md5sum
}
}
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Pbzip2.scala
View file @
a3af8046
...
...
@@ -37,8 +37,8 @@ class Pbzip2(val root: Configurable) extends BiopetCommandLineFunction {
override
val
defaultCoreMemory
=
memory
.
getOrElse
(
1000
).
toDouble
/
1000
override
val
defaultThreads
=
2
override
def
beforeCmd
{
if
(
!
memory
.
is
Empty
)
memory
=
Option
(
memory
.
get
*
threads
)
override
def
beforeCmd
()
{
if
(
memory
.
is
Defined
)
memory
=
Option
(
memory
.
get
*
threads
)
}
/** return commandline to execute */
...
...
@@ -58,6 +58,6 @@ object Pbzip2 {
val
pbzip2
=
new
Pbzip2
(
root
)
pbzip2
.
input
=
input
pbzip2
.
output
=
output
return
pbzip2
pbzip2
}
}
\ No newline at end of file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/PythonCommandLineFunction.scala
View file @
a3af8046
...
...
@@ -57,7 +57,7 @@ trait PythonCommandLineFunction extends BiopetCommandLineFunction {
}
/** return basic command to prefix the complete command with */
def
getPythonCommand
()
:
String
=
{
def
getPythonCommand
:
String
=
{
required
(
executable
)
+
required
(
python_script
)
}
}
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Raxml.scala
View file @
a3af8046
...
...
@@ -72,11 +72,11 @@ class Raxml(val root: Configurable) extends BiopetCommandLineFunction {
var
executableThreads
:
Option
[
String
]
=
config
(
"exe_pthreads"
)
/** Sets correct output files to job */
override
def
beforeGraph
{
override
def
beforeGraph
()
{
require
(
w
!=
null
)
if
(
threads
==
0
)
threads
=
getThreads
(
defaultThreads
)
executable
=
if
(
threads
>
1
&&
executableThreads
.
isDefined
)
executableThreads
.
get
else
executableNonThreads
super
.
beforeGraph
super
.
beforeGraph
()
out
:::=
List
(
Some
(
getInfoFile
),
getBestTreeFile
,
getBootstrapFile
,
getBipartitionsFile
).
flatten
f
match
{
case
"d"
if
b
.
isEmpty
=>
for
(
t
<-
0
until
N
.
getOrElse
(
1
))
{
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/RscriptCommandLineFunction.scala
View file @
a3af8046
...
...
@@ -22,6 +22,8 @@ import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import
scala.sys.process._
/**
* General rscript extension
*
* Created by wyleung on 17-2-15.
*/
trait
RscriptCommandLineFunction
extends
BiopetCommandLineFunction
{
...
...
@@ -30,7 +32,7 @@ trait RscriptCommandLineFunction extends BiopetCommandLineFunction {
executable
=
config
(
"exe"
,
default
=
"Rscript"
,
submodule
=
"Rscript"
)
override
def
beforeGraph
:
Unit
=
{
override
def
beforeGraph
()
:
Unit
=
{
checkScript
()
}
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/RunGubbins.scala
View file @
a3af8046
...
...
@@ -53,8 +53,8 @@ class RunGubbins(val root: Configurable) extends BiopetCommandLineFunction {
var
noCleanup
:
Boolean
=
config
(
"no_cleanup"
,
default
=
false
)
/** Set correct output files */
override
def
beforeGraph
:
Unit
=
{
super
.
beforeGraph
override
def
beforeGraph
()
:
Unit
=
{
super
.
beforeGraph
()
require
(
outputDirectory
!=
null
)
jobLocalDir
=
outputDirectory
if
(
prefix
.
isEmpty
)
prefix
=
Some
(
fastafile
.
getName
)
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Sha1sum.scala
View file @
a3af8046
...
...
@@ -41,6 +41,6 @@ object Sha1sum {
val
sha1sum
=
new
Sha1sum
(
root
)
sha1sum
.
input
=
input
sha1sum
.
output
=
new
File
(
outDir
,
input
.
getName
+
".sha1"
)
return
sha1sum
sha1sum
}
}
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Sickle.scala
View file @
a3af8046
...
...
@@ -62,7 +62,7 @@ class Sickle(val root: Configurable) extends BiopetCommandLineFunction with Summ
override
def
versionCommand
=
executable
+
" --version"
/** Sets qualityType is still empty */
override
def
beforeGraph
{
override
def
beforeGraph
()
{
if
(
qualityType
.
isEmpty
)
qualityType
=
Some
(
defaultQualityType
)
}
...
...
@@ -100,22 +100,20 @@ class Sickle(val root: Configurable) extends BiopetCommandLineFunction with Summ
var
stats
:
mutable.Map
[
String
,
Int
]
=
mutable
.
Map
()
if
(
output_stats
.
exists
)
for
(
line
<-
Source
.
fromFile
(
output_stats
).
getLines
)
{
if
(
output_stats
.
exists
)
for
(
line
<-
Source
.
fromFile
(
output_stats
).
getLines
()
)
{
line
match
{
// single run
case
sKept
(
num
)
=>
stats
+=
(
"num_reads_kept"
->
num
.
toInt
)
case
sDiscarded
(
num
)
=>
stats
+=
(
"num_reads_discarded_total"
->
num
.
toInt
)
// paired run
case
pPairKept
(
reads
,
pairs
)
=>
stats
+=
(
"num_reads_kept"
->
reads
.
toInt
)
case
pSingleKept
(
total
,
r1
,
r2
)
=>
{
case
pSingleKept
(
total
,
r1
,
r2
)
=>
stats
+=
(
"num_reads_kept_R1"
->
r1
.
toInt
)
stats
+=
(
"num_reads_kept_R2"
->
r2
.
toInt
)
}
case
pPairDiscarded
(
reads
,
pairs
)
=>
stats
+=
(
"num_reads_discarded_both"
->
reads
.
toInt
)
case
pSingleDiscarded
(
total
,
r1
,
r2
)
=>
{
case
pSingleDiscarded
(
total
,
r1
,
r2
)
=>
stats
+=
(
"num_reads_discarded_R1"
->
r1
.
toInt
)
stats
+=
(
"num_reads_discarded_R2"
->
r2
.
toInt
)
}
case
_
=>
}
}
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Stampy.scala
View file @
a3af8046
...
...
@@ -70,8 +70,8 @@ class Stampy(val root: Configurable) extends BiopetCommandLineFunction with Refe
override
def
versionCommand
=
executable
+
" --help"
/** Sets readgroup when not set yet */
override
def
beforeGraph
:
Unit
=
{
super
.
beforeGraph
override
def
beforeGraph
()
:
Unit
=
{
super
.
beforeGraph
()
require
(
readgroup
!=
null
)
if
(
reference
==
null
)
reference
=
referenceFasta
()
}
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Star.scala
View file @
a3af8046
...
...
@@ -68,7 +68,7 @@ class Star(val root: Configurable) extends BiopetCommandLineFunction with Refere
/** Sets output files for the graph */
override
def
beforeGraph
()
{
super
.
beforeGraph
super
.
beforeGraph
()
if
(
reference
==
null
)
reference
=
referenceFasta
()
genomeDir
=
config
(
"genomeDir"
,
new
File
(
reference
.
getAbsoluteFile
.
getParent
,
"star"
))
if
(
outFileNamePrefix
!=
null
&&
!
outFileNamePrefix
.
endsWith
(
"."
))
outFileNamePrefix
+=
"."
...
...
@@ -111,7 +111,7 @@ object Star {
* @param R1 R1 fastq file
* @param R2 R2 fastq file
* @param outputDir Outputdir for Star
* @param isIntermediate
* @param isIntermediate
When set true jobs are flaged as intermediate
* @param deps Deps to add to wait on run
* @return Return Star
*
...
...
@@ -123,8 +123,8 @@ object Star {
star
.
outputDir
=
outputDir
star
.
isIntermediate
=
isIntermediate
star
.
deps
=
deps
star
.
beforeGraph
return
star
star
.
beforeGraph
()
star
}
/**
...
...
@@ -133,7 +133,7 @@ object Star {
* @param R1 R1 fastq file
* @param R2 R2 fastq file
* @param outputDir Outputdir for Star
* @param isIntermediate
* @param isIntermediate
When set true jobs are flaged as intermediate
* @param deps Deps to add to wait on run
* @return Return Star
*/
...
...
@@ -146,21 +146,21 @@ object Star {
val
starCommand_pass1
=
Star
(
configurable
,
R1
,
R2
,
new
File
(
outputDir
,
"aln-pass1"
))
starCommand_pass1
.
isIntermediate
=
isIntermediate
starCommand_pass1
.
deps
=
deps
starCommand_pass1
.
beforeGraph
starCommand_pass1
.
beforeGraph
()
val
starCommand_reindex
=
new
Star
(
configurable
)
starCommand_reindex
.
sjdbFileChrStartEnd
=
starCommand_pass1
.
outputTab
starCommand_reindex
.
outputDir
=
new
File
(
outputDir
,
"re-index"
)
starCommand_reindex
.
runmode
=
"genomeGenerate"
starCommand_reindex
.
isIntermediate
=
isIntermediate
starCommand_reindex
.
beforeGraph
starCommand_reindex
.
beforeGraph
()
val
starCommand_pass2
=
Star
(
configurable
,
R1
,
R2
,
new
File
(
outputDir
,
"aln-pass2"
))
starCommand_pass2
.
genomeDir
=
starCommand_reindex
.
outputDir
starCommand_pass2
.
isIntermediate
=
isIntermediate
starCommand_pass2
.
deps
=
deps
starCommand_pass2
.
beforeGraph
starCommand_pass2
.
beforeGraph
()
return
(
starCommand_pass2
.
outputSam
,
List
(
starCommand_pass1
,
starCommand_reindex
,
starCommand_pass2
))
(
starCommand_pass2
.
outputSam
,
List
(
starCommand_pass1
,
starCommand_reindex
,
starCommand_pass2
))
}
}
\ No newline at end of file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Tabix.scala
View file @
a3af8046
...
...
@@ -66,7 +66,7 @@ class Tabix(val root: Configurable) extends BiopetCommandLineFunction {
/** Formats that tabix can handle */
private
val
validFormats
:
Set
[
String
]
=
Set
(
"gff"
,
"bed"
,
"sam"
,
"vcf"
,
"psltbl"
)
override
def
beforeGraph
:
Unit
=
{
override
def
beforeGraph
()
:
Unit
=
{
p
match
{
case
Some
(
fmt
)
=>
require
(
validFormats
.
contains
(
fmt
),
"-p flag must be one of "
+
validFormats
.
mkString
(
", "
))
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/VariantEffectPredictor.scala
View file @
a3af8046
...
...
@@ -141,8 +141,8 @@ class VariantEffectPredictor(val root: Configurable) extends BiopetCommandLineFu
var
db_version
:
Option
[
Int
]
=
config
(
"db_version"
)
var
buffer_size
:
Option
[
Int
]
=
config
(
"buffer_size"
)
override
def
beforeGraph
:
Unit
=
{
super
.
beforeGraph
override
def
beforeGraph
()
:
Unit
=
{
super
.
beforeGraph
()
if
(!
cache
&&
!
database
)
{
throw
new
IllegalArgumentException
(
"Must supply either cache or database"
)
}
else
if
(
cache
&&
dir
.
isEmpty
)
{
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Zcat.scala
View file @
a3af8046
...
...
@@ -44,6 +44,6 @@ object Zcat {
val
zcat
=
new
Zcat
(
root
)
zcat
.
input
=
input
zcat
.
output
=
output
return
zcat
zcat
}
}
\ No newline at end of file
Prev
1
2
3
4
Next
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