AnnotateVcfWithBedTest.scala 2.03 KB
Newer Older
Peter van 't Hof's avatar
Peter van 't Hof committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 * Biopet is built on top of GATK Queue for building bioinformatic
 * pipelines. It is mainly intended to support LUMC SHARK cluster which is running
 * SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
 * should also be able to execute Biopet tools and pipelines.
 *
 * Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
 *
 * Contact us at: sasc@lumc.nl
 *
 * A dual licensing mode is applied. The source code within this project that are
 * not part of GATK Queue is freely available for non-commercial use under an AGPL
 * license; For commercial users or users who do not want to follow the AGPL
 * license, please contact us to obtain a separate license.
 */
16
17
18
19
20
21
package nl.lumc.sasc.biopet.tools
import java.nio.file.Paths

import org.scalatest.Matchers
import org.scalatest.mock.MockitoSugar
import org.scalatest.testng.TestNGSuite
Peter van 't Hof's avatar
Peter van 't Hof committed
22
import org.testng.annotations.Test
23
24
25

import scala.util.Random
/**
Peter van 't Hof's avatar
Peter van 't Hof committed
26
27
 * Test class for AnnotateVcfWithBed
 *
28
29
30
31
32
33
34
35
36
 * Created by ahbbollen on 9-4-15.
 */
class AnnotateVcfWithBedTest extends TestNGSuite with MockitoSugar with Matchers {
  import AnnotateVcfWithBed._

  private def resourcePath(p: String): String = {
    Paths.get(getClass.getResource(p).toURI).toString
  }

37
  val veppedPath = resourcePath("/VEP_oneline.vcf")
38
39
40
41
  val bed = resourcePath("/rrna01.bed")
  val rand = new Random()

  @Test def testOutputTypeVcf() = {
Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
42
    val tmpPath = "/tmp/VcfFilter_" + rand.nextString(10) + ".vcf"
43
    val arguments: Array[String] = Array("-I", veppedPath, "-o", tmpPath, "-B", bed, "-f", "testing")
44
45
46
47
    main(arguments)
  }

  @Test def testOutputTypeBcf() = {
Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
48
    val tmpPath = "/tmp/VcfFilter_" + rand.nextString(10) + ".bcf"
49
    val arguments: Array[String] = Array("-I", veppedPath, "-o", tmpPath, "-B", bed, "-f", "testing")
50
51
52
53
    main(arguments)
  }

  @Test def testOutputTypeVcfGz() = {
Sander van der Zeeuw's avatar
Sander van der Zeeuw committed
54
    val tmpPath = "/tmp/VcfFilter_" + rand.nextString(10) + ".vcf.gz"
55
    val arguments: Array[String] = Array("-I", veppedPath, "-o", tmpPath, "-B", bed, "-f", "testing")
56
57
58
59
    main(arguments)
  }

}