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

Fix most of #196. Only documentation remaining

parent f4ee1f10
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,7 @@ object SamplesTsvToJson extends ToolCommand {
t <- 0 until values.size if !values(t).isEmpty && t != sampleColumn && t != libraryColumn
) yield header(t) -> values(t)).toMap
library match {
case Some(lib) => Map("samples" -> Map(sample -> Map("libraries" -> Map(library -> valuesMap))))
case Some(lib) => Map("samples" -> Map(sample -> Map("libraries" -> Map(library.get -> valuesMap))))
case _ => Map("samples" -> Map(sample -> valuesMap))
}
}
......
......@@ -8,6 +8,7 @@ import org.scalatest.mock.MockitoSugar
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test
/**
* Created by ahbbollen on 28-8-15.
*/
......@@ -46,6 +47,32 @@ class SamplesTsvToJsonTest extends TestNGSuite with MockitoSugar with Matchers {
}
@Test
def testJson = {
val tsv = new File(resourcePath("/sample.tsv"))
val json = stringFromInputs(List(tsv))
json should equal (
"""|{
| "samples" : {
| "Sample_ID_1" : {
| "libraries" : {
| "Lib_ID_1" : {
| "bam" : "MyFirst.bam"
| }
| }
| },
| "Sample_ID_2" : {
| "libraries" : {
| "Lib_ID_2" : {
| "bam" : "MySecond.bam"
| }
| }
| }
| }
|}""".stripMargin)
}
}
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