Skip to content
Snippets Groups Projects
Commit 211b5e18 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added merge output of qiimeClosed

parent 233d9a9b
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,16 @@ class Gears(val root: Configurable) extends QScript with MultiSampleQScript { qs ...@@ -36,6 +36,16 @@ class Gears(val root: Configurable) extends QScript with MultiSampleQScript { qs
addSummaryJobs() addSummaryJobs()
} }
def qiimeClosedDir: Option[File] = {
if (samples.values.flatMap(_.gs.qiimeClosed).nonEmpty) {
Some(new File(outputDir, "qiime_closed_reference"))
} else None
}
def qiimeClosedOtuTable: Option[File] = qiimeClosedDir.map(new File(_, "otu_table.biom"))
def qiimeClosedOtuMap: Option[File] = qiimeClosedDir.map(new File(_, "otu_map.txt"))
/** /**
* Method where the multisample jobs should be added, this will be executed only when running the -sample argument is not given. * Method where the multisample jobs should be added, this will be executed only when running the -sample argument is not given.
*/ */
...@@ -45,24 +55,20 @@ class Gears(val root: Configurable) extends QScript with MultiSampleQScript { qs ...@@ -45,24 +55,20 @@ class Gears(val root: Configurable) extends QScript with MultiSampleQScript { qs
val closedOtuMaps = gss.map(_.otuMap) val closedOtuMaps = gss.map(_.otuMap)
require(closedOtuTables.size == closedOtuMaps.size) require(closedOtuTables.size == closedOtuMaps.size)
if (closedOtuTables.nonEmpty) { if (closedOtuTables.nonEmpty) {
val closedDir = new File(outputDir, "qiime_closed_reference")
val closedOtuTable = new File(closedDir, "otu_table.biom")
val closedOtuMap = new File(closedDir, "otu_map.txt")
if (closedOtuTables.size > 1) { if (closedOtuTables.size > 1) {
val mergeTables = new MergeOtuTables(qscript) val mergeTables = new MergeOtuTables(qscript)
mergeTables.input = closedOtuTables mergeTables.input = closedOtuTables
mergeTables.outputFile = closedOtuTable mergeTables.outputFile = qiimeClosedOtuTable.get
add(mergeTables) add(mergeTables)
val mergeMaps = new MergeOtuMaps(qscript) val mergeMaps = new MergeOtuMaps(qscript)
mergeMaps.input = closedOtuMaps mergeMaps.input = closedOtuMaps
mergeMaps.output = closedOtuMap mergeMaps.output = qiimeClosedOtuMap.get
add(mergeMaps) add(mergeMaps)
} else { } else {
add(Ln(qscript, closedOtuMaps.head, closedOtuMap)) add(Ln(qscript, closedOtuMaps.head, qiimeClosedOtuMap.get))
add(Ln(qscript, closedOtuTables.head, closedOtuTable)) add(Ln(qscript, closedOtuTables.head, qiimeClosedOtuTable.get))
} }
//TODO: Plots //TODO: Plots
...@@ -149,7 +155,10 @@ class Gears(val root: Configurable) extends QScript with MultiSampleQScript { qs ...@@ -149,7 +155,10 @@ class Gears(val root: Configurable) extends QScript with MultiSampleQScript { qs
def summarySettings: Map[String, Any] = Map() def summarySettings: Map[String, Any] = Map()
/** File to put in the summary for thie pipeline */ /** File to put in the summary for thie pipeline */
def summaryFiles: Map[String, File] = Map() def summaryFiles: Map[String, File] = (
qiimeClosedOtuTable.map("qiime_closed_otu_table" -> _) ++
qiimeClosedOtuMap.map("qiime_closed_otu_map" -> _)
).toMap
} }
object Gears extends PipelineCommand object Gears extends PipelineCommand
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment