Skip to content
Snippets Groups Projects
Commit 1b673dfa authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Fixes for the comments made in the ticket #241

parent a464f561
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
package nl.lumc.sasc.biopet 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 { object BiopetToolsExecutable extends BiopetExecutable {
...@@ -44,6 +44,5 @@ object BiopetToolsExecutable extends BiopetExecutable { ...@@ -44,6 +44,5 @@ object BiopetToolsExecutable extends BiopetExecutable {
nl.lumc.sasc.biopet.tools.SeqStat, nl.lumc.sasc.biopet.tools.SeqStat,
nl.lumc.sasc.biopet.tools.VepNormalizer, nl.lumc.sasc.biopet.tools.VepNormalizer,
nl.lumc.sasc.biopet.tools.AnnotateVcfWithBed, nl.lumc.sasc.biopet.tools.AnnotateVcfWithBed,
nl.lumc.sasc.biopet.tools.VcfWithVcf, nl.lumc.sasc.biopet.tools.VcfWithVcf)
nl.lumc.sasc.biopet.tools.KrakenReportToJson)
} }
...@@ -19,7 +19,7 @@ package nl.lumc.sasc.biopet.tools ...@@ -19,7 +19,7 @@ package nl.lumc.sasc.biopet.tools
* Created by wyleung on 25-9-15. * 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.ConfigUtils._
import nl.lumc.sasc.biopet.utils.ToolCommand import nl.lumc.sasc.biopet.utils.ToolCommand
...@@ -28,30 +28,30 @@ import scala.collection.mutable ...@@ -28,30 +28,30 @@ import scala.collection.mutable
import scala.collection.mutable.ListBuffer import scala.collection.mutable.ListBuffer
import scala.io.Source import scala.io.Source
case class KrakenHit(taxonomyID: Long, object KrakenReportToJson extends ToolCommand {
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
)
}
} 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) var cladeIDs: mutable.ArrayBuffer[Long] = mutable.ArrayBuffer.fill(32)(0)
val spacePattern = "^( +)".r val spacePattern = "^( +)".r
......
...@@ -15,19 +15,19 @@ ...@@ -15,19 +15,19 @@
*/ */
package nl.lumc.sasc.biopet.pipelines.gears 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.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.picard.SamToFastq
import nl.lumc.sasc.biopet.extensions.sambamba.SambambaView 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 nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript import org.broadinstitute.gatk.queue.QScript
/** /**
* Created by wyleung * 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) def this() = this(null)
@Input(doc = "R1 reads in FastQ format", shortName = "R1", required = false) @Input(doc = "R1 reads in FastQ format", shortName = "R1", required = false)
...@@ -145,12 +145,10 @@ class Gears(val root: Configurable) extends QScript with SummaryQScript { ...@@ -145,12 +145,10 @@ class Gears(val root: Configurable) extends QScript with SummaryQScript {
} }
/** Location of summary file */ /** 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 */ /** Pipeline settings shown in the summary file */
def summarySettings: Map[String, Any] = Map.empty ++ 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())
/** Statistics shown in the summary file */ /** Statistics shown in the summary file */
def summaryFiles: Map[String, File] = Map.empty ++ def summaryFiles: Map[String, File] = Map.empty ++
......
package nl.lumc.sasc.biopet.pipelines.gears package nl.lumc.sasc.biopet.pipelines.gears
import java.io.{ PrintWriter, File } import nl.lumc.sasc.biopet.core.report._
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.utils.config.Configurable import nl.lumc.sasc.biopet.utils.config.Configurable
class GearsReport(val root: Configurable) extends ReportBuilderExtension { class GearsReport(val root: Configurable) extends ReportBuilderExtension {
val builder = GearsReport val builder = GearsReport
override val defaultCoreMemory = 3.0
} }
object GearsReport extends MultisampleReportBuilder { object GearsReport extends ReportBuilder {
// FIXME: Not yet finished // FIXME: Not yet finished
// TODO: Summary all: Add summary (sunflare plot)
// TODO: Sample specific: 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 // TODO: Add alignment stats per sample for the dustbin analysis
def indexPage = { def indexPage = {
ReportPage( ReportPage(
List("Samples" -> generateSamplesPage(pageArgs)) ++ List() ++
Map( Map(
"Versions" -> ReportPage(List(), List(( "Versions" -> ReportPage(List(), List((
"Executables" -> ReportSection("/nl/lumc/sasc/biopet/core/report/executables.ssp" "Executables" -> ReportSection("/nl/lumc/sasc/biopet/core/report/executables.ssp"
...@@ -38,16 +30,6 @@ object GearsReport extends MultisampleReportBuilder { ...@@ -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" def reportName = "Gears :: Metagenomics Report"
} }
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