Commit ba7ca1c2 authored by bow's avatar bow
Browse files

Add statistics for 5' - 3' bias

parent a61eed16
......@@ -167,6 +167,7 @@ class StatsControllerSpec extends SentinelServletSpec {
priorResponse.body must /#(idx) /("nBasesIntergenic" -> bePositiveNum)
priorResponse.body must /#(idx) /("median5PrimeBias" -> bePositiveNum)
priorResponse.body must /#(idx) /("median3PrimeBias" -> bePositiveNum)
priorResponse.body must /#(idx) /("median5PrimeTo3PrimeBias" -> bePositiveNum)
priorResponse.body must /#(idx) /("pctChimeras" -> bePositiveNum) iff pairedEnd
priorResponse.body must /#(idx) /("nReadsSingleton" -> bePositiveNum) iff pairedEnd
priorResponse.body must /#(idx) /("nReadsProperPair" -> bePositiveNum) iff pairedEnd
......@@ -742,6 +743,7 @@ class StatsControllerSpec extends SentinelServletSpec {
priorResponse.body must /("maxInsertSize") /("nDataPoints" -> nPairedSample)
priorResponse.body must /("median3PrimeBias") /("nDataPoints" -> (nSingleSample + nPairedSample))
priorResponse.body must /("median5PrimeBias") /("nDataPoints" -> (nSingleSample + nPairedSample))
priorResponse.body must /("median5PrimeTo3PrimeBias") /("nDataPoints" -> (nSingleSample + nPairedSample))
priorResponse.body must /("medianInsertSize") /("nDataPoints" -> nPairedSample)
priorResponse.body must /("nBasesAligned") /("nDataPoints" -> (nSingleSample + nPairedSample))
priorResponse.body must /("nBasesCoding") /("nDataPoints" -> (nSingleSample + nPairedSample))
......@@ -787,6 +789,7 @@ class StatsControllerSpec extends SentinelServletSpec {
priorResponse.body must /("maxInsertSize") /("nDataPoints" -> nPairedLib)
priorResponse.body must /("median3PrimeBias") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("median5PrimeBias") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("median5PrimeTo3PrimeBias") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("medianInsertSize") /("nDataPoints" -> nPairedLib)
priorResponse.body must /("nBasesAligned") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("nBasesCoding") /("nDataPoints" -> (nSingleLib + nPairedLib))
......@@ -832,6 +835,7 @@ class StatsControllerSpec extends SentinelServletSpec {
priorResponse.body must /("maxInsertSize") /("nDataPoints" -> nPairedLib)
priorResponse.body must /("median3PrimeBias") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("median5PrimeBias") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("median5PrimeTo3PrimeBias") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("medianInsertSize") /("nDataPoints" -> nPairedLib)
priorResponse.body must /("nBasesAligned") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("nBasesCoding") /("nDataPoints" -> (nSingleLib + nPairedLib))
......@@ -876,6 +880,7 @@ class StatsControllerSpec extends SentinelServletSpec {
priorResponse.contentType mustEqual "application/json"
priorResponse.body must /("median3PrimeBias") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("median5PrimeBias") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("median5PrimeTo3PrimeBias") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("nBasesAligned") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("nBasesCoding") /("nDataPoints" -> (nSingleLib + nPairedLib))
priorResponse.body must /("nBasesIntergenic") /("nDataPoints" -> (nSingleLib + nPairedLib))
......
......@@ -26,8 +26,9 @@ import nl.lumc.sasc.sentinel.utils.pctOf
*
* @param labels Data point labels.
* @param maxInsertSize Maximum insert size (only for paired-end libraries).
* @param median3PrimeBias Median value of 3' coverage biases.
* @param median5PrimeBias Median value of 5' coverage biases.
* @param median3PrimeBias Median value of 3' coverage biases from the top 1000 expressed transcripts (3'-most 100 bp).
* @param median5PrimeBias Median value of 5' coverage biases from the top 1000 expressed transcripts (5'-most 100 bp).
* @param median5PrimeTo3PrimeBias Median value of 5' to 3' coverage biases.
* @param medianInsertSize Median insert size (only for paired-end libraries).
* @param nBasesAligned Number of bases aligned.
* @param nBasesCoding Number of bases aligned in the coding regions.
......@@ -51,6 +52,7 @@ case class GentrapAlignmentStats(
medianInsertSize: Option[Long] = None,
median3PrimeBias: Double,
median5PrimeBias: Double,
median5PrimeTo3PrimeBias: Option[Double] = None, // may be undefined when 3'prime coverage bias is 0
nReadsAligned: Long,
nBasesAligned: Long,
nBasesCoding: Long,
......@@ -110,6 +112,7 @@ case class GentrapAlignmentStatsAggr(
maxInsertSize: Option[DataPointAggr] = None,
median3PrimeBias: DataPointAggr,
median5PrimeBias: DataPointAggr,
median5PrimeTo3PrimeBias: Option[DataPointAggr] = None,
medianInsertSize: Option[DataPointAggr] = None,
nBasesAligned: DataPointAggr,
nBasesCoding: DataPointAggr,
......
......@@ -361,6 +361,7 @@ class GentrapOutputProcessor(protected val mongo: MongodbAccessObject) extends M
"maxInsertSize",
"median3PrimeBias",
"median5PrimeBias",
"median5PrimeTo3PrimeBias",
"medianInsertSize",
"nBasesAligned",
"nBasesCoding",
......
......@@ -116,6 +116,7 @@ class GentrapV04InputProcessor(protected val mongo: MongodbAccessObject)
nBasesRibosomal = (rnaMetrics \ "ribosomal_bases").extractOpt[Long],
median5PrimeBias = (rnaMetrics \ "median_5prime_bias").extract[Double],
median3PrimeBias = (rnaMetrics \ "median_3prime_bias").extract[Double],
median5PrimeTo3PrimeBias = (rnaMetrics \ "median_5prime_to_3prime_bias").extractOpt[Double],
normalizedTranscriptCoverage = (rnaMetrics \ "normalized_transcript_cov").extract[Seq[Double]])
}
......
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