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

Simplify method

parent 7d6eb6fb
......@@ -15,7 +15,7 @@
*/
package nl.lumc.sasc.biopet.tools
import java.io.{PrintWriter, File}
import java.io.{ PrintWriter, File }
import htsjdk.samtools.fastq.{ FastqReader, FastqRecord }
import nl.lumc.sasc.biopet.core.config.Configurable
......@@ -117,12 +117,12 @@ object SeqStat extends ToolCommand {
|$commandName - Summarize FastQ
""".stripMargin)
opt[File]('i', "fastq") required () unbounded() valueName "<fastq>" action { (x, c) =>
opt[File]('i', "fastq") required () unbounded () valueName "<fastq>" action { (x, c) =>
c.copy(fastq = x)
} validate {
x => if (x.exists) success else failure("FASTQ file not found")
} text "FastQ file to generate stats from"
opt[File]('o', "output") unbounded() valueName "<json>" action { (x, c) =>
opt[File]('o', "output") unbounded () valueName "<json>" action { (x, c) =>
c.copy(fastq = x)
} text "File to write output to, if not supplied output go to stdout"
}
......
......@@ -73,24 +73,11 @@ object VcfUtils {
out
}
//TODO: Add genotype comparing to this function
def identicalVariantContext(var1: VariantContext, var2: VariantContext): Boolean = {
if (var1.getContig != var2.getContig) {
false
}
if (var1.getStart != var2.getStart) {
false
}
if (var1.getEnd != var2.getEnd) {
false
}
if (!var1.getAttributes.forall(x => var2.hasAttribute(x._1)) || !var2.getAttributes.forall(x => var1.hasAttribute(x._1))) {
false
}
if (!var1.getAttributes.forall(x => var2.getAttribute(x._1) == var1.getAttribute(x._1)) ||
!var2.getAttributes.forall(x => var1.getAttribute(x._1) == var2.getAttribute(x._1))) {
false
}
true
var1.getContig == var2.getContig &&
var1.getStart == var2.getStart &&
var1.getEnd == var2.getEnd &&
var1.getAttributes == var2.getAttributes
}
}
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