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
03c4d7d7
Commit
03c4d7d7
authored
Jul 14, 2017
by
Peter van 't Hof
Committed by
GitHub
Jul 14, 2017
Browse files
Merge pull request #161 from biopet/fix-BIOPET-746
Fixing compile and code warnings
parents
08851b43
1913955a
Changes
466
Hide whitespace changes
Inline
Side-by-side
Jenkinsfile
View file @
03c4d7d7
...
...
@@ -29,7 +29,7 @@ node('local') {
sh
'mkdocs build --clean --strict'
}
if
(
currentBuild
.
result
==
null
||
"SUCCESS"
.
equals
(
currentBuild
.
result
)
)
{
if
(
currentBuild
.
result
==
null
||
"SUCCESS"
==
currentBuild
.
result
)
{
currentBuild
.
result
=
"SUCCESS"
slackSend
(
color:
'#00FF00'
,
message:
"${currentBuild.result}: Job '${env.JOB_NAME} #${env.BUILD_NUMBER}' (<${env.BUILD_URL}|Open>)"
,
channel:
'#biopet-bot'
,
teamDomain:
'lumc'
,
tokenCredentialId:
'lumc'
)
}
else
{
...
...
@@ -37,7 +37,7 @@ node('local') {
}
}
catch
(
e
)
{
if
(
currentBuild
.
result
==
null
||
"FAILED"
.
equals
(
currentBuild
.
result
)
)
{
if
(
currentBuild
.
result
==
null
||
"FAILED"
==
currentBuild
.
result
)
{
currentBuild
.
result
=
"FAILED"
}
slackSend
(
color:
'#FF0000'
,
message:
"${currentBuild.result}: Job '${env.JOB_NAME} #${env.BUILD_NUMBER}' (<${env.BUILD_URL}|Open>)"
,
channel:
'#biopet-bot'
,
teamDomain:
'lumc'
,
tokenCredentialId:
'lumc'
)
...
...
bam2wig/src/main/scala/nl/lumc/sasc/biopet/pipelines/bamtobigwig/Bam2Wig.scala
View file @
03c4d7d7
...
...
@@ -31,7 +31,7 @@ class Bam2Wig(val parent: Configurable) extends QScript with BiopetQScript {
def
this
()
=
this
(
null
)
@Input
(
doc
=
"Input bam file"
,
required
=
true
)
var
bamFile
:
File
=
null
var
bamFile
:
File
=
_
def
init
()
:
Unit
=
{
inputFiles
:+=
new
InputFile
(
bamFile
)
...
...
bam2wig/src/test/scala/nl/lumc/sasc/biopet/pipelines/bamtobigwig/BamToChromSizesTest.scala
View file @
03c4d7d7
...
...
@@ -32,7 +32,7 @@ class BamToChromSizesTest extends TestNGSuite with Matchers {
}
@Test
def
testChromSizes
:
Unit
=
{
def
testChromSizes
()
:
Unit
=
{
val
bamFile
=
new
File
(
resourcePath
(
"/empty.bam"
))
val
bamToChromSizes
=
new
BamToChromSizes
(
null
)
bamToChromSizes
.
bamFile
=
bamFile
...
...
bammetrics/src/main/resources/nl/lumc/sasc/biopet/pipelines/bammetrics/bamMetricsFront.ssp
View file @
03c4d7d7
...
...
@@ -13,8 +13,8 @@
<tr><th>Version</th><td>${run.version}</td></tr>
<tr><th>Last commit hash</th><td>${run.commitHash}</td></tr>
<tr><th>Output directory</th><td>${run.outputDir}</td></tr>
<tr><th>Sample</th><td>${allSamples.fi
lter
(_.id == sampleId.get).
headOption.
map(_.name)}</td></tr>
<tr><th>Library</th><td>${allLibraries.fi
lter
(_.id == libId.get).
headOption.
map(_.name)}</td></tr>
<tr><th>Sample</th><td>${allSamples.fi
nd
(_.id == sampleId.get).map(_.name)}</td></tr>
<tr><th>Library</th><td>${allLibraries.fi
nd
(_.id == libId.get).map(_.name)}</td></tr>
</tbody>
</table>
<br/>
...
...
bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BamMetrics.scala
View file @
03c4d7d7
...
...
@@ -48,7 +48,7 @@ class BamMetrics(val parent: Configurable)
override
def
defaults
=
Map
(
"bedtoolscoverage"
->
Map
(
"sorted"
->
true
))
/** returns files to store in summary */
def
summaryFiles
=
def
summaryFiles
:
Map
[
String
,
File
]
=
Map
(
"reference"
->
referenceFasta
(),
"input_bam"
->
inputBam
)
++
ampliconBedFile
.
map
(
"amplicon"
->
_
).
toMap
++
ampliconBedFile
.
map
(
x
=>
"roi_"
+
x
.
getName
.
stripSuffix
(
".bed"
)
->
x
).
toMap
...
...
@@ -58,7 +58,7 @@ class BamMetrics(val parent: Configurable)
Map
(
"amplicon_name"
->
ampliconBedFile
.
collect
{
case
x
=>
x
.
getName
.
stripSuffix
(
".bed"
)
},
"roi_name"
->
roiBedFiles
.
map
(
_
.
getName
.
stripSuffix
(
".bed"
)))
override
def
reportClass
=
{
override
def
reportClass
:
Some
[
BammetricsReport
]
=
{
val
bammetricsReport
=
new
BammetricsReport
(
this
)
bammetricsReport
.
outputDir
=
new
File
(
outputDir
,
"report"
)
bammetricsReport
.
summaryDbFile
=
summaryDbFile
...
...
bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala
View file @
03c4d7d7
...
...
@@ -487,7 +487,7 @@ object BammetricsReport extends ReportBuilder {
}
def
writeTableToTsv
(
tsvFile
:
File
,
table
:
Map
[
String
,
Array
[
Any
]],
firstColumn
:
String
)
:
Unit
=
{
require
(
table
.
map
(
_
.
_2
.
size
).
toList
.
distinct
.
size
==
1
,
require
(
table
.
map
(
_
.
_2
.
length
).
toList
.
distinct
.
size
==
1
,
"Not all values has the same number or rows"
)
val
keys
=
table
.
keys
.
filterNot
(
_
==
firstColumn
).
toList
.
sorted
val
writer
=
new
PrintWriter
(
tsvFile
)
...
...
bammetrics/src/test/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BamMetricsTest.scala
View file @
03c4d7d7
...
...
@@ -44,7 +44,7 @@ class BamMetricsTest extends TestNGSuite with Matchers {
}
@DataProvider
(
name
=
"bammetricsOptions"
)
def
bammetricsOptions
=
{
def
bammetricsOptions
:
Array
[
Array
[
AnyVal
]]
=
{
val
rois
=
Array
(
0
,
1
,
2
,
3
)
val
bool
=
Array
(
true
,
false
)
...
...
@@ -57,7 +57,7 @@ class BamMetricsTest extends TestNGSuite with Matchers {
private
var
dirs
:
List
[
File
]
=
Nil
@Test
(
dataProvider
=
"bammetricsOptions"
)
def
testBamMetrics
(
rois
:
Int
,
amplicon
:
Boolean
,
rna
:
Boolean
,
wgs
:
Boolean
)
=
{
def
testBamMetrics
(
rois
:
Int
,
amplicon
:
Boolean
,
rna
:
Boolean
,
wgs
:
Boolean
)
:
Unit
=
{
val
outputDir
=
Files
.
createTempDir
()
dirs
:+=
outputDir
val
map
=
ConfigUtils
.
mergeMaps
(
Map
(
"output_dir"
->
outputDir
,
...
...
@@ -74,8 +74,6 @@ class BamMetricsTest extends TestNGSuite with Matchers {
bammetrics
.
libId
=
Some
(
"1"
)
bammetrics
.
script
()
var
regions
:
Int
=
rois
+
(
if
(
amplicon
)
1
else
0
)
bammetrics
.
functions
.
count
(
_
.
isInstanceOf
[
CollectRnaSeqMetrics
])
shouldBe
(
if
(
rna
)
1
else
0
)
bammetrics
.
functions
.
count
(
_
.
isInstanceOf
[
CollectWgsMetrics
])
shouldBe
(
if
(
wgs
)
1
else
0
)
bammetrics
.
functions
.
count
(
_
.
isInstanceOf
[
CollectMultipleMetrics
])
shouldBe
1
...
...
@@ -86,13 +84,13 @@ class BamMetricsTest extends TestNGSuite with Matchers {
}
// remove temporary run directory all tests in the class have been run
@AfterClass
def
removeTempOutputDir
()
=
{
@AfterClass
def
removeTempOutputDir
()
:
Unit
=
{
dirs
.
foreach
(
FileUtils
.
deleteDirectory
)
}
}
object
BamMetricsTest
{
val
inputDir
=
Files
.
createTempDir
()
val
inputDir
:
File
=
Files
.
createTempDir
()
val
bam
=
new
File
(
inputDir
,
"bla.bam"
)
Files
.
touch
(
bam
)
...
...
@@ -100,7 +98,7 @@ object BamMetricsTest {
Files
.
touch
(
ampliconBed
)
def
roi
(
i
:
Int
)
:
File
=
{
val
roi
=
new
File
(
inputDir
,
s
"roi$
{i}
.bed"
)
val
roi
=
new
File
(
inputDir
,
s
"roi$
i
.bed"
)
Files
.
touch
(
roi
)
roi
}
...
...
basty/src/main/scala/nl/lumc/sasc/biopet/pipelines/basty/Basty.scala
View file @
03c4d7d7
...
...
@@ -42,7 +42,7 @@ class Basty(val parent: Configurable) extends QScript with MultiSampleQScript {
def
variantcallers
=
List
(
"unifiedgenotyper"
)
val
numBoot
=
config
(
"boot_runs"
,
default
=
100
,
namespace
=
"raxml"
).
asInt
val
numBoot
:
Int
=
config
(
"boot_runs"
,
default
=
100
,
namespace
=
"raxml"
).
asInt
override
def
defaults
=
Map
(
"ploidy"
->
1
,
...
...
basty/src/test/scala/nl/lumc/sasc/biopet/pipelines/basty/BastyTest.scala
View file @
03c4d7d7
...
...
@@ -48,7 +48,7 @@ class BastyTest extends TestNGSuite with Matchers {
}
@DataProvider
(
name
=
"bastyOptions"
)
def
bastyOptions
=
{
def
bastyOptions
:
Array
[
Array
[
Any
]]
=
{
for
(
s1
<-
sample1
;
s2
<-
sample2
)
yield
Array
(
""
,
s1
,
s2
)
}
...
...
@@ -114,7 +114,7 @@ class BastyTest extends TestNGSuite with Matchers {
numberSamples
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
BaseRecalibrator
])
shouldBe
(
if
(
dbsnp
&&
baseRecalibration
)
(
numberLibs
*
2
)
numberLibs
*
2
else
0
)
pipeline
.
functions
.
count
(
_
.
isInstanceOf
[
PrintReads
])
shouldBe
(
if
(
dbsnp
&&
baseRecalibration
)
numberLibs
...
...
@@ -125,7 +125,7 @@ class BastyTest extends TestNGSuite with Matchers {
pipeline
.
summaryFiles
shouldBe
Map
()
pipeline
.
samples
foreach
{
case
(
sampleId
,
sample
)
=>
case
(
_
,
sample
)
=>
sample
.
summarySettings
shouldBe
Map
()
sample
.
summaryFiles
.
get
(
"variants_fasta"
)
should
not
be
None
sample
.
summaryFiles
.
get
(
"consensus_fasta"
)
should
not
be
None
...
...
@@ -135,7 +135,7 @@ class BastyTest extends TestNGSuite with Matchers {
sample
.
summaryFiles
.
get
(
"snps_only_consensus_variants_fasta"
)
should
not
be
None
sample
.
summaryStats
shouldBe
Map
()
sample
.
libraries
.
foreach
{
case
(
libId
,
lib
)
=>
case
(
_
,
lib
)
=>
lib
.
summarySettings
shouldBe
Map
()
lib
.
summaryFiles
shouldBe
Map
()
lib
.
summaryStats
shouldBe
Map
()
...
...
@@ -154,14 +154,14 @@ class BastyTest extends TestNGSuite with Matchers {
}
// remove temporary run directory all tests in the class have been run
@AfterClass
def
removeTempOutputDir
()
=
{
@AfterClass
def
removeTempOutputDir
()
:
Unit
=
{
dirs
.
foreach
(
FileUtils
.
deleteDirectory
)
}
}
object
BastyTest
{
def
outputDir
=
Files
.
createTempDir
()
val
inputDir
=
Files
.
createTempDir
()
def
outputDir
:
File
=
Files
.
createTempDir
()
val
inputDir
:
File
=
Files
.
createTempDir
()
def
inputTouch
(
name
:
String
)
:
String
=
{
val
file
=
new
File
(
inputDir
,
name
)
...
...
biopet-core/src/main/resources/nl/lumc/sasc/biopet/core/report/ext/css/bootstrap_dashboard.css
View file @
03c4d7d7
...
...
@@ -150,10 +150,9 @@ body {
float
:
right
;
width
:
0
;
height
:
0
;
border-color
:
transparent
;
border-style
:
solid
;
border-width
:
5px
0
5px
5px
;
border-left-color
:
#cccccc
;
border
:
5px
solid
transparent
;
border-right-width
:
0
;
border-left-color
:
#cccccc
;
margin-top
:
5px
;
margin-right
:
-10px
;
}
...
...
biopet-core/src/main/resources/nl/lumc/sasc/biopet/core/report/ext/css/sortable-theme-bootstrap.css
View file @
03c4d7d7
...
...
@@ -46,9 +46,7 @@ table[data-sortable] th:after {
vertical-align
:
inherit
;
height
:
0
;
width
:
0
;
border-width
:
5px
;
border-style
:
solid
;
border-color
:
transparent
;
border
:
5px
solid
transparent
;
margin-right
:
1px
;
margin-left
:
10px
;
float
:
right
;
...
...
biopet-core/src/main/resources/nl/lumc/sasc/biopet/core/report/files.ssp
View file @
03c4d7d7
...
...
@@ -31,9 +31,9 @@
<tbody>
#for (file <- files)
<tr><td>${allPipelines.find(_.id == file.pipelineId).map(_.name)}</td>
<td>${file.moduleId.
m
ap(id => allModules.find(x => x.pipelineId == file.pipelineId && file.moduleId == id).map(_.name)).
flatten.
getOrElse(
(
"-")
)
}</td>
<td>${file.sampleId.
m
ap(id => allSamples.find(_.id == id).map(_.name)).
flatten.
getOrElse(
(
"-")
)
}</td>
<td>${file.libraryId.
m
ap(id => allLibraries.find(_.id == id).map(_.name)).
flatten.
getOrElse(
(
"-")
)
}</td>
<td>${file.moduleId.
flatM
ap(id => allModules.find(x => x.pipelineId == file.pipelineId && file.moduleId == id).map(_.name)).getOrElse("-")}</td>
<td>${file.sampleId.
flatM
ap(id => allSamples.find(_.id == id).map(_.name)).getOrElse("-")}</td>
<td>${file.libraryId.
flatM
ap(id => allLibraries.find(_.id == id).map(_.name)).getOrElse("-")}</td>
<td>${file.key}</td>
<td>${file.path}</td>
<td>${file.md5}</td></tr>
...
...
biopet-core/src/main/resources/nl/lumc/sasc/biopet/core/report/main.ssp
View file @
03c4d7d7
...
...
@@ -42,7 +42,7 @@
val tabIndex = if (first) " tabindex='-1'" else ""
// val listGroupA = if(subPage._2.subPages.nonEmpty) "list-group-item" else ""
va
r
menuItem: String = "
<li
class=
'%s'
>
".format(listSubmenu) +
va
l
menuItem: String = "
<li
class=
'%s'
>
".format(listSubmenu) +
"
<a
href=
'%s'
class=
'%s'
%
s
>
".format(href, "", tabIndex) +
"%s".format(subPageName) +
"
</a>
" +
...
...
@@ -93,7 +93,7 @@
<script
language=
"JavaScript"
>
<!--
$
(
document
).
ready
(
function
()
{
Sortable
.
init
()
Sortable
.
init
()
;
$
(
'
body
'
).
scrollspy
({
target
:
'
.bs-sidebar
'
...
...
@@ -135,14 +135,14 @@
<a
href=
"${rootPath}index.html"
>
Home
#if (iPage.subPages.nonEmpty)
<b
class=
"caret"
></b>
#end
</a>
${unescape(createMenu(iPage, Nil, false))}
${unescape(createMenu(iPage, Nil,
first =
false))}
</li>
#else
<li
class=
"root #if (t == path.size) active #end"
>
<a
href=
"${rootPath}${path.slice(0,t).mkString("
",
"/",
"/")}
index.html
"
>
${path( t - 1 )}
#if (getSubPage(path.slice(0, t)).subPages.nonEmpty)
<b
class=
"caret"
></b>
#end
</a>
${unescape(createMenu(getSubPage(path.slice(0, t)), path.slice(0, t), false))}
${unescape(createMenu(getSubPage(path.slice(0, t)), path.slice(0, t),
first =
false))}
</li>
#end
#end
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
View file @
03c4d7d7
...
...
@@ -60,10 +60,10 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
}
/**
*
This value is used to let you job wait a x number of second after it finish.
*
This is ionly used when having storage delay issues
* This value is used to let you job wait a x number of second after it finish.
* This is ionly used when having storage delay issues
*/
va
r
jobDelayTime
:
Option
[
Int
]
=
config
(
"job_delay_time"
)
va
l
jobDelayTime
:
Option
[
Int
]
=
config
(
"job_delay_time"
)
// This overrides the default "sh" from queue. For Biopet the default is "bash"
updateJobRun
=
{
...
...
@@ -147,9 +147,9 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
}
private
[
core
]
var
_inputAsStdin
=
false
def
inputAsStdin
=
_inputAsStdin
def
inputAsStdin
:
Boolean
=
_inputAsStdin
private
[
core
]
var
_outputAsStdout
=
false
def
outputAsStdout
=
_outputAsStdout
def
outputAsStdout
:
Boolean
=
_outputAsStdout
/**
* This operator sends stdout to `that` and combine this into 1 command line function
...
...
@@ -212,13 +212,13 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
maxGroups
:
Int
=
0
)
:
String
=
{
if
(
values
.
size
%
groupSize
!=
0
)
Logging
.
addError
(
s
"Arg '$
{
argName
}
' values: '$
{
values
}
' does not fit to a groupSize of $
{
groupSize
}
"
)
s
"Arg '$argName' values: '$values' does not fit to a groupSize of $groupSize"
)
val
groups
=
values
.
size
/
groupSize
if
(
groups
<
minGroups
)
Logging
.
addError
(
s
"Args '$
{
argName
}
' need atleast $minGroups with size $groupSize"
)
Logging
.
addError
(
s
"Args '$argName' need atleast $minGroups with size $groupSize"
)
if
(
maxGroups
>
0
&&
groups
>
maxGroups
)
Logging
.
addError
(
s
"Args '$
{
argName
}
' may only have $maxGroups with size $groupSize"
)
if
(
values
.
nonEmpty
)
required
(
argName
)
+
values
.
map
(
required
(
_
)
).
mkString
Logging
.
addError
(
s
"Args '$argName' may only have $maxGroups with size $groupSize"
)
if
(
values
.
nonEmpty
)
required
(
argName
)
+
values
.
map
(
required
).
mkString
else
""
}
...
...
@@ -251,7 +251,7 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
}
private
[
core
]
var
_pipesJobs
:
List
[
BiopetCommandLineFunction
]
=
Nil
def
pipesJobs
=
_pipesJobs
def
pipesJobs
:
List
[
BiopetCommandLineFunction
]
=
_pipesJobs
def
addPipeJob
(
job
:
BiopetCommandLineFunction
)
{
_pipesJobs
:+=
job
_pipesJobs
=
_pipesJobs
.
distinct
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetJavaCommandLineFunction.scala
View file @
03c4d7d7
...
...
@@ -30,7 +30,7 @@ trait BiopetJavaCommandLineFunction
override
def
defaultVmemFactor
:
Double
=
2.0
/** Constructs java opts, this adds scala threads */
override
def
javaOpts
=
override
def
javaOpts
:
String
=
super
.
javaOpts
+
optional
(
"-Dscala.concurrent.context.numThreads="
,
threads
,
spaceSeparated
=
false
)
+
optional
(
"-Dscala.concurrent.context.maxThreads="
,
threads
,
spaceSeparated
=
false
)
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetPipe.scala
View file @
03c4d7d7
...
...
@@ -30,14 +30,14 @@ class BiopetPipe(val commands: List[BiopetCommandLineFunction]) extends BiopetCo
lazy
val
input
:
List
[
File
]
=
try
{
commands
.
flatMap
(
_
.
inputs
)
}
catch
{
case
e
:
Exception
=>
Nil
case
_
:
Exception
=>
Nil
}
@Output
lazy
val
output
:
List
[
File
]
=
try
{
commands
.
flatMap
(
_
.
outputs
)
}
catch
{
case
e
:
Exception
=>
Nil
case
_
:
Exception
=>
Nil
}
_pipesJobs
:::=
commands
...
...
@@ -74,7 +74,7 @@ class BiopetPipe(val commands: List[BiopetCommandLineFunction]) extends BiopetCo
override
def
defaultThreads
=
0
val
parent
:
Configurable
=
commands
.
head
.
parent
override
def
configNamespace
=
commands
.
map
(
_
.
configNamespace
).
mkString
(
"-"
)
override
def
configNamespace
:
String
=
commands
.
map
(
_
.
configNamespace
).
mkString
(
"-"
)
def
cmdLine
:
String
=
{
"("
+
commands
.
head
.
cmdLine
+
(
if
(
commands
.
head
.
stdinFile
.
isDefined
)
{
" < "
+
required
(
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
View file @
03c4d7d7
...
...
@@ -221,7 +221,7 @@ object BiopetQScript {
try
{
Some
(
function
.
inputs
)
}
catch
{
case
e
:
NullPointerException
=>
None
case
_
:
NullPointerException
=>
None
}
}
...
...
@@ -229,7 +229,7 @@ object BiopetQScript {
try
{
Some
(
function
.
outputs
)
}
catch
{
case
e
:
NullPointerException
=>
None
case
_
:
NullPointerException
=>
None
}
}
...
...
@@ -237,7 +237,7 @@ object BiopetQScript {
try
{
Some
(
function
.
doneOutputs
)
}
catch
{
case
e
:
NullPointerException
=>
None
case
_
:
NullPointerException
=>
None
}
}
...
...
@@ -245,7 +245,7 @@ object BiopetQScript {
try
{
Some
(
function
.
failOutputs
)
}
catch
{
case
e
:
NullPointerException
=>
None
case
_
:
NullPointerException
=>
None
}
}
...
...
@@ -253,7 +253,7 @@ object BiopetQScript {
try
{
Some
(
function
.
isDone
)
}
catch
{
case
e
:
NullPointerException
=>
None
case
_
:
NullPointerException
=>
None
}
}
...
...
@@ -261,7 +261,7 @@ object BiopetQScript {
try
{
Some
(
function
.
isFail
)
}
catch
{
case
e
:
NullPointerException
=>
None
case
_
:
NullPointerException
=>
None
}
}
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/CommandLineResources.scala
View file @
03c4d7d7
...
...
@@ -32,7 +32,7 @@ trait CommandLineResources extends CommandLineFunction with Configurable {
def
defaultThreads
=
1
/** This method will get and set the cores requested */
final
def
threads
=
nCoresRequest
match
{
final
def
threads
:
Int
=
nCoresRequest
match
{
case
Some
(
i
)
=>
i
case
_
=>
val
t
=
getThreads
...
...
@@ -47,14 +47,15 @@ trait CommandLineResources extends CommandLineFunction with Configurable {
def
defaultCoreMemory
:
Double
=
2.0
def
defaultVmemFactor
:
Double
=
1.4
def
defaultResidentFactor
:
Double
=
1.2
var
vmemFactor
:
Double
=
config
(
"vmem_factor"
,
default
=
defaultVmemFactor
)
val
vmemFactor
:
Double
=
config
(
"vmem_factor"
,
default
=
defaultVmemFactor
)
val
useSge
:
Boolean
=
config
(
"use_sge"
,
default
=
true
)
va
r
residentFactor
:
Double
=
config
(
"resident_factor"
,
default
=
defaultResidentFactor
)
va
l
residentFactor
:
Double
=
config
(
"resident_factor"
,
default
=
defaultResidentFactor
)
private
var
_coreMemory
:
Double
=
2.0
def
coreMemory
=
_coreMemory
def
coreMemory
:
Double
=
_coreMemory
/** This value is for SGE and is defined in seconds */
wallTime
=
config
(
"max_walltime"
)
...
...
@@ -92,7 +93,7 @@ trait CommandLineResources extends CommandLineFunction with Configurable {
val
firstOutput
=
try
{
this
.
firstOutput
}
catch
{
case
e
:
NullPointerException
=>
null
case
_
:
NullPointerException
=>
null
}
nCoresRequest
=
Option
(
threads
)
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/MultiSampleQScript.scala
View file @
03c4d7d7
...
...
@@ -25,6 +25,7 @@ import org.broadinstitute.gatk.queue.QScript
import
scala.concurrent.Await
import
scala.concurrent.duration.Duration
import
scala.concurrent.ExecutionContext.Implicits.global
import
scala.util.matching.Regex
/** This trait creates a structured way of use multisample pipelines */
trait
MultiSampleQScript
extends
SummaryQScript
{
qscript
:
QScript
=>
...
...
@@ -84,7 +85,7 @@ trait MultiSampleQScript extends SummaryQScript { qscript: QScript =>
namespace
=
libId
,
path
=
List
(
"samples"
,
sampleId
,
"libraries"
))
def
sampleId
=
sample
.
sampleId
def
sampleId
:
String
=
sample
.
sampleId
lazy
val
libGroups
:
List
[
String
]
=
libTags
.
get
(
"groups"
)
match
{
case
Some
(
g
:
List
[
_
])
=>
g
.
map
(
_
.
toString
)
...
...
@@ -109,19 +110,19 @@ trait MultiSampleQScript extends SummaryQScript { qscript: QScript =>
namespace
=
sampleId
,
path
=
List
(
"samples"
))
lazy
val
gender
=
{
lazy
val
gender
:
MultiSampleQScript.Gender.Value
=
{
val
g
:
Option
[
String
]
=
sampleTags
.
get
(
"gender"
).
map
(
_
.
toString
)
g
.
map
(
_
.
toLowerCase
)
match
{
case
Some
(
"male"
)
=>
Gender
.
Male
case
Some
(
"female"
)
=>
Gender
.
Female
case
Some
(
s
)
=>
case
Some
(
_
)
=>
logger
.
warn
(
s
"Could not convert '$g' to a gender"
)
Gender
.
Unknown
case
_
=>
Gender
.
Unknown
}
}
lazy
val
father
=
{
lazy
val
father
:
Option
[
String
]
=
{
val
g
:
Option
[
String
]
=
sampleTags
.
get
(
"father"
).
map
(
_
.
toString
)
g
.
foreach
{
father
=>
if
(
sampleId
==
father
)
Logging
.
addError
(
s
"Father for $sampleId can not be itself"
)
...
...
@@ -133,7 +134,7 @@ trait MultiSampleQScript extends SummaryQScript { qscript: QScript =>
g
}
lazy
val
mother
=
{
lazy
val
mother
:
Option
[
String
]
=
{
val
g
:
Option
[
String
]
=
sampleTags
.
get
(
"mother"
).
map
(
_
.
toString
)
g
.
foreach
{
mother
=>
if
(
sampleId
==
mother
)
Logging
.
addError
(
s
"mother for $sampleId can not be itself"
)
...
...
@@ -199,7 +200,7 @@ trait MultiSampleQScript extends SummaryQScript { qscript: QScript =>
/** function add all libraries in one call */
protected
final
def
addPerLibJobs
()
:
Unit
=
{
for
((
libId
,
library
)
<-
libraries
)
{
for
((
_
,
library
)
<-
libraries
)
{
library
.
addAndTrackJobs
()
}
}
...
...
@@ -228,8 +229,8 @@ trait MultiSampleQScript extends SummaryQScript { qscript: QScript =>
protected
def
sampleIds
:
Set
[
String
]
=
ConfigUtils
.
any2map
(
globalConfig
.
map
.
getOrElse
(
"samples"
,
Map
())).
keySet
protected
lazy
val
nameRegex
=
"""^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$"""
.
r
protected
lazy
val
nameError
=
"has an invalid name. "
+
protected
lazy
val
nameRegex
:
Regex
=
"""^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$"""
.
r
protected
lazy
val
nameError
:
String
=
"has an invalid name. "
+
"Sample names must have at least 3 characters, "
+
"must begin and end with an alphanumeric character, "
+
"and must not have whitespace and special characters. "
+
...
...
@@ -281,7 +282,7 @@ trait MultiSampleQScript extends SummaryQScript { qscript: QScript =>
sample
:::
lib
:::
super
.
configFullPath
}
def
initSummaryDb
:
Unit
=
{
def
initSummaryDb
()
:
Unit
=
{
val
db
=
SummaryDb
.
openSqliteSummary
(
summaryDbFile
)
val
namesOld
=
Await
.
result
(
db
.
getSamples
(
runId
=
Some
(
summaryRunId
)).
map
(
_
.
map
(
_
.
name
).
toSet
),
Duration
.
Inf
)
...
...
biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/PedigreeQscript.scala
View file @
03c4d7d7
...
...
@@ -201,10 +201,7 @@ trait PedigreeQscript extends MultiSampleQScript { qscript: QScript =>
}
val
affectedField
=
p
.
affectedPhenotype
match
{
case
Some
(
b
)
=>
b
match
{
case
true
=>
"2"
case
_
=>
"1"
}
if
(
b
)
"2"
else
"1"
case
_
=>
"0"
}
val
mainLine
:
String
=
...
...
Prev
1
2
3
4
5
…
24
Next
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