Skip to content
Snippets Groups Projects
Commit aa097f5e authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Merge branch 'path-samplestsvtojson' into 'develop'

Fixed parsing of empty values

See merge request !152
parents 97379863 db2fa40a
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,10 @@ object SamplesTsvToJson extends ToolCommand {
val values = tsvLine.split("\t")
val sample = values(sampleColumn)
val library = if (libraryColumn != -1) values(libraryColumn) else null
val valuesMap = (for (t <- 0 until values.size if t != sampleColumn if t != libraryColumn) yield (header(t) -> values(t))).toMap
val valuesMap = (for (
t <- 0 until values.size;
if !values(t).isEmpty && t != sampleColumn && t != libraryColumn
) yield (header(t) -> values(t))).toMap
val map: Map[String, Any] = if (library != null) {
Map("samples" -> Map(sample -> Map("libraries" -> Map(library -> valuesMap))))
} else {
......
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