diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/utils/intervals/BedRecord.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/utils/intervals/BedRecord.scala index 9a798fbaf7349d1564090d587e7de15b4a7b916d..b8f5e680cb948e7ea94da2932d0a86d7e4de8d1f 100644 --- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/utils/intervals/BedRecord.scala +++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/utils/intervals/BedRecord.scala @@ -47,6 +47,18 @@ case class BedRecord(chr: String, })) } else None + lazy val utr5 = (strand, thickStart, thickEnd) match { + case (Some("+"), Some(tStart), Some(tEnd)) => Some(BedRecord(chr, start, tStart - 1, name.map(_ + "_utr5"))) + case (Some("-"), Some(tStart), Some(tEnd)) => Some(BedRecord(chr, tEnd + 1, end, name.map(_ + "_utr5"))) + case _ => None + } + + lazy val utr3 = (strand, thickStart, thickEnd) match { + case (Some("-"), Some(tStart), Some(tEnd)) => Some(BedRecord(chr, start, tStart - 1, name.map(_ + "_utr3"))) + case (Some("+"), Some(tStart), Some(tEnd)) => Some(BedRecord(chr, tEnd + 1, end, name.map(_ + "_utr3"))) + case _ => None + } + override def toString = { def arrayToOption[T](array: Array[T]): Option[Array[T]] = { if (array.isEmpty) None