Skip to content
Snippets Groups Projects
Commit bbbaecd3 authored by bow's avatar bow
Browse files

Update Gentrap dict test to be more test-friendly

parent 2139a95e
No related branches found
No related tags found
No related merge requests found
......@@ -306,14 +306,19 @@ class Gentrap(val root: Configurable) extends QScript with MultiSampleQScript wi
job
}
// used to ensure that the required .dict file is present before the run starts
// can not store it in config since the tools that use it (Picard) have this value based on the reference file name
protected def checkDictFile(): Unit = {
val refFile: File = config("reference")
val refName: String = refFile.getName
require(refName.contains('.'), "Reference file must have an extension")
val dictFile = new File(refName.take(refName.lastIndexOf('.')) + ".dict")
require(dictFile.exists, s"Dict file '$dictFile' must exist")
}
/** Steps to run before biopetScript */
def init(): Unit = {
// TODO: refactor this out to a submodule (mapping / bammetrics?)
// We require the reference FASTA to be present, and also its companion DICT file
require(config.contains("reference"), "Reference FASTA must be defined")
val refName: File = config("reference")
val dict: File = new File(refName.toString.take(refName.toString.lastIndexOf('.')) + ".dict")
require(dict.exists, s"Dict file '$dict' must exist")
checkDictFile()
// TODO: validate that exons are flattened or not (depending on another option flag?)
// validate required annotation files
......
......@@ -38,9 +38,10 @@ class GentrapTest extends TestNGSuite with Matchers {
def initPipeline(map: Map[String, Any]): Gentrap = {
new Gentrap() {
override def configName = "gentrap"
override def globalConfig = new Config(map)
// disable dict file check since it is based on the reference file name (which we can't modify here since
// we use the mock /usr/bin/test file
override def checkDictFile: Unit = {}
qSettings = new QSettings
qSettings.runName = "test"
}
......@@ -187,6 +188,7 @@ object GentrapTest {
val executables = Map(
"reference" -> "test",
"dict" -> "test",
"annotation_gtf" -> "test",
"annotation_bed" -> "test",
"annotation_refflat" -> "test",
......
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