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

Fix format and typo's

parent 9a2c81d5
...@@ -188,28 +188,27 @@ object VEPNormalizer extends ToolCommand { ...@@ -188,28 +188,27 @@ object VEPNormalizer extends ToolCommand {
* @return An array with the new records * @return An array with the new records
*/ */
def explodeTranscripts(record: VariantContext, csqInfos: Array[String], removeCsq: Boolean): Array[VariantContext] = { def explodeTranscripts(record: VariantContext, csqInfos: Array[String], removeCsq: Boolean): Array[VariantContext] = {
val arti = parseCsq(record) for (transcript <- parseCsq(record)) yield {
for (transcript <- arti) yield {
(for ( (for (
fieldId <- 0 until csqInfos.size if transcript.isDefinedAt(fieldId); fieldId <- 0 until csqInfos.size if transcript.isDefinedAt(fieldId);
value = transcript(fieldId).trim if value.nonEmpty value = transcript(fieldId) if value.nonEmpty
) yield csqInfos(fieldId) -> value) ) yield csqInfos(fieldId) -> value)
.filterNot(_._2.isEmpty) .filterNot(_._2.isEmpty)
.foldLeft(createBuilder(record, removeCsq))((builder, artibute) => builder.attribute(artibute._1, artibute._2)) .foldLeft(createBuilder(record, removeCsq))((builder, attribute) => builder.attribute(attribute._1, attribute._2))
.make() .make()
} }
} }
def standardTranscripts(record: VariantContext, csqInfos: Array[String], removeCsq: Boolean): VariantContext = { def standardTranscripts(record: VariantContext, csqInfos: Array[String], removeCsq: Boolean): VariantContext = {
val arti = parseCsq(record) val attribs = parseCsq(record)
(for (fieldId <- 0 until csqInfos.size) yield csqInfos(fieldId) -> { (for (fieldId <- 0 until csqInfos.size) yield csqInfos(fieldId) -> {
for ( for (
transcript <- arti if transcript.isDefinedAt(fieldId); transcript <- attribs if transcript.isDefinedAt(fieldId);
value = transcript(fieldId).trim if value.nonEmpty value = transcript(fieldId) if value.nonEmpty
) yield value ) yield value
}).filter(_._2.nonEmpty) })
.filter(_._2.nonEmpty)
.foldLeft(createBuilder(record, removeCsq))((builder, attribute) => builder.attribute(attribute._1, attribute._2)) .foldLeft(createBuilder(record, removeCsq))((builder, attribute) => builder.attribute(attribute._1, attribute._2))
.make() .make()
} }
...@@ -223,7 +222,7 @@ object VEPNormalizer extends ToolCommand { ...@@ -223,7 +222,7 @@ object VEPNormalizer extends ToolCommand {
record.getAttributeAsString("CSQ", "unknown"). record.getAttributeAsString("CSQ", "unknown").
stripPrefix("["). stripPrefix("[").
stripSuffix("]"). stripSuffix("]").
split(",").map(_.split("""\|""")) split(",").map(_.split("""\|""").map(_.trim))
} }
case class Args(inputVCF: File = null, case class Args(inputVCF: File = null,
......
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