Commit 54219bcb authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Fix insertsize plots

parent cd4a8f4c
...@@ -61,7 +61,11 @@ object BammetricsReport extends ReportBuilder { ...@@ -61,7 +61,11 @@ object BammetricsReport extends ReportBuilder {
val wgsExecuted = summary.getValue(sampleId, libId, metricsTag, "stats", "wgs").isDefined val wgsExecuted = summary.getValue(sampleId, libId, metricsTag, "stats", "wgs").isDefined
val rnaExecuted = summary.getValue(sampleId, libId, metricsTag, "stats", "rna").isDefined val rnaExecuted = summary.getValue(sampleId, libId, metricsTag, "stats", "rna").isDefined
val insertsizeMetrics = summary.getValue(sampleId, libId, metricsTag, "stats", "CollectInsertSizeMetrics", "metrics").isDefined val insertsizeMetrics = summary.getValue(sampleId, libId, metricsTag, "stats", "CollectInsertSizeMetrics", "metrics") match {
case Some(None) => false
case Some(_) => true
case _ => false
}
val targets = ( val targets = (
summary.getValue(sampleId, libId, metricsTag, "settings", "amplicon_name"), summary.getValue(sampleId, libId, metricsTag, "settings", "amplicon_name"),
...@@ -81,7 +85,8 @@ object BammetricsReport extends ReportBuilder { ...@@ -81,7 +85,8 @@ object BammetricsReport extends ReportBuilder {
List( List(
"Summary" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp")) ++ "Summary" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/alignmentSummary.ssp")) ++
(if (insertsizeMetrics) List("Insert Size" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/insertSize.ssp", Map("showPlot" -> true)) (if (insertsizeMetrics) List("Insert Size" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/insertSize.ssp", Map("showPlot" -> true))
) else Nil) ++ (if (wgsExecuted) List("Whole genome coverage" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/wgsHistogram.ssp", )
else Nil) ++ (if (wgsExecuted) List("Whole genome coverage" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/wgsHistogram.ssp",
Map("showPlot" -> true))) Map("showPlot" -> true)))
else Nil) ++ else Nil) ++
(if (rnaExecuted) List("Rna coverage" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/rnaHistogram.ssp", (if (rnaExecuted) List("Rna coverage" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/rnaHistogram.ssp",
......
...@@ -4,7 +4,7 @@ import java.io.File ...@@ -4,7 +4,7 @@ import java.io.File
import java.nio.file.Paths import java.nio.file.Paths
import com.google.common.io.Files import com.google.common.io.Files
import htsjdk.samtools.{SAMReadGroupRecord, SAMSequenceRecord, SAMLineParser, SAMFileHeader} import htsjdk.samtools.{ SAMReadGroupRecord, SAMSequenceRecord, SAMLineParser, SAMFileHeader }
import org.scalatest.Matchers import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test import org.testng.annotations.Test
...@@ -13,8 +13,8 @@ import picard.annotation.Gene ...@@ -13,8 +13,8 @@ import picard.annotation.Gene
import scala.collection.JavaConversions._ import scala.collection.JavaConversions._
/** /**
* Created by pjvan_thof on 1/29/16. * Created by pjvan_thof on 1/29/16.
*/ */
class BaseCounterTest extends TestNGSuite with Matchers { class BaseCounterTest extends TestNGSuite with Matchers {
import BaseCounter._ import BaseCounter._
...@@ -55,7 +55,7 @@ class BaseCounterTest extends TestNGSuite with Matchers { ...@@ -55,7 +55,7 @@ class BaseCounterTest extends TestNGSuite with Matchers {
bamRecordBasesOverlap(read, 60, 70) shouldBe 0 bamRecordBasesOverlap(read, 60, 70) shouldBe 0
} }
@Test @Test
def testBamRecordBasesOverlap(): Unit = { def testBamRecordBasesOverlap(): Unit = {
val read = BaseCounterTest.lineParser.parseLine("r02\t0\tchrQ\t50\t60\t10M\t*\t0\t0\tTACGTACGTA\tEEFFGGHHII\tRG:Z:001") val read = BaseCounterTest.lineParser.parseLine("r02\t0\tchrQ\t50\t60\t10M\t*\t0\t0\tTACGTACGTA\tEEFFGGHHII\tRG:Z:001")
bamRecordBasesOverlap(read, 40, 70) shouldBe 10 bamRecordBasesOverlap(read, 40, 70) shouldBe 10
......
...@@ -28,7 +28,7 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder { ...@@ -28,7 +28,7 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
val wgsExecuted = summary.getSampleValues("bammetrics", "stats", "wgs").values.exists(_.isDefined) val wgsExecuted = summary.getSampleValues("bammetrics", "stats", "wgs").values.exists(_.isDefined)
val rnaExecuted = summary.getSampleValues("bammetrics", "stats", "rna").values.exists(_.isDefined) val rnaExecuted = summary.getSampleValues("bammetrics", "stats", "rna").values.exists(_.isDefined)
val insertsizeExecuted = summary.getSampleValues("bammetrics", "stats", "CollectInsertSizeMetrics", "metrics").values.exists(_.isDefined) val insertsizeExecuted = summary.getSampleValues("bammetrics", "stats", "CollectInsertSizeMetrics", "metrics").values.exists(_ != Some(None))
val flexiprepExecuted = summary.getLibraryValues("flexiprep") val flexiprepExecuted = summary.getLibraryValues("flexiprep")
.exists { case ((sample, lib), value) => value.isDefined } .exists { case ((sample, lib), value) => value.isDefined }
...@@ -47,7 +47,8 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder { ...@@ -47,7 +47,8 @@ trait MultisampleMappingReportTrait extends MultisampleReportBuilder {
Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false) Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false)
)) ++ )) ++
(if (insertsizeExecuted) List("Insert Size" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/insertSize.ssp", (if (insertsizeExecuted) List("Insert Size" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/insertSize.ssp",
Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false)))else Nil) ++ Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false)))
else Nil) ++
(if (wgsExecuted) List("Whole genome coverage" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/wgsHistogram.ssp", (if (wgsExecuted) List("Whole genome coverage" -> ReportSection("/nl/lumc/sasc/biopet/pipelines/bammetrics/wgsHistogram.ssp",
Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false))) Map("sampleLevel" -> true, "showPlot" -> true, "showTable" -> false)))
else Nil) ++ else Nil) ++
......
Supports Markdown
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