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
9a538c59
Commit
9a538c59
authored
Apr 24, 2017
by
pjvan_thof
Browse files
Fixing krona plots for centrifuge and kraken
parent
40109cd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
gears/src/main/resources/nl/lumc/sasc/biopet/pipelines/gears/krakenKrona.ssp
View file @
9a538c59
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb._)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Library)
#import(nl.lumc.sasc.biopet.utils.summary.db.Schema.Sample)
#import(nl.lumc.sasc.biopet.utils.summary.db.SummaryDb.Implicts._)
...
...
@@ -30,14 +31,15 @@
Map("all" -> Nil)
)
val totalReads = if (sampleId.isEmpty) {
centrifugeTag.map {tag => summary.getSampleValues(summaryModuleTag, "stats", tag, "metrics", "Read").map(x => x._1 -> x._2.getOrElse(0L).toString.toLong) }
} else centrifugeTag.flatMap(tag => summary.getValue(sampleId, libId, summaryModuleTag, "stats", tag, "metrics", "Read"))
.map(value => Map(sampleId.get -> value.toString.toLong))
val totalReads = centrifugeTag.map { tag =>
summary.getStatsForSamples(runId, summaryModuleTag, ModuleName(tag), sampleId.map(SummaryDb.SampleId),
Map("total" -> List("metrics", "Read"))
).map(x => allSamples.find(_.id == x._1).head.name -> x._2("total").map(_.toString.toLong).getOrElse(0L))
}
val tempFile = File.createTempFile("krona.", ".xml")
tempFile.deleteOnExit()
GearsKraken.convertKrakenSummariesToKronaXml(summaries, tempFile, totalReads)
GearsKraken.convertKrakenSummariesToKronaXml(summaries
.map(x => allSamples.find(_.id == x._1).head.name -> x._2("all").map(_.asInstanceOf[Map[String, Any]]).getOrElse(Map()))
, tempFile, totalReads)
val output = ReportBuilder.renderTemplate("/nl/lumc/sasc/biopet/core/report/krona.ssp",
args ++ Map("kronaXml" -> tempFile))
...
...
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