Commit ba1faa4a authored by Peter van 't Hof's avatar Peter van 't Hof

Added a test for compressed reference

parent cf082184
...@@ -3,6 +3,7 @@ package nl.lumc.sasc.biopet.utils ...@@ -3,6 +3,7 @@ package nl.lumc.sasc.biopet.utils
import java.io.{File, PrintWriter} import java.io.{File, PrintWriter}
import java.nio.file.Paths import java.nio.file.Paths
import htsjdk.samtools.reference.IndexedFastaSequenceFile
import org.scalatest.Matchers import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test import org.testng.annotations.Test
...@@ -47,6 +48,19 @@ class FastaUtilsTest extends TestNGSuite with Matchers { ...@@ -47,6 +48,19 @@ class FastaUtilsTest extends TestNGSuite with Matchers {
def testGetSequenceGc(): Unit = { def testGetSequenceGc(): Unit = {
val referenceFile = new File(resourcePath("/fake_chrQ.fa")) val referenceFile = new File(resourcePath("/fake_chrQ.fa"))
val reader = new IndexedFastaSequenceFile(referenceFile)
reader.getSubsequenceAt("chrQ", 11, 20).getBaseString shouldBe "GAAACTCCAA"
FastaUtils.getSequenceGc(referenceFile, "chrQ", 11, 20) shouldBe 0.4
}
@Test
def testGetSequenceGcCompressed(): Unit = {
val referenceFile = new File(resourcePath("/fake_chrQ.fa.gz"))
val reader = new IndexedFastaSequenceFile(referenceFile)
reader.getSubsequenceAt("chrQ", 11, 20).getBaseString shouldBe "GAAACTCCAA"
FastaUtils.getSequenceGc(referenceFile, "chrQ", 11, 20) shouldBe 0.4 FastaUtils.getSequenceGc(referenceFile, "chrQ", 11, 20) shouldBe 0.4
} }
......
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