Commit 6894dd4d authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Adding test to GensToVcf

parent b6b7d57d
ID_1 ID_2 missing hip knee hand knee_or_hip sex age bmi
0 0 0 D D D D D P P
sample-1 fam-1 0.0 2 NA 2 2 1 59.0767123287671 27.1314117909924
sample-2 fam-1 0.0 2 NA NA 2 2 48.4958904109589 23.8754325259516
sample-3 fam-1 0.0 NA NA NA NA 2 57.0876712328767 45.8842609074008
--- rs1 30 A C 1 0 0 0 1 0 0 0 1
--- rs2 40 A - 1 0 0 0 1 0 0 0 1
--- rs3 50 A AT 1 0 0 0 1 0 0 0 1
\ No newline at end of file
snp_id rs_id position exp_freq_a1 info certainty type info_type0 concord_type0 r2_type0
--- rs1 30 0.037 0.535 0.958 0 -1 -1 -1
--- rs2 40 0.023 0.621 0.978 0 -1 -1 -1
--- rs3 50 0.000 0.114 0.999 0 -1 -1 -1
package nl.lumc.sasc.biopet.tools
import java.io.File
import java.nio.file.Paths
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test
/**
* Created by pjvan_thof on 4/11/16.
*/
class GensToVcfTest extends TestNGSuite with Matchers {
@Test
def testGensOnly: Unit = {
val output = File.createTempFile("test.", ".vcf.gz")
GensToVcf.main(Array(
"--inputGenotypes", GensToVcfTest.resourcePath("/test.gens"),
"--outputVcf", output.getAbsolutePath,
"--referenceFasta", GensToVcfTest.resourcePath("/fake_chrQ.fa"),
"--contig", "chrQ",
"--samplesFile", GensToVcfTest.resourcePath("/gens.samples")
))
}
@Test
def testGensInfo: Unit = {
val output = File.createTempFile("test.", ".vcf.gz")
GensToVcf.main(Array(
"--inputGenotypes", GensToVcfTest.resourcePath("/test.gens"),
"--inputInfo", GensToVcfTest.resourcePath("/test.gens_info"),
"--outputVcf", output.getAbsolutePath,
"--referenceFasta", GensToVcfTest.resourcePath("/fake_chrQ.fa"),
"--contig", "chrQ",
"--samplesFile", GensToVcfTest.resourcePath("/gens.samples"),
"--sortInput"
))
}
}
object GensToVcfTest {
private def resourcePath(p: String): String = {
Paths.get(getClass.getResource(p).toURI).toString
}
}
Supports Markdown
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