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

Fixed report issues

parent de357a4f
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
#for (sample <- samples.toList.sorted) #for (sample <- samples.toList.sorted)
<tr><td><a href="${rootPath}Samples/${sample}/index.html">${sample}</a></td> <tr><td><a href="${rootPath}Samples/${sample}/index.html">${sample}</a></td>
#for (field <- fields) #for (field <- fields)
<td>${summary.getSampleValue(sample, "shivavariantcalling", "stats", vcfstatsKey, "genotype", field)}</td> <td>${summary.getValue("shivavariantcalling", "stats", vcfstatsKey, "total", "genotype", "general", sample, field)}</td>
#end #end
</tr> </tr>
#end #end
......
...@@ -139,15 +139,15 @@ trait ShivaReportTrait extends MultisampleMappingReportTrait { ...@@ -139,15 +139,15 @@ trait ShivaReportTrait extends MultisampleMappingReportTrait {
if (libraryLevel) tsvWriter.print("Library") else tsvWriter.print("Sample") if (libraryLevel) tsvWriter.print("Library") else tsvWriter.print("Sample")
tsvWriter.println("\tHomVar\tHet\tHomRef\tNoCall") tsvWriter.println("\tHomVar\tHet\tHomRef\tNoCall")
def getLine(summary: Summary, sample: String, lib: Option[String] = None): String = { def getLine(summary: Summary, sample: String, summarySample: Option[String], lib: Option[String] = None): String = {
val path = target match { val path = target match {
case Some(t) => List("shivavariantcalling", "stats", s"multisample-vcfstats-$caller-$t", "genotype") case Some(t) => List("shivavariantcalling", "stats", s"multisample-vcfstats-$caller-$t", "genotype", sample)
case _ => List("shivavariantcalling", "stats", s"multisample-vcfstats-$caller", "genotype") case _ => List("shivavariantcalling", "stats", s"multisample-vcfstats-$caller", "total", "genotype", "general", sample)
} }
val homVar = new SummaryValue(path :+ "HomVar", summary, Some(sample), lib).value.getOrElse(0).toString.toLong val homVar = new SummaryValue(path :+ "HomVar", summary, summarySample, lib).value.getOrElse(0).toString.toLong
val homRef = new SummaryValue(path :+ "HomRef", summary, Some(sample), lib).value.getOrElse(0).toString.toLong val homRef = new SummaryValue(path :+ "HomRef", summary, summarySample, lib).value.getOrElse(0).toString.toLong
val noCall = new SummaryValue(path :+ "NoCall", summary, Some(sample), lib).value.getOrElse(0).toString.toLong val noCall = new SummaryValue(path :+ "NoCall", summary, summarySample, lib).value.getOrElse(0).toString.toLong
val het = new SummaryValue(path :+ "Het", summary, Some(sample), lib).value.getOrElse(0).toString.toLong val het = new SummaryValue(path :+ "Het", summary, summarySample, lib).value.getOrElse(0).toString.toLong
val sb = new StringBuffer() val sb = new StringBuffer()
if (lib.isDefined) sb.append(sample + "-" + lib.get + "\t") else sb.append(sample + "\t") if (lib.isDefined) sb.append(sample + "-" + lib.get + "\t") else sb.append(sample + "\t")
sb.append(homVar + "\t") sb.append(homVar + "\t")
...@@ -162,11 +162,11 @@ trait ShivaReportTrait extends MultisampleMappingReportTrait { ...@@ -162,11 +162,11 @@ trait ShivaReportTrait extends MultisampleMappingReportTrait {
sample <- summary.samples if sampleId.isEmpty || sample == sampleId.get; sample <- summary.samples if sampleId.isEmpty || sample == sampleId.get;
lib <- summary.libraries(sample) lib <- summary.libraries(sample)
) { ) {
tsvWriter.println(getLine(summary, sample, Some(lib))) tsvWriter.println(getLine(summary, sample, sampleId, Some(lib)))
} }
} else { } else {
for (sample <- summary.samples if sampleId.isEmpty || sample == sampleId.get) { for (sample <- summary.samples if sampleId.isEmpty || sample == sampleId.get) {
tsvWriter.println(getLine(summary, sample)) tsvWriter.println(getLine(summary, sample, sampleId))
} }
} }
......
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