Commit 1b673dfa authored by Wai Yi Leung's avatar Wai Yi Leung

Fixes for the comments made in the ticket #241

parent a464f561
......@@ -15,7 +15,7 @@
*/
package nl.lumc.sasc.biopet
import nl.lumc.sasc.biopet.utils.{ BiopetExecutable, MainCommand }
import nl.lumc.sasc.biopet.utils.{BiopetExecutable, MainCommand}
object BiopetToolsExecutable extends BiopetExecutable {
......@@ -44,6 +44,5 @@ object BiopetToolsExecutable extends BiopetExecutable {
nl.lumc.sasc.biopet.tools.SeqStat,
nl.lumc.sasc.biopet.tools.VepNormalizer,
nl.lumc.sasc.biopet.tools.AnnotateVcfWithBed,
nl.lumc.sasc.biopet.tools.VcfWithVcf,
nl.lumc.sasc.biopet.tools.KrakenReportToJson)
nl.lumc.sasc.biopet.tools.VcfWithVcf)
}
......@@ -19,7 +19,7 @@ package nl.lumc.sasc.biopet.tools
* Created by wyleung on 25-9-15.
*/
import java.io.{ File, PrintWriter }
import java.io.{File, PrintWriter}
import nl.lumc.sasc.biopet.utils.ConfigUtils._
import nl.lumc.sasc.biopet.utils.ToolCommand
......@@ -28,30 +28,30 @@ import scala.collection.mutable
import scala.collection.mutable.ListBuffer
import scala.io.Source
case class KrakenHit(taxonomyID: Long,
taxonomyName: String,
cladeCount: Long,
cladeSize: Long, // size of parent - including itself
taxonRank: String,
cladeLevel: Int,
parentTaxonomyID: Long,
children: ListBuffer[KrakenHit]) {
def toJSON(withChildren: Boolean = false): Map[String, Any] = {
val childJSON = if (withChildren) children.toList.map(entry => entry.toJSON(withChildren)) else List()
Map(
"name" -> taxonomyName,
"taxid" -> taxonomyID,
"taxonrank" -> taxonRank,
"cladelevel" -> cladeLevel,
"count" -> cladeCount,
"size" -> cladeSize,
"children" -> childJSON
)
}
object KrakenReportToJson extends ToolCommand {
}
case class KrakenHit(taxonomyID: Long,
taxonomyName: String,
cladeCount: Long,
cladeSize: Long, // size of parent - including itself
taxonRank: String,
cladeLevel: Int,
parentTaxonomyID: Long,
children: ListBuffer[KrakenHit]) {
def toJSON(withChildren: Boolean = false): Map[String, Any] = {
val childJSON = if (withChildren) children.toList.map(entry => entry.toJSON(withChildren)) else List()
Map(
"name" -> taxonomyName,
"taxid" -> taxonomyID,
"taxonrank" -> taxonRank,
"cladelevel" -> cladeLevel,
"count" -> cladeCount,
"size" -> cladeSize,
"children" -> childJSON
)
}
object KrakenReportToJson extends ToolCommand {
}
var cladeIDs: mutable.ArrayBuffer[Long] = mutable.ArrayBuffer.fill(32)(0)
val spacePattern = "^( +)".r
......
......@@ -15,19 +15,19 @@
*/
package nl.lumc.sasc.biopet.pipelines.gears
import nl.lumc.sasc.biopet.core.PipelineCommand
import nl.lumc.sasc.biopet.core.summary.SummaryQScript
import nl.lumc.sasc.biopet.extensions.kraken.{ Kraken, KrakenReport }
import nl.lumc.sasc.biopet.core.{PipelineCommand, SampleLibraryTag}
import nl.lumc.sasc.biopet.extensions.kraken.{Kraken, KrakenReport}
import nl.lumc.sasc.biopet.extensions.picard.SamToFastq
import nl.lumc.sasc.biopet.extensions.sambamba.SambambaView
import nl.lumc.sasc.biopet.extensions.tools.{ FastqSync, KrakenReportToJson }
import nl.lumc.sasc.biopet.extensions.tools.{FastqSync, KrakenReportToJson}
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript
/**
* Created by wyleung
*/
class Gears(val root: Configurable) extends QScript with SummaryQScript {
class Gears(val root: Configurable) extends QScript with SummaryQScript with SampleLibraryTag {
def this() = this(null)
@Input(doc = "R1 reads in FastQ format", shortName = "R1", required = false)
......@@ -145,12 +145,10 @@ class Gears(val root: Configurable) extends QScript with SummaryQScript {
}
/** Location of summary file */
def summaryFile = new File(outputDir, "gears.summary.json")
def summaryFile = new File(outputDir, sampleId.getOrElse("x") + "-" + libId.getOrElse("x") + ".gears.summary.json")
/** Pipeline settings shown in the summary file */
def summarySettings: Map[String, Any] = Map.empty ++
(if (bamFile.isDefined) Map("input_bam" -> bamFile.get) else Map()) ++
(if (fastqR1.isDefined) Map("input_R1" -> fastqR1.get) else Map())
def summarySettings: Map[String, Any] = Map.empty
/** Statistics shown in the summary file */
def summaryFiles: Map[String, File] = Map.empty ++
......
package nl.lumc.sasc.biopet.pipelines.gears
import java.io.{ PrintWriter, File }
import nl.lumc.sasc.biopet.core.report.MultisampleReportBuilder
import nl.lumc.sasc.biopet.core.report.ReportBuilderExtension
import nl.lumc.sasc.biopet.core.report.ReportPage
import nl.lumc.sasc.biopet.core.report.ReportSection
import nl.lumc.sasc.biopet.core.report._
import nl.lumc.sasc.biopet.utils.config.Configurable
class GearsReport(val root: Configurable) extends ReportBuilderExtension {
val builder = GearsReport
override val defaultCoreMemory = 3.0
}
object GearsReport extends MultisampleReportBuilder {
object GearsReport extends ReportBuilder {
// FIXME: Not yet finished
// TODO: Summary all: Add summary (sunflare plot)
// TODO: Sample specific: Add summary (sunflare plot)
// TODO: Add dusbin analysis (aggregated)
// TODO: Add dustbin analysis (aggregated)
// TODO: Add alignment stats per sample for the dustbin analysis
def indexPage = {
ReportPage(
List("Samples" -> generateSamplesPage(pageArgs)) ++
List() ++
Map(
"Versions" -> ReportPage(List(), List((
"Executables" -> ReportSection("/nl/lumc/sasc/biopet/core/report/executables.ssp"
......@@ -38,16 +30,6 @@ object GearsReport extends MultisampleReportBuilder {
)
}
def samplePage(sampleId: String, args: Map[String, Any]) = {
ReportPage(List(), List(
"Sunburst analysis" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/gears/gearsSunburst.ssp")
), args)
}
def libraryPage(sampleId: String, libId: String, args: Map[String, Any]) = {
ReportPage(List(), List(), args)
}
def reportName = "Gears :: Metagenomics Report"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment