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
caf71f04
Commit
caf71f04
authored
Jul 13, 2017
by
Peter van 't Hof
Browse files
Inspection round pipelines
parent
2540e8fd
Changes
81
Hide whitespace changes
Inline
Side-by-side
carp/src/test/scala/nl/lumc/sasc/biopet/pipelines/carp/CarpTest.scala
View file @
caf71f04
...
...
@@ -44,7 +44,7 @@ class CarpTest extends TestNGSuite with Matchers {
}
@DataProvider
(
name
=
"carpOptions"
)
def
carpOptions
=
{
def
carpOptions
:
Array
[
Array
[
Any
]]
=
{
val
bool
=
Array
(
true
,
false
)
for
(
s1
<-
bool
;
s2
<-
bool
;
s3
<-
bool
;
t
<-
bool
;
c
<-
bool
)
...
...
@@ -103,7 +103,7 @@ class CarpTest extends TestNGSuite with Matchers {
}
// remove temporary run directory all tests in the class have been run
@AfterClass
def
removeTempOutputDir
()
=
{
@AfterClass
def
removeTempOutputDir
()
:
Unit
=
{
dirs
.
filter
(
_
.
exists
()).
foreach
{
dir
=>
try
{
FileUtils
.
deleteDirectory
(
dir
)
...
...
@@ -116,8 +116,8 @@ class CarpTest extends TestNGSuite with Matchers {
}
object
CarpTest
{
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
)
...
...
flexiprep/src/main/resources/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepBaseSummary.ssp
View file @
caf71f04
...
...
@@ -26,14 +26,14 @@
val libraries = libId.map(id => allLibraries.filter(_.id == id)).getOrElse(allLibraries)
val settings = summary.getSettingsForLibraries(runId, "flexiprep", keyValues = Map(
"skip_trim" -> List("skip_trim"), "skip_clip" -> List("skip_clip"), "paired" -> List("paired")))
settings.count(_._2.getOrElse("skip_trim", None)
== Some
(true))
val trimCount = settings.count(_._2.getOrElse("skip_trim", None)
== Some
(false))
val clipCount = settings.count(_._2.getOrElse("skip_clip", None)
== Some
(false))
settings.count(_._2.getOrElse("skip_trim", None)
.contains
(true))
val trimCount = settings.count(_._2.getOrElse("skip_trim", None)
.contains
(false))
val clipCount = settings.count(_._2.getOrElse("skip_clip", None)
.contains
(false))
val librariesCount = libraries.size
val paired: Boolean = if (sampleId.isDefined && libId.isDefined)
summary.getSettingKeys(runId, "flexiprep", NoModule, SampleId(sampleId.get), LibraryId(libId.get), keyValues = Map("paired" -> List("paired"))).getOrElse("paired", None)
== Some
(true)
else settings.count(_._2.getOrElse("paired", None)
== Some
(true)) >= 1
summary.getSettingKeys(runId, "flexiprep", NoModule, SampleId(sampleId.get), LibraryId(libId.get), keyValues = Map("paired" -> List("paired"))).getOrElse("paired", None)
.contains
(true)
else settings.count(_._2.getOrElse("paired", None)
.contains
(true)) >= 1
}#
#if (showIntro)
<br/>
...
...
@@ -118,7 +118,7 @@
#for (sample <- samples.sortBy(_.name))
#{
val sampleRowspan = {
libraries.
filter
(_.sampleId == sample.id)
.size
+
libraries.
count
(_.sampleId == sample.id) +
settings.filter(_._1._1 == sample.id).count(_._2("paired").getOrElse(false) == true)
}
}#
...
...
@@ -130,7 +130,7 @@
#end
</td>
#for (lib <- libraries.filter(_.sampleId == sample.id))
#{ val paired = settings.filter(_._1._1 == sample.id).filter(_._1._2 == lib.id).head._2("paired")
== Some
(true) }#
#{ val paired = settings.filter(_._1._1 == sample.id).filter(_._1._2 == lib.id).head._2("paired")
.contains
(true) }#
<td #if (paired == true) rowspan="2" #end>
#if (multisample)
<a href="${rootPath}Samples/${sample.name}/Libraries/${lib.name}/index.html">${lib.name}</a>
...
...
flexiprep/src/main/resources/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepFastQcPlot.ssp
View file @
caf71f04
...
...
@@ -21,25 +21,24 @@
"skip_trim" -> List("skip_trim"), "skip_clip" -> List("skip_clip"), "paired" -> List("paired")))
val run = Await.result(summary.getRuns(runId = Some(runId)).map(_.head), Duration.Inf)
val paired: Boolean = settings("paired")
== Some
(true)
val skipClip: Boolean = settings("skip_clip")
== Some
(true)
val skipTrim: Boolean = settings("skip_trim")
== Some
(true)
val paired: Boolean = settings("paired")
.contains
(true)
val skipClip: Boolean = settings("skip_clip")
.contains
(true)
val skipTrim: Boolean = settings("skip_trim")
.contains
(true)
def getPlot(read:String) = {
val file = Await.result(summary.getFile(runId, "flexiprep", read, SampleId(sampleId.get), LibraryId(libId.get), plot), Duration.Inf)
file.collect {
case path =>
{
case path =>
val file = new File(run.outputDir + File.separator + path.path)
val newFile = new File(outputDir, read + "_" + file.getName)
if (file.exists()) FileUtils.copyFile(file, newFile)
newFile.getName
}
}
}
def plotAvailable(read:String) = {
val file = Await.result(summary.getFile(runId, "flexiprep", read, SampleId(sampleId.get), LibraryId(libId.get), plot), Duration.Inf)
file.
map
(x => new File(run.outputDir + File.separator + x.path).exists())
.getOrElse(false)
file.
exists
(x => new File(run.outputDir + File.separator + x.path).exists())
}
}#
...
...
flexiprep/src/main/resources/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepFront.ssp
View file @
caf71f04
...
...
@@ -12,8 +12,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 ID</th><td>${allSamples.fi
lter
(_.id == sampleId.get).
headOption.
map(_.name)}</td></tr>
<tr><th>Library ID</th><td>${allLibraries.fi
lter
(_.id == libId.get).
headOption.
map(_.name)}</td></tr>
<tr><th>Sample ID</th><td>${allSamples.fi
nd
(_.id == sampleId.get).map(_.name)}</td></tr>
<tr><th>Library ID</th><td>${allLibraries.fi
nd
(_.id == libId.get).map(_.name)}</td></tr>
</tbody>
</table>
<br/>
...
...
flexiprep/src/main/resources/nl/lumc/sasc/biopet/pipelines/flexiprep/flexiprepReadSummary.ssp
View file @
caf71f04
...
...
@@ -25,14 +25,14 @@
val libraries = libId.map(id => allLibraries.filter(_.id == id)).getOrElse(allLibraries)
val settings = summary.getSettingsForLibraries(runId, "flexiprep", keyValues = Map(
"skip_trim" -> List("skip_trim"), "skip_clip" -> List("skip_clip"), "paired" -> List("paired")))
settings.count(_._2.getOrElse("skip_trim", None)
== Some
(true))
val trimCount = settings.count(_._2.getOrElse("skip_trim", None)
== Some
(false))
val clipCount = settings.count(_._2.getOrElse("skip_clip", None)
== Some
(false))
settings.count(_._2.getOrElse("skip_trim", None)
.contains
(true))
val trimCount = settings.count(_._2.getOrElse("skip_trim", None)
.contains
(false))
val clipCount = settings.count(_._2.getOrElse("skip_clip", None)
.contains
(false))
val librariesCount = libraries.size
val paired: Boolean = if (sampleId.isDefined && libId.isDefined)
summary.getSettingKeys(runId, "flexiprep", NoModule, SampleId(sampleId.get), LibraryId(libId.get), keyValues = Map("paired" -> List("paired"))).getOrElse("paired", None)
== Some
(true)
else settings.count(_._2.getOrElse("paired", None)
== Some
(true)) >= 1
summary.getSettingKeys(runId, "flexiprep", NoModule, SampleId(sampleId.get), LibraryId(libId.get), keyValues = Map("paired" -> List("paired"))).getOrElse("paired", None)
.contains
(true)
else settings.count(_._2.getOrElse("paired", None)
.contains
(true)) >= 1
}#
#if (showIntro)
...
...
@@ -123,7 +123,7 @@
#for (sample <- samples.sortBy(_.name))
#{
val sampleRowspan = {
libraries.
filter
(_.sampleId == sample.id)
.size
+
libraries.
count
(_.sampleId == sample.id) +
settings.filter(_._1._1 == sample.id).count(_._2("paired").getOrElse(false) == true)
}
}#
...
...
@@ -135,7 +135,7 @@
#end
</td>
#for (lib <- libraries.filter(_.sampleId == sample.id))
#{ val paired = settings.filter(_._1._1 == sample.id).filter(_._1._2 == lib.id).head._2("paired")
== Some
(true) }#
#{ val paired = settings.filter(_._1._1 == sample.id).filter(_._1._2 == lib.id).head._2("paired")
.contains
(true) }#
<td #if (paired == true) rowspan="2" #end>
#if (multisample)
<a href="${rootPath}Samples/${sample.name}/Libraries/${lib.name}/index.html">${lib.name}</a>
...
...
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/CheckValidateFastq.scala
View file @
caf71f04
...
...
@@ -32,7 +32,7 @@ class CheckValidateFastq extends InProcessFunction {
var
inputLogFile
:
File
=
_
/** Exits whenever the input md5sum is not the same as the output md5sum */
def
run
:
Unit
=
{
def
run
()
:
Unit
=
{
val
reader
=
Source
.
fromFile
(
inputLogFile
)
reader
.
getLines
().
foreach
{
line
=>
...
...
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Cutadapt.scala
View file @
caf71f04
...
...
@@ -76,11 +76,10 @@ class Cutadapt(root: Configurable, fastqc: Fastqc)
case
(
adapterSequence
:
String
,
adapterStats
:
Map
[
_
,
_
])
=>
seqToNameMap
.
get
(
adapterSequence
)
match
{
// adapter sequence is found by FastQC
case
Some
(
adapterSeqName
)
=>
{
case
Some
(
adapterSeqName
)
=>
Some
(
adapterSeqName
->
Map
(
"sequence"
->
adapterSequence
,
"stats"
->
adapterStats
.
toMap
))
}
// adapter sequence is clipped but not found by FastQC ~ should not happen since all clipped adapter
// sequences come from FastQC
case
_
=>
...
...
@@ -88,14 +87,14 @@ class Cutadapt(root: Configurable, fastqc: Fastqc)
s
"Adapter '$adapterSequence' is clipped but not found by FastQC in '$fastqInput'."
)
}
// FastQC found no adapters
case
otherwise
=>
case
_
=>
logger
.
debug
(
s
"No adapters found for summarizing in '$fastqInput'."
)
None
}
// "adapters" key not found ~ something went wrong in our part
case
_
=>
throw
new
RuntimeException
(
s
"Required key '$
{
adaptersStatsName
}
' not found in stats entry '$
{
fastqInput
}
'."
)
s
"Required key '$adaptersStatsName' not found in stats entry '$fastqInput'."
)
}
initStats
.
updated
(
adaptersStatsName
,
adapterCounts
)
}
...
...
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Fastqc.scala
View file @
caf71f04
...
...
@@ -288,7 +288,7 @@ object Fastqc {
if
(
filename
.
endsWith
(
".fastq"
))
filename
=
filename
.
substring
(
0
,
filename
.
length
-
6
)
fastqcCommand
.
getVersion
.
flatMap
(
SemanticVersion
.
getSemanticVersion
)
match
{
case
Some
(
v
)
if
v
>=
SemanticVersion
(
0
,
11
,
4
)
=>
if
(
filename
.
endsWith
(
".fq"
))
filename
=
filename
.
substring
(
0
,
filename
.
size
-
3
)
if
(
filename
.
endsWith
(
".fq"
))
filename
=
filename
.
substring
(
0
,
filename
.
length
-
3
)
case
_
=>
}
fastqcCommand
.
output
=
new
File
(
outDir
,
filename
+
"_fastqc.zip"
)
...
...
flexiprep/src/main/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/Flexiprep.scala
View file @
caf71f04
...
...
@@ -50,7 +50,7 @@ class Flexiprep(val parent: Configurable)
/** Make a final fastq files, by default only when flexiprep is the main pipeline */
var
keepQcFastqFiles
:
Boolean
=
config
(
"keepQcFastqFiles"
,
default
=
parent
==
null
)
override
def
defaults
=
super
.
defaults
++
Map
(
"max_threads"
->
4
)
override
def
defaults
:
Map
[
String
,
Any
]
=
super
.
defaults
++
Map
(
"max_threads"
->
4
)
/** Returns files to store in summary */
def
summaryFiles
:
Map
[
String
,
File
]
=
{
...
...
flexiprep/src/test/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/CutadaptTest.scala
View file @
caf71f04
...
...
@@ -37,7 +37,7 @@ class CutadaptTest extends FastqcV0101Test {
caExe
}
@Test
def
testAdapterFound
()
=
{
@Test
def
testAdapterFound
()
:
Unit
=
{
val
cutadapt
=
testCutadaptInst
val
adapters
=
cutadapt
.
extractClippedAdapters
(
cutadaptOut
)
adapters
.
keys
.
size
shouldBe
4
...
...
@@ -60,7 +60,7 @@ class CutadaptTest extends FastqcV0101Test {
)
}
@Test
def
testSummary
()
=
{
@Test
def
testSummary
()
:
Unit
=
{
val
cutadapt
=
testCutadaptInst
val
summary
=
cutadapt
.
summaryStats
...
...
flexiprep/src/test/scala/nl/lumc/sasc/biopet/pipelines/flexiprep/FastqcV0101Test.scala
View file @
caf71f04
...
...
@@ -35,14 +35,14 @@ class FastqcV0101Test extends TestNGSuite with Matchers {
// the file doesn't actually exist, we just need it so the outputDir value can be computed correctly
private
[
flexiprep
]
val
outputv0101
:
File
=
resourceFile
(
"v0101.fq_fastqc.zip"
)
@Test
def
testOutputDir
()
=
{
@Test
def
testOutputDir
()
:
Unit
=
{
val
fqc
=
new
Fastqc
(
null
)
fqc
.
output
=
outputv0101
fqc
.
outputDir
shouldBe
new
File
(
resourceDir
,
"v0101.fq_fastqc"
)
}
@Test
def
testGcDistro
:
Unit
=
{
def
testGcDistro
()
:
Unit
=
{
val
fqc
=
new
Fastqc
(
null
)
fqc
.
output
=
outputv0101
val
x
=
fqc
.
gcDistribution
.
get
...
...
@@ -54,7 +54,7 @@ class FastqcV0101Test extends TestNGSuite with Matchers {
}
@Test
def
testQcModules
()
=
{
@Test
def
testQcModules
()
:
Unit
=
{
val
fqc
=
new
Fastqc
(
null
)
fqc
.
output
=
outputv0101
// 11 QC modules
...
...
@@ -67,7 +67,7 @@ class FastqcV0101Test extends TestNGSuite with Matchers {
fqc
.
qcModules
.
keySet
should
contain
(
"Kmer Content"
)
}
@Test
def
testSingleQcModule
()
=
{
@Test
def
testSingleQcModule
()
:
Unit
=
{
val
fqc
=
new
Fastqc
(
null
)
fqc
.
output
=
outputv0101
fqc
.
qcModules
(
"Basic Statistics"
).
name
should
===(
"Basic Statistics"
)
...
...
@@ -75,13 +75,13 @@ class FastqcV0101Test extends TestNGSuite with Matchers {
fqc
.
qcModules
(
"Basic Statistics"
).
lines
.
size
shouldBe
8
}
@Test
def
testEncoding
()
=
{
@Test
def
testEncoding
()
:
Unit
=
{
val
fqc
=
new
Fastqc
(
null
)
fqc
.
output
=
outputv0101
fqc
.
encoding
shouldBe
"Sanger / Illumina 1.9"
}
@Test
def
testFoundAdapter
()
=
{
@Test
def
testFoundAdapter
()
:
Unit
=
{
val
fqc
=
new
Fastqc
(
null
)
fqc
.
output
=
outputv0101
fqc
.
contaminants
=
Option
(
resourceFile
(
"fqc_contaminants_v0101.txt"
))
...
...
@@ -102,7 +102,7 @@ class FastqcV0101Test extends TestNGSuite with Matchers {
}
@Test
def
testPerBaseSequenceQuality
()
=
{
@Test
def
testPerBaseSequenceQuality
()
:
Unit
=
{
val
fqc
=
new
Fastqc
(
null
)
fqc
.
output
=
outputv0101
...
...
@@ -111,7 +111,7 @@ class FastqcV0101Test extends TestNGSuite with Matchers {
perBaseSequenceQuality
.
keys
should
contain
(
"54-55"
)
}
@Test
def
testPerBaseSequenceContent
()
=
{
@Test
def
testPerBaseSequenceContent
()
:
Unit
=
{
val
fqc
=
new
Fastqc
(
null
)
fqc
.
output
=
outputv0101
...
...
@@ -120,7 +120,7 @@ class FastqcV0101Test extends TestNGSuite with Matchers {
perBaseSequenceContent
.
keys
should
contain
(
"1"
)
}
@Test
def
testSummaryStats
()
=
{
@Test
def
testSummaryStats
()
:
Unit
=
{
val
fqc
=
new
Fastqc
(
null
)
fqc
.
output
=
outputv0101
val
summary
=
fqc
.
summaryStats
...
...
gears/src/main/resources/nl/lumc/sasc/biopet/pipelines/gears/gearsSingleFront.ssp
View file @
caf71f04
...
...
@@ -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/>
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/ExtractUnmappedReads.scala
View file @
caf71f04
...
...
@@ -43,7 +43,7 @@ class ExtractUnmappedReads(val parent: Configurable) extends QScript with Biopet
}
def
fastqUnmappedR1
=
new
File
(
outputDir
,
s
"$outputName.unmapped.R1.fq.gz"
)
def
fastqUnmappedR2
=
def
fastqUnmappedR2
:
Option
[
File
]
=
if
(
paired
)
Some
(
new
File
(
outputDir
,
s
"$outputName.unmapped.R2.fq.gz"
))
else
None
def
fastqUnmappedSingletons
=
new
File
(
outputDir
,
s
"$outputName.unmapped.singletons.fq.gz"
)
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
View file @
caf71f04
...
...
@@ -30,7 +30,7 @@ import org.broadinstitute.gatk.queue.QScript
class
Gears
(
val
parent
:
Configurable
)
extends
QScript
with
MultiSampleQScript
{
qscript
=>
def
this
()
=
this
(
null
)
override
def
reportClass
=
{
override
def
reportClass
:
Some
[
GearsReport
]
=
{
val
gearsReport
=
new
GearsReport
(
this
)
gearsReport
.
outputDir
=
new
File
(
outputDir
,
"report"
)
gearsReport
.
summaryDbFile
=
summaryDbFile
...
...
@@ -143,7 +143,8 @@ class Gears(val parent: Configurable) extends QScript with MultiSampleQScript {
lazy
val
skipFlexiprep
:
Boolean
=
config
(
"skip_flexiprep"
,
default
=
false
)
lazy
val
flexiprep
=
if
(
skipFlexiprep
)
None
else
Some
(
new
Flexiprep
(
qscript
))
lazy
val
flexiprep
:
Option
[
Flexiprep
]
=
if
(
skipFlexiprep
)
None
else
Some
(
new
Flexiprep
(
qscript
))
flexiprep
.
foreach
(
_
.
sampleId
=
Some
(
sampleId
))
flexiprep
.
foreach
(
_
.
libId
=
Some
(
libId
))
flexiprep
.
foreach
(
_
.
inputR1
=
inputR1
)
...
...
@@ -155,7 +156,8 @@ class Gears(val parent: Configurable) extends QScript with MultiSampleQScript {
val
libraryGears
:
Boolean
=
config
(
"library_gears"
,
default
=
false
)
lazy
val
gearsSingle
=
if
(
libraryGears
)
Some
(
new
GearsSingle
(
qscript
))
else
None
lazy
val
gearsSingle
:
Option
[
GearsSingle
]
=
if
(
libraryGears
)
Some
(
new
GearsSingle
(
qscript
))
else
None
/** Function that add library jobs */
protected
def
addJobs
()
:
Unit
=
{
...
...
@@ -189,8 +191,6 @@ class Gears(val parent: Configurable) extends QScript with MultiSampleQScript {
protected
def
addJobs
()
:
Unit
=
{
addPerLibJobs
()
val
flexipreps
=
libraries
.
values
.
map
(
_
.
flexiprep
).
toList
val
mergeR1
:
File
=
new
File
(
sampleDir
,
s
"$sampleId.R1.fq.gz"
)
add
(
Zcat
(
qscript
,
libraries
.
values
.
map
(
_
.
qcR1
).
toList
)
|
new
Gzip
(
qscript
)
>
mergeR1
)
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsKraken.scala
View file @
caf71f04
...
...
@@ -132,7 +132,7 @@ object GearsKraken {
val
taxs
:
mutable.Map
[
String
,
Any
]
=
mutable
.
Map
()
def
addTax
(
map
:
Map
[
String
,
Any
],
path
:
List
[
String
]
=
Nil
)
:
Unit
=
{
val
name
=
map
.
get
(
"name"
).
getOrElse
(
"noName"
).
toString
val
name
=
map
.
get
OrElse
(
"name"
,
"noName"
).
toString
val
x
=
path
.
foldLeft
(
taxs
)(
(
a
,
b
)
=>
if
(
a
.
contains
(
b
))
a
(
b
).
asInstanceOf
[
mutable.Map
[
String
,
Any
]]
...
...
@@ -144,20 +144,18 @@ object GearsKraken {
if
(!
x
.
contains
(
name
))
x
+=
name
->
mutable
.
Map
[
String
,
Any
]()
map
.
get
(
"children"
)
.
getOrElse
(
List
())
.
getOrElse
(
"children"
,
List
())
.
asInstanceOf
[
List
[
Any
]]
.
foreach
(
x
=>
addTax
(
x
.
asInstanceOf
[
Map
[
String
,
Any
]],
path
:::
name
::
Nil
))
}
summaries
.
foreach
{
x
=>
addTax
(
x
.
_2
.
get
(
"classified"
).
getOrElse
(
Map
()).
asInstanceOf
[
Map
[
String
,
Any
]])
addTax
(
x
.
_2
.
get
OrElse
(
"classified"
,
Map
()).
asInstanceOf
[
Map
[
String
,
Any
]])
}
def
getValue
(
sample
:
String
,
path
:
List
[
String
],
key
:
String
)
=
{
path
.
foldLeft
(
summaries
(
sample
).
get
(
"classified"
).
getOrElse
(
Map
()).
asInstanceOf
[
Map
[
String
,
Any
]])
{
.
foldLeft
(
summaries
(
sample
).
getOrElse
(
"classified"
,
Map
()).
asInstanceOf
[
Map
[
String
,
Any
]])
{
(
b
,
a
)
=>
b
.
getOrElse
(
"children"
,
List
[
Map
[
String
,
Any
]]())
.
asInstanceOf
[
List
[
Map
[
String
,
Any
]]]
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsQiimeClosed.scala
View file @
caf71f04
...
...
@@ -44,18 +44,18 @@ class GearsQiimeClosed(val parent: Configurable)
)
)
def
init
()
=
{
def
init
()
:
Unit
=
{
require
(
fastqInput
!=
null
)
require
(
sampleId
.
isDefined
)
}
private
var
_otuMap
:
File
=
_
def
otuMap
=
_otuMap
def
otuMap
:
File
=
_otuMap
private
var
_otuTable
:
File
=
_
def
otuTable
=
_otuTable
def
otuTable
:
File
=
_otuTable
def
biopetScript
()
=
{
def
biopetScript
()
:
Unit
=
{
val
splitLib
=
new
SplitLibrariesFastq
(
this
)
splitLib
.
input
:+=
fastqInput
...
...
@@ -149,7 +149,7 @@ object GearsQiimeClosed {
biom
(
"data"
)
.
asInstanceOf
[
List
[
List
[
Any
]]]
.
map
{
data
=>
val
row
=
data
(
0
)
.
asInstanceOf
[
Long
]
val
row
=
data
.
head
.
asInstanceOf
[
Long
]
val
column
=
data
(
1
).
asInstanceOf
[
Long
]
val
value
=
data
(
2
).
asInstanceOf
[
Long
]
val
sample
=
samples
(
column
.
toInt
).
toString
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsQiimeOpen.scala
View file @
caf71f04
...
...
@@ -37,18 +37,18 @@ class GearsQiimeOpen(val parent: Configurable)
)
)
def
init
()
=
{
def
init
()
:
Unit
=
{
require
(
fastqInput
!=
null
)
require
(
sampleId
.
isDefined
)
}
private
var
_otuMap
:
File
=
_
def
otuMap
=
_otuMap
def
otuMap
:
File
=
_otuMap
private
var
_otuTable
:
File
=
_
def
otuTable
=
_otuTable
def
otuTable
:
File
=
_otuTable
def
biopetScript
()
=
{
def
biopetScript
()
:
Unit
=
{
val
splitLib
=
new
SplitLibrariesFastq
(
this
)
splitLib
.
input
:+=
fastqInput
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsQiimeRtax.scala
View file @
caf71f04
...
...
@@ -58,11 +58,11 @@ class GearsQiimeRtax(val parent: Configurable)
)
)
def
init
()
=
{
def
init
()
:
Unit
=
{
require
(
fastqR1
!=
null
)
}
def
biopetScript
()
=
{
def
biopetScript
()
:
Unit
=
{
val
slfR1
=
new
SplitLibrariesFastq
(
this
)
slfR1
.
input
:+=
fastqR1
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsReport.scala
View file @
caf71f04
...
...
@@ -16,13 +16,14 @@ package nl.lumc.sasc.biopet.pipelines.gears
import
java.io.File
import
nl.lumc.sasc.biopet.core.report.
{
MultisampleReportBuilder
,
ReportBuilderExtension
,
ReportPage
,
ReportSection
}
import
nl.lumc.sasc.biopet.core.report.
{
MultisampleReportBuilder
,
ReportBuilderExtension
,
ReportPage
,
ReportSection
}
import
nl.lumc.sasc.biopet.pipelines.flexiprep.FlexiprepReport
import
nl.lumc.sasc.biopet.pipelines.gears
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._
import
nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.
{
NoLibrary
,
NoModule
,
SampleId
}
import
nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.
{
NoLibrary
,
NoModule
,
SampleId
}
import
scala.concurrent.
{
Await
,
Future
}
import
scala.concurrent.
{
Await
,
Future
}
import
scala.concurrent.duration.Duration
/**
...
...
@@ -40,7 +41,7 @@ object GearsReport extends MultisampleReportBuilder {
def
reportName
=
"Gears Report"
override
def
extFiles
=
super
.
extFiles
++
List
(
"js/gears.js"
,
"js/krona-2.0.js"
,
"img/krona/loading.gif"
,
"img/krona/hidden.png"
,
"img/krona/favicon.ico"
)
override
def
extFiles
:
List
[
gears.GearsReport.ExtFile
]
=
super
.
extFiles
++
List
(
"js/gears.js"
,
"js/krona-2.0.js"
,
"img/krona/loading.gif"
,
"img/krona/hidden.png"
,
"img/krona/favicon.ico"
)
.
map
(
x
=>
ExtFile
(
"/nl/lumc/sasc/biopet/pipelines/gears/report/ext/"
+
x
,
x
))
def
indexPage
:
Future
[
ReportPage
]
=
Future
{
...
...
@@ -51,29 +52,29 @@ object GearsReport extends MultisampleReportBuilder {
val
qiimeClosesOtuTable
=
summary
.
getFile
(
runId
,
"gears"
,
key
=
"qiime_closed_otu_table"
)
val
qiimeOpenOtuTable
=
summary
.
getFile
(
runId
,
"gears"
,
key
=
"qiime_open_otu_table"
)
val
centrifugePage
=
(
if
(
centrifugeExecuted
)
Some
(
"Centrifuge analysis"
->
Future
.
successful
(
ReportPage
(
List
(
"Non-unique"
->
val
centrifugePage
=
if
(
centrifugeExecuted
)
Some
(
"Centrifuge analysis"
->
Future
.
successful
(
ReportPage
(
List
(
"Non-unique"
->
Future
.
successful
(
ReportPage
(
List
(),
List
(
"All mappings"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
,
Map
(
"summaryStatsTag"
->
"centrifuge_report"
)
)),
Map
()))),
List
(
"Unique mappings"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
,
Map
(
"summaryStatsTag"
->
"centrifuge_unique_report"
)
)),
Map
(
"summaryModuleTag"
->
"gearscentrifuge"
,
"centrifugeTag"
->
Some
(
"centrifuge"
)))))
else
None
)
else
None
val
krakenPage
=
(
if
(
krakenExecuted
)
Some
(
"Kraken analysis"
->
Future
.
successful
(
ReportPage
(
List
(),
List
(
val
krakenPage
=
if
(
krakenExecuted
)
Some
(
"Kraken analysis"
->
Future
.
successful
(
ReportPage
(
List
(),
List
(
"Krona plot"
->
Future
.
successful
(
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp"
))),
Map
())))
else
None
)
else
None
val
qiimeClosedPage
=
(
if
(
qiimeClosesOtuTable
.
isDefined
)
Some
(
"Qiime closed reference analysis"
->
Future
.
successful
(
ReportPage
(
List
(),
List
(
val
qiimeClosedPage
=
if
(
qiimeClosesOtuTable
.
isDefined
)
Some
(
"Qiime closed reference analysis"
->
Future
.
successful
(
ReportPage
(
List
(),
List
(
"Krona plot"
->
Future
.
successful
(
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/gears/qiimeKrona.ssp"
))),
Map
(
"biomFile"
->
new
File
(
run
.
outputDir
+
File
.
separator
+
qiimeClosesOtuTable
.
get
.
path
)))))
else
None
)
else
None
val
qiimeOpenPage
=
(
if
(
qiimeOpenOtuTable
.
isDefined
)
Some
(
"Qiime open reference analysis"
->
Future
.
successful
(
ReportPage
(
List
(),
List
(
val
qiimeOpenPage
=
if
(
qiimeOpenOtuTable
.
isDefined
)
Some
(
"Qiime open reference analysis"
->
Future
.
successful
(
ReportPage
(
List
(),
List
(
"Krona plot"
->
ReportSection
(
"/nl/lumc/sasc/biopet/pipelines/gears/qiimeKrona.ssp"
)),
Map
(
"biomFile"
->
new
File
(
run
.
outputDir
+
File
.
separator
+
qiimeOpenOtuTable
.
get
.
path
)))))
else
None
)
else
None
ReportPage
(
List
(
centrifugePage
,
krakenPage
,
qiimeClosedPage
,
qiimeOpenPage
).
flatten
:::
List
(
...
...
@@ -124,8 +125,6 @@ object GearsReport extends MultisampleReportBuilder {
/** Library page */
def
libraryPage
(
sampleId
:
Int
,
libId
:
Int
,
args
:
Map
[
String
,
Any
])
:
Future
[
ReportPage
]
=
Future
{
val
sName
=
Await
.
result
(
summary
.
getSampleName
(
sampleId
),
Duration
.
Inf
)
val
lName
=
Await
.
result
(
summary
.
getLibraryName
(
libId
),
Duration
.
Inf
)
val
flexiprepExecuted
=
Await
.
result
(
summary
.
getStatsSize
(
runId
,
"flexiprep"
,
sample
=
sampleId
,
library
=
libId
),
Duration
.
Inf
)
>=
1
...
...
gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsSeqCount.scala
View file @
caf71f04
...
...
@@ -30,7 +30,7 @@ class GearsSeqCount(val parent: Configurable)
var
fastqInput
:
File
=
_
def
countFile
=
swapExt
(
outputDir
,
fastqInput
,
".fastq.gz"
,
".counts.txt"
)
def
countFile
:
File
=
swapExt
(
outputDir
,
fastqInput
,
".fastq.gz"
,
".counts.txt"
)
/** Init for pipeline */
def
init
()
:
Unit
=
{}
...
...
Prev
1
2
3
4
5
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