Skip to content
Snippets Groups Projects
Commit 4dcbb9cd authored by Sander Bollen's avatar Sander Bollen
Browse files

proper temp files

parent b4bb3fd3
No related branches found
No related tags found
No related merge requests found
......@@ -45,19 +45,25 @@ class CheckAllelesVcfInBamTest extends TestNGSuite with MockitoSugar with Matche
val rand = new Random()
@Test def testOutputTypeVcf() = {
val tmp_path = "/tmp/CheckAllesVcfInBam_" + rand.nextString(10) + ".vcf"
val tmp = File.createTempFile("CheckAllelesVcfInBam", ".vcf")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments = Array("-I", vcf, "-b", bam, "-s", "sample01", "-o", tmp_path)
main(arguments)
}
@Test def testOutputTypeVcfGz() = {
val tmp_path = "/tmp/CheckAllesVcfInBam_" + rand.nextString(10) + ".vcf.gz"
val tmp = File.createTempFile("CheckAllelesVcfInBam", ".vcf.gz")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments = Array("-I", vcf, "-b", bam, "-s", "sample01", "-o", tmp_path)
main(arguments)
}
@Test def testOutputTypeBcf() = {
val tmp_path = "/tmp/CheckAllesVcfInBam_" + rand.nextString(10) + ".bcf"
val tmp = File.createTempFile("CheckAllelesVcfInBam", ".bcf")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments = Array("-I", vcf, "-b", bam, "-s", "sample01", "-o", tmp_path)
main(arguments)
}
......
......@@ -15,6 +15,7 @@
*/
package nl.lumc.sasc.biopet.tools
import java.io.File
import java.nio.file.Paths
import org.scalatest.Matchers
......@@ -48,19 +49,25 @@ class MergeAllelesTest extends TestNGSuite with MockitoSugar with Matchers {
val rand = new Random()
@Test def testOutputTypeVcf() = {
val tmp_path = "/tmp/MergeAlleles_" + rand.nextString(10) + ".vcf"
val tmp = File.createTempFile("MergeAlleles", ".vcf")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments = Array("-I", vepped_path, "-o", tmp_path, "-R", reference)
main(arguments)
}
@Test def testOutputTypeVcfGz() = {
val tmp_path = "/tmp/MergeAlleles_" + rand.nextString(10) + ".vcf.gz"
val tmp = File.createTempFile("MergeAlleles", ".vcf.gz")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments = Array("-I", vepped_path, "-o", tmp_path, "-R", reference)
main(arguments)
}
@Test def testOutputTypeBcf() = {
val tmp_path = "/tmp/MergeAlleles_" + rand.nextString(10) + ".bcf"
val tmp = File.createTempFile("MergeAlleles", ".bcf")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments = Array("-I", vepped_path, "-o", tmp_path, "-R", reference)
main(arguments)
}
......
......@@ -44,19 +44,25 @@ class VcfFilterTest extends TestNGSuite with MockitoSugar with Matchers {
val rand = new Random()
@Test def testOutputTypeVcf() = {
val tmp_path = "/tmp/VcfFilter_" + rand.nextString(10) + ".vcf"
val tmp = File.createTempFile("VcfFilter", ".vcf")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments: Array[String] = Array("-I", vepped_path, "-o", tmp_path)
main(arguments)
}
@Test def testOutputTypeBcf() = {
val tmp_path = "/tmp/VcfFilter_" + rand.nextString(10) + ".bcf"
val tmp = File.createTempFile("VcfFilter", ".bcf")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments: Array[String] = Array("-I", vepped_path, "-o", tmp_path)
main(arguments)
}
@Test def testOutputTypeVcfGz() = {
val tmp_path = "/tmp/VcfFilter_" + rand.nextString(10) + ".vcf.gz"
val tmp = File.createTempFile("VcfFilter", ".vcf.gz")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments: Array[String] = Array("-I", vepped_path, "-o", tmp_path)
main(arguments)
}
......
......@@ -15,6 +15,7 @@
*/
package nl.lumc.sasc.biopet.tools
import java.io.File
import java.nio.file.Paths
import org.scalatest.Matchers
......@@ -41,19 +42,25 @@ class VcfToTsvTest extends TestNGSuite with MockitoSugar with Matchers {
val unvepped = resourcePath("/unvepped.vcf")
@Test def testAllFields() = {
val tmp_path = "/tmp/VcfToTsv_" + rand.nextString(10) + ".tsv"
val tmp = File.createTempFile("VcfToTsv", ".tsv")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments = Array("-I", unvepped, "-o", tmp_path, "--all_info")
main(arguments)
}
@Test def testSpecificField() = {
val tmp_path = "/tmp/VcfToTsv_" + rand.nextString(10) + ".tsv"
val tmp = File.createTempFile("VcfToTsv", ".tsv")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments = Array("-I", vepped, "-o", tmp_path, "-i", "CSQ")
main(arguments)
}
@Test def testNewSeparators() = {
val tmp_path = "/tmp/VcfToTsv_" + rand.nextString(10) + ".tsv"
val tmp = File.createTempFile("VcfToTsv", ".tsv")
tmp.deleteOnExit()
val tmp_path = tmp.getAbsolutePath
val arguments = Array("-I", vepped, "-o", tmp_path, "--all_info", "--separator", ",", "--list_separator", "|")
main(arguments)
}
......
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