Commit 81108a2a authored by Peter van 't Hof's avatar Peter van 't Hof

Adding separated outputDirs for tests for MultisampleMapping

parent 2cc410f4
......@@ -104,10 +104,10 @@ abstract class AbstractTestMapping(val aligner: String) extends TestNGSuite with
val inputDir = Files.createTempDir()
val r1 = new File(inputDir, "input" + File.separator + "R1.fq")
val r2 = new File(inputDir, "input" + File.separator + "R2.fq")
val r1Zipped = new File(inputDir, "input" + File.separator + "R1.fq.gz")
val r2Zipped = new File(inputDir, "input" + File.separator + "R2.fq.gz")
val r1 = new File(inputDir, "R1.fq")
val r2 = new File(inputDir, "R2.fq")
val r1Zipped = new File(inputDir, "R1.fq.gz")
val r2Zipped = new File(inputDir, "R2.fq.gz")
val hisat2Index = new File(inputDir, "ref.1.ht2")
@BeforeClass
......@@ -128,7 +128,7 @@ abstract class AbstractTestMapping(val aligner: String) extends TestNGSuite with
private def copyFile(name: String): Unit = {
val is = getClass.getResourceAsStream("/" + name)
val os = new FileOutputStream(new File(outputDir, name))
val os = new FileOutputStream(new File(inputDir, name))
org.apache.commons.io.IOUtils.copy(is, os)
os.close()
}
......
......@@ -162,18 +162,24 @@ class MultisampleMappingBamToFastqTest extends MultisampleMappingTestTrait {
}
object MultisampleMappingTestTrait {
val outputDir = Files.createTempDir()
outputDir.deleteOnExit()
new File(outputDir, "input").mkdirs()
private var dirs: List[File] = Nil
def outputDir = {
val dir = Files.createTempDir()
dirs :+= dir
dir
}
val inputDir = Files.createTempDir()
def inputTouch(name: String): File = {
val file = new File(outputDir, "input" + File.separator + name).getAbsoluteFile
val file = new File(inputDir, name).getAbsoluteFile
Files.touch(file)
file
}
private def copyFile(name: String): Unit = {
val is = getClass.getResourceAsStream("/" + name)
val os = new FileOutputStream(new File(outputDir, name))
val os = new FileOutputStream(new File(inputDir, name))
org.apache.commons.io.IOUtils.copy(is, os)
os.close()
}
......@@ -183,14 +189,14 @@ object MultisampleMappingTestTrait {
copyFile("ref.fa.fai")
copyFile("empty.sam")
val config = Map(
def config = Map(
"skip_write_dependencies" -> true,
"name_prefix" -> "test",
"cache" -> true,
"dir" -> "test",
"vep_script" -> "test",
"output_dir" -> outputDir,
"reference_fasta" -> (outputDir + File.separator + "ref.fa"),
"reference_fasta" -> (inputDir + File.separator + "ref.fa"),
"fastqc" -> Map("exe" -> "test"),
"input_alleles" -> "test",
"fastqc" -> Map("exe" -> "test"),
......@@ -234,7 +240,7 @@ object MultisampleMappingTestTrait {
val sample3 = Map(
"samples" -> Map("sample3" -> Map("libraries" -> Map(
"lib1" -> Map(
"bam" -> (outputDir + File.separator + "empty.sam")
"bam" -> (inputDir + File.separator + "empty.sam")
)
)
)))
......@@ -242,7 +248,7 @@ object MultisampleMappingTestTrait {
val sample4 = Map(
"samples" -> Map("sample4" -> Map("libraries" -> Map(
"lib1" -> Map(
"bam" -> (outputDir + File.separator + "empty.sam")
"bam" -> (inputDir + File.separator + "empty.sam")
)
)
)))
......
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