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
b563034b
Commit
b563034b
authored
Jun 30, 2015
by
Peter van 't Hof
Browse files
Fix code style warnings by IDE
parent
483fe407
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/shiva/src/main/scala/nl/lumc/sasc/biopet/pipelines/shiva/ShivaTrait.scala
View file @
b563034b
...
...
@@ -72,8 +72,8 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
/** Sample specific files to add to summary */
def
summaryFiles
:
Map
[
String
,
File
]
=
{
preProcessBam
match
{
case
Some
(
preProcessBam
)
=>
Map
(
"preProcessBam"
->
preProcessBam
)
case
_
=>
Map
()
case
Some
(
b
)
=>
Map
(
"preProcessBam"
->
b
)
case
_
=>
Map
()
}
}
...
...
@@ -88,9 +88,9 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
/** Library specific files to add to the summary */
def
summaryFiles
:
Map
[
String
,
File
]
=
{
(
bamFile
,
preProcessBam
)
match
{
case
(
Some
(
b
amFile
),
Some
(
p
reProcessBam
))
=>
Map
(
"bamFile"
->
b
amFile
,
"preProcessBam"
->
p
reProcessBam
)
case
(
Some
(
b
amFile
),
_
)
=>
Map
(
"bamFile"
->
b
amFile
)
case
_
=>
Map
()
case
(
Some
(
b
),
Some
(
p
b
))
=>
Map
(
"bamFile"
->
b
,
"preProcessBam"
->
p
b
)
case
(
Some
(
b
),
_
)
=>
Map
(
"bamFile"
->
b
)
case
_
=>
Map
()
}
}
...
...
@@ -116,10 +116,9 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
case
(
false
,
true
)
=>
// Starting from bam file
config
(
"bam_to_fastq"
,
default
=
false
).
asBoolean
match
{
case
true
=>
makeMapping
// bam file will be converted to fastq
case
false
=>
{
case
false
=>
val
file
=
new
File
(
libDir
,
sampleId
+
"-"
+
libId
+
".final.bam"
)
(
None
,
Some
(
file
),
preProcess
(
file
))
}
}
case
_
=>
(
None
,
None
,
None
)
}
...
...
@@ -137,7 +136,7 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
mapping
.
input_R2
=
config
(
"R2"
)
})
case
(
false
,
true
)
=>
config
(
"bam_to_fastq"
,
default
=
false
).
asBoolean
match
{
case
true
=>
{
case
true
=>
val
samToFastq
=
SamToFastq
(
qscript
,
config
(
"bam"
),
new
File
(
libDir
,
sampleId
+
"-"
+
libId
+
".R1.fastq"
),
new
File
(
libDir
,
sampleId
+
"-"
+
libId
+
".R2.fastq"
))
...
...
@@ -147,8 +146,7 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
mapping
.
input_R1
=
samToFastq
.
fastqR1
mapping
.
input_R2
=
Some
(
samToFastq
.
fastqR2
)
})
}
case
false
=>
{
case
false
=>
val
inputSam
=
SamReaderFactory
.
makeDefault
.
open
(
config
(
"bam"
))
val
readGroups
=
inputSam
.
getFileHeader
.
getReadGroups
...
...
@@ -157,7 +155,7 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
if
(
readGroup
.
getLibrary
!=
libId
)
logger
.
warn
(
"Library ID readgroup in bam file is not the same"
)
readGroup
.
getSample
==
sampleId
&&
readGroup
.
getLibrary
==
libId
})
inputSam
.
close
inputSam
.
close
()
if
(!
readGroupOke
)
{
if
(
config
(
"correct_readgroups"
,
default
=
false
).
asBoolean
)
{
...
...
@@ -181,15 +179,13 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
bamLn
.
deps
:+=
baiLn
.
output
add
(
bamLn
)
}
}
}
case
_
=>
logger
.
warn
(
"Sample: "
+
sampleId
+
" Library: "
+
libId
+
", no reads found"
)
}
mapping
.
foreach
(
mapping
=>
{
mapping
.
init
mapping
.
biopetScript
mapping
.
init
()
mapping
.
biopetScript
()
addAll
(
mapping
.
functions
)
// Add functions of mapping to curent function pool
addSummaryQScript
(
mapping
)
})
...
...
@@ -234,13 +230,13 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
}
}
lazy
val
preProcessBam
:
Option
[
File
]
=
addDoublePreProcess
(
libraries
.
m
ap
(
lib
=>
{
lazy
val
preProcessBam
:
Option
[
File
]
=
addDoublePreProcess
(
libraries
.
flatM
ap
(
lib
=>
{
(
lib
.
_2
.
bamFile
,
lib
.
_2
.
preProcessBam
)
match
{
case
(
_
,
Some
(
file
))
=>
Some
(
file
)
case
(
Some
(
file
),
_
)
=>
Some
(
file
)
case
_
=>
None
}
}).
flatten
.
toList
)
}).
toList
)
lazy
val
variantcalling
=
if
(
config
(
"single_sample_variantcalling"
,
default
=
false
).
asBoolean
)
{
Some
(
makeVariantcalling
(
multisample
=
true
))
...
...
@@ -255,8 +251,8 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
bamMetrics
.
sampleId
=
Some
(
sampleId
)
bamMetrics
.
inputBam
=
preProcessBam
.
get
bamMetrics
.
outputDir
=
sampleDir
bamMetrics
.
init
bamMetrics
.
biopetScript
bamMetrics
.
init
()
bamMetrics
.
biopetScript
()
addAll
(
bamMetrics
.
functions
)
addSummaryQScript
(
bamMetrics
)
...
...
@@ -281,7 +277,7 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
def
addMultiSampleJobs
()
:
Unit
=
{
variantcalling
.
foreach
(
vc
=>
{
vc
.
outputDir
=
new
File
(
outputDir
,
"variantcalling"
)
vc
.
inputBams
=
samples
.
m
ap
(
_
.
_2
.
preProcessBam
).
flatten
.
toList
vc
.
inputBams
=
samples
.
flatM
ap
(
_
.
_2
.
preProcessBam
).
toList
vc
.
init
vc
.
biopetScript
addAll
(
vc
.
functions
)
...
...
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