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

Fix code style warnings

parent a3af8046
...@@ -40,6 +40,6 @@ object SquishBed { ...@@ -40,6 +40,6 @@ object SquishBed {
val squishBed = new SquishBed(root) val squishBed = new SquishBed(root)
squishBed.input = input squishBed.input = input
squishBed.output = new File(outputDir, input.getName.stripSuffix(".bed") + ".squish.bed") squishBed.output = new File(outputDir, input.getName.stripSuffix(".bed") + ".squish.bed")
return squishBed squishBed
} }
} }
...@@ -26,13 +26,15 @@ import scala.collection.JavaConversions._ ...@@ -26,13 +26,15 @@ import scala.collection.JavaConversions._
import scala.collection.mutable import scala.collection.mutable
import scala.io.Source import scala.io.Source
/**
* Created by pjvan_thof on 1/10/15.
*/
class AnnotateVcfWithBed { class AnnotateVcfWithBed {
// TODO: Queue wrapper // TODO: Queue wrapper
} }
/**
* This a tools to annotate a vcf file with values from a bed file
*
* Created by pjvan_thof on 1/10/15.
*/
object AnnotateVcfWithBed extends ToolCommand { object AnnotateVcfWithBed extends ToolCommand {
/** /**
...@@ -52,30 +54,29 @@ object AnnotateVcfWithBed extends ToolCommand { ...@@ -52,30 +54,29 @@ object AnnotateVcfWithBed extends ToolCommand {
fieldType: String = "String") extends AbstractArgs fieldType: String = "String") extends AbstractArgs
class OptParser extends AbstractOptParser { class OptParser extends AbstractOptParser {
opt[File]('I', "inputFile") required () unbounded () valueName ("<vcf file>") action { (x, c) => opt[File]('I', "inputFile") required () unbounded () valueName "<vcf file>" action { (x, c) =>
c.copy(inputFile = x) c.copy(inputFile = x)
} text ("Input is a required file property") } text "Input is a required file property"
opt[File]('B', "bedFile") required () unbounded () valueName ("<bed file>") action { (x, c) => opt[File]('B', "bedFile") required () unbounded () valueName "<bed file>" action { (x, c) =>
c.copy(bedFile = x) c.copy(bedFile = x)
} text ("Bedfile is a required file property") } text "Bedfile is a required file property"
opt[File]('o', "output") required () unbounded () valueName ("<vcf file>") action { (x, c) => opt[File]('o', "output") required () unbounded () valueName "<vcf file>" action { (x, c) =>
c.copy(outputFile = x) c.copy(outputFile = x)
} text ("out is a required file property") } text "out is a required file property"
opt[String]('f', "fieldName") required () unbounded () valueName ("<name of field in vcf file>") action { (x, c) => opt[String]('f', "fieldName") required () unbounded () valueName "<name of field in vcf file>" action { (x, c) =>
c.copy(fieldName = x) c.copy(fieldName = x)
} text ("Name of info field in new vcf file") } text "Name of info field in new vcf file"
opt[String]('d', "fieldDescription") unbounded () valueName ("<name of field in vcf file>") action { (x, c) => opt[String]('d', "fieldDescription") unbounded () valueName "<name of field in vcf file>" action { (x, c) =>
c.copy(fieldDescription = x) c.copy(fieldDescription = x)
} text ("Description of field in new vcf file") } text "Description of field in new vcf file"
opt[String]('t', "fieldType") unbounded () valueName ("<name of field in vcf file>") action { (x, c) => opt[String]('t', "fieldType") unbounded () valueName "<name of field in vcf file>" action { (x, c) =>
c.copy(fieldType = x) c.copy(fieldType = x)
} text ("Description of field in new vcf file") } text "Description of field in new vcf file"
} }
/** /**
* Program will Annotate a vcf file with the overlapping regions of a bed file, 4e column of the bed file we in a info tag in the vcf file * Program will Annotate a vcf file with the overlapping regions of a bed file,
* * 4e column of the bed file we in a info tag in the vcf file
* @param args
*/ */
def main(args: Array[String]): Unit = { def main(args: Array[String]): Unit = {
...@@ -108,7 +109,7 @@ object AnnotateVcfWithBed extends ToolCommand { ...@@ -108,7 +109,7 @@ object AnnotateVcfWithBed extends ToolCommand {
val values = line.split("\t") val values = line.split("\t")
if (values.size >= 4) if (values.size >= 4)
bedRecords(values(0)) = (values(1).toInt, values(2).toInt, values(3)) :: bedRecords.getOrElse(values(0), Nil) bedRecords(values(0)) = (values(1).toInt, values(2).toInt, values(3)) :: bedRecords.getOrElse(values(0), Nil)
else (values.size >= 3 && fieldType == VCFHeaderLineType.Flag) else values.size >= 3 && fieldType == VCFHeaderLineType.Flag
bedRecords(values(0)) = (values(1).toInt, values(2).toInt, "") :: bedRecords.getOrElse(values(0), Nil) bedRecords(values(0)) = (values(1).toInt, values(2).toInt, "") :: bedRecords.getOrElse(values(0), Nil)
} }
...@@ -148,8 +149,8 @@ object AnnotateVcfWithBed extends ToolCommand { ...@@ -148,8 +149,8 @@ object AnnotateVcfWithBed extends ToolCommand {
writer.add(builder.make) writer.add(builder.make)
} }
} }
reader.close reader.close()
writer.close writer.close()
logger.info("Done") logger.info("Done")
} }
......
...@@ -58,8 +58,8 @@ class BastyGenerateFasta(val root: Configurable) extends ToolCommandFuntion with ...@@ -58,8 +58,8 @@ class BastyGenerateFasta(val root: Configurable) extends ToolCommandFuntion with
override val defaultCoreMemory = 4.0 override val defaultCoreMemory = 4.0
override def beforeGraph: Unit = { override def beforeGraph(): Unit = {
super.beforeGraph super.beforeGraph()
reference = referenceFasta() reference = referenceFasta()
} }
...@@ -91,43 +91,43 @@ object BastyGenerateFasta extends ToolCommand { ...@@ -91,43 +91,43 @@ object BastyGenerateFasta extends ToolCommand {
reference: File = null) extends AbstractArgs reference: File = null) extends AbstractArgs
class OptParser extends AbstractOptParser { class OptParser extends AbstractOptParser {
opt[File]('V', "inputVcf") unbounded () valueName ("<file>") action { (x, c) => opt[File]('V', "inputVcf") unbounded () valueName "<file>" action { (x, c) =>
c.copy(inputVcf = x) c.copy(inputVcf = x)
} text ("vcf file, needed for outputVariants and outputConsensusVariants") validate { x => } text "vcf file, needed for outputVariants and outputConsensusVariants" validate { x =>
if (x.exists) success else failure("File does not exist: " + x) if (x.exists) success else failure("File does not exist: " + x)
} }
opt[File]("bamFile") unbounded () valueName ("<file>") action { (x, c) => opt[File]("bamFile") unbounded () valueName "<file>" action { (x, c) =>
c.copy(bamFile = x) c.copy(bamFile = x)
} text ("bam file, needed for outputConsensus and outputConsensusVariants") validate { x => } text "bam file, needed for outputConsensus and outputConsensusVariants" validate { x =>
if (x.exists) success else failure("File does not exist: " + x) if (x.exists) success else failure("File does not exist: " + x)
} }
opt[File]("outputVariants") maxOccurs (1) unbounded () valueName ("<file>") action { (x, c) => opt[File]("outputVariants") maxOccurs 1 unbounded () valueName "<file>" action { (x, c) =>
c.copy(outputVariants = x) c.copy(outputVariants = x)
} text ("fasta with only variants from vcf file") } text "fasta with only variants from vcf file"
opt[File]("outputConsensus") maxOccurs (1) unbounded () valueName ("<file>") action { (x, c) => opt[File]("outputConsensus") maxOccurs 1 unbounded () valueName "<file>" action { (x, c) =>
c.copy(outputConsensus = x) c.copy(outputConsensus = x)
} text ("Consensus fasta from bam, always reference bases else 'N'") } text "Consensus fasta from bam, always reference bases else 'N'"
opt[File]("outputConsensusVariants") maxOccurs (1) unbounded () valueName ("<file>") action { (x, c) => opt[File]("outputConsensusVariants") maxOccurs 1 unbounded () valueName "<file>" action { (x, c) =>
c.copy(outputConsensusVariants = x) c.copy(outputConsensusVariants = x)
} text ("Consensus fasta from bam with variants from vcf file, always reference bases else 'N'") } text "Consensus fasta from bam with variants from vcf file, always reference bases else 'N'"
opt[Unit]("snpsOnly") unbounded () action { (x, c) => opt[Unit]("snpsOnly") unbounded () action { (x, c) =>
c.copy(snpsOnly = true) c.copy(snpsOnly = true)
} text ("Only use snps from vcf file") } text "Only use snps from vcf file"
opt[String]("sampleName") unbounded () action { (x, c) => opt[String]("sampleName") unbounded () action { (x, c) =>
c.copy(sampleName = x) c.copy(sampleName = x)
} text ("Sample name in vcf file") } text "Sample name in vcf file"
opt[String]("outputName") required () unbounded () action { (x, c) => opt[String]("outputName") required () unbounded () action { (x, c) =>
c.copy(outputName = x) c.copy(outputName = x)
} text ("Output name in fasta file header") } text "Output name in fasta file header"
opt[Int]("minAD") unbounded () action { (x, c) => opt[Int]("minAD") unbounded () action { (x, c) =>
c.copy(minAD = x) c.copy(minAD = x)
} text ("min AD value in vcf file for sample. Defaults to: 8") } text "min AD value in vcf file for sample. Defaults to: 8"
opt[Int]("minDepth") unbounded () action { (x, c) => opt[Int]("minDepth") unbounded () action { (x, c) =>
c.copy(minDepth = x) c.copy(minDepth = x)
} text ("min depth in bam file. Defaults to: 8") } text "min depth in bam file. Defaults to: 8"
opt[File]("reference") unbounded () action { (x, c) => opt[File]("reference") unbounded () action { (x, c) =>
c.copy(reference = x) c.copy(reference = x)
} text ("Indexed reference fasta file") validate { x => } text "Indexed reference fasta file" validate { x =>
if (x.exists) success else failure("File does not exist: " + x) if (x.exists) success else failure("File does not exist: " + x)
} }
...@@ -188,7 +188,7 @@ object BastyGenerateFasta extends ToolCommand { ...@@ -188,7 +188,7 @@ object BastyGenerateFasta extends ToolCommand {
val variants: Map[(Int, Int), VariantContext] = if (cmdArgs.inputVcf != null) { val variants: Map[(Int, Int), VariantContext] = if (cmdArgs.inputVcf != null) {
val reader = new VCFFileReader(cmdArgs.inputVcf, true) val reader = new VCFFileReader(cmdArgs.inputVcf, true)
(for (variant <- reader.query(chrName, begin, end) if (!cmdArgs.snpsOnly || variant.isSNP)) yield { (for (variant <- reader.query(chrName, begin, end) if !cmdArgs.snpsOnly || variant.isSNP) yield {
(variant.getStart, variant.getEnd) -> variant (variant.getStart, variant.getEnd) -> variant
}).toMap }).toMap
} else Map() } else Map()
...@@ -202,10 +202,10 @@ object BastyGenerateFasta extends ToolCommand { ...@@ -202,10 +202,10 @@ object BastyGenerateFasta extends ToolCommand {
for (t <- s to e) coverage(t - begin) += 1 for (t <- s to e) coverage(t - begin) += 1
} }
} else { } else {
for (t <- 0 until coverage.length) coverage(t) = cmdArgs.minDepth for (t <- coverage.indices) coverage(t) = cmdArgs.minDepth
} }
val consensus = for (t <- 0 until coverage.length) yield { val consensus = for (t <- coverage.indices) yield {
if (coverage(t) >= cmdArgs.minDepth) referenceSequence.getBases()(t).toChar if (coverage(t) >= cmdArgs.minDepth) referenceSequence.getBases()(t).toChar
else 'N' else 'N'
} }
...@@ -222,7 +222,7 @@ object BastyGenerateFasta extends ToolCommand { ...@@ -222,7 +222,7 @@ object BastyGenerateFasta extends ToolCommand {
val stripSufix = if (variant.get._1._2 > end) variant.get._1._2 - end else 0 val stripSufix = if (variant.get._1._2 > end) variant.get._1._2 - end else 0
val allele = getMaxAllele(variant.get._2) val allele = getMaxAllele(variant.get._2)
consensusPos += variant.get._2.getReference.getBases.length consensusPos += variant.get._2.getReference.getBases.length
buffer.append(allele.substring(stripPrefix, allele.size - stripSufix)) buffer.append(allele.substring(stripPrefix, allele.length - stripSufix))
} else { } else {
buffer.append(consensus(consensusPos)) buffer.append(consensus(consensusPos))
consensusPos += 1 consensusPos += 1
...@@ -230,7 +230,7 @@ object BastyGenerateFasta extends ToolCommand { ...@@ -230,7 +230,7 @@ object BastyGenerateFasta extends ToolCommand {
} }
} }
(chunk -> (consensus.mkString.toUpperCase, buffer.toString.toUpperCase)) chunk -> (consensus.mkString.toUpperCase, buffer.toString().toUpperCase)
}).toMap }).toMap
if (cmdArgs.outputConsensus != null) { if (cmdArgs.outputConsensus != null) {
val writer = new PrintWriter(cmdArgs.outputConsensus) val writer = new PrintWriter(cmdArgs.outputConsensus)
...@@ -239,7 +239,7 @@ object BastyGenerateFasta extends ToolCommand { ...@@ -239,7 +239,7 @@ object BastyGenerateFasta extends ToolCommand {
writer.print(chunks(c)._1) writer.print(chunks(c)._1)
} }
writer.println() writer.println()
writer.close writer.close()
} }
if (cmdArgs.outputConsensusVariants != null) { if (cmdArgs.outputConsensusVariants != null) {
val writer = new PrintWriter(cmdArgs.outputConsensusVariants) val writer = new PrintWriter(cmdArgs.outputConsensusVariants)
...@@ -248,7 +248,7 @@ object BastyGenerateFasta extends ToolCommand { ...@@ -248,7 +248,7 @@ object BastyGenerateFasta extends ToolCommand {
writer.print(chunks(c)._2) writer.print(chunks(c)._2)
} }
writer.println() writer.println()
writer.close writer.close()
} }
} }
} }
...@@ -257,12 +257,12 @@ object BastyGenerateFasta extends ToolCommand { ...@@ -257,12 +257,12 @@ object BastyGenerateFasta extends ToolCommand {
val writer = new PrintWriter(cmdArgs.outputVariants) val writer = new PrintWriter(cmdArgs.outputVariants)
writer.println(">" + cmdArgs.outputName) writer.println(">" + cmdArgs.outputName)
val vcfReader = new VCFFileReader(cmdArgs.inputVcf, false) val vcfReader = new VCFFileReader(cmdArgs.inputVcf, false)
for (vcfRecord <- vcfReader if (!cmdArgs.snpsOnly || vcfRecord.isSNP)) yield { for (vcfRecord <- vcfReader if !cmdArgs.snpsOnly || vcfRecord.isSNP) yield {
writer.print(getMaxAllele(vcfRecord)) writer.print(getMaxAllele(vcfRecord))
} }
writer.println() writer.println()
writer.close writer.close()
vcfReader.close vcfReader.close()
} }
protected def getMaxAllele(vcfRecord: VariantContext): String = { protected def getMaxAllele(vcfRecord: VariantContext): String = {
...@@ -276,6 +276,6 @@ object BastyGenerateFasta extends ToolCommand { ...@@ -276,6 +276,6 @@ object BastyGenerateFasta extends ToolCommand {
if (AD == null) return fillAllele("", maxSize) if (AD == null) return fillAllele("", maxSize)
val maxADid = AD.zipWithIndex.maxBy(_._1)._2 val maxADid = AD.zipWithIndex.maxBy(_._1)._2
if (AD(maxADid) < cmdArgs.minAD) return fillAllele("", maxSize) if (AD(maxADid) < cmdArgs.minAD) return fillAllele("", maxSize)
return fillAllele(vcfRecord.getAlleles()(maxADid).getBaseString, maxSize) fillAllele(vcfRecord.getAlleles()(maxADid).getBaseString, maxSize)
} }
} }
\ No newline at end of file
...@@ -53,19 +53,19 @@ object BedToInterval extends ToolCommand { ...@@ -53,19 +53,19 @@ object BedToInterval extends ToolCommand {
bedToInterval.input = inputBed bedToInterval.input = inputBed
bedToInterval.bamFile = inputBam bedToInterval.bamFile = inputBam
bedToInterval.output = output bedToInterval.output = output
return bedToInterval bedToInterval
} }
case class Args(inputFile: File = null, outputFile: File = null, bamFile: File = null) extends AbstractArgs case class Args(inputFile: File = null, outputFile: File = null, bamFile: File = null) extends AbstractArgs
class OptParser extends AbstractOptParser { class OptParser extends AbstractOptParser {
opt[File]('I', "inputFile") required () valueName ("<file>") action { (x, c) => opt[File]('I', "inputFile") required () valueName "<file>" action { (x, c) =>
c.copy(inputFile = x) c.copy(inputFile = x)
} }
opt[File]('o', "output") required () valueName ("<file>") action { (x, c) => opt[File]('o', "output") required () valueName "<file>" action { (x, c) =>
c.copy(outputFile = x) c.copy(outputFile = x)
} }
opt[File]('b', "bam") required () valueName ("<file>") action { (x, c) => opt[File]('b', "bam") required () valueName "<file>" action { (x, c) =>
c.copy(bamFile = x) c.copy(bamFile = x)
} }
} }
...@@ -85,12 +85,12 @@ object BedToInterval extends ToolCommand { ...@@ -85,12 +85,12 @@ object BedToInterval extends ToolCommand {
writer.write("@SQ\tSN:" + record.getSequenceName + "\tLN:" + record.getSequenceLength + "\n") writer.write("@SQ\tSN:" + record.getSequenceName + "\tLN:" + record.getSequenceLength + "\n")
record.getSequenceName -> record.getSequenceLength record.getSequenceName -> record.getSequenceLength
} }
inputSam.close inputSam.close()
val refsMap = Map(refs: _*) val refsMap = Map(refs: _*)
val bedFile = Source.fromFile(commandArgs.inputFile) val bedFile = Source.fromFile(commandArgs.inputFile)
for ( for (
line <- bedFile.getLines; line <- bedFile.getLines();
split = line.split("\t") if split.size >= 3; split = line.split("\t") if split.size >= 3;
chr = split(0); chr = split(0);
start = split(1); start = split(1);
...@@ -102,7 +102,7 @@ object BedToInterval extends ToolCommand { ...@@ -102,7 +102,7 @@ object BedToInterval extends ToolCommand {
else { else {
var strand = "+" var strand = "+"
for (t <- 3 until split.length) { for (t <- 3 until split.length) {
if ((split(t) == "+" || split(t) == "-")) strand = split(t) if (split(t) == "+" || split(t) == "-") strand = split(t)
} }
writer.write(strand) writer.write(strand)
} }
......
...@@ -21,8 +21,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable ...@@ -21,8 +21,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.core.{ ToolCommand, ToolCommandFuntion } import nl.lumc.sasc.biopet.core.{ ToolCommand, ToolCommandFuntion }
import org.broadinstitute.gatk.utils.commandline.{ Input, Output } import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import scala.collection.SortedMap import scala.collection.{ mutable, SortedMap }
import scala.collection.mutable.Map
import scala.io.Source import scala.io.Source
class BedtoolsCoverageToCounts(val root: Configurable) extends ToolCommandFuntion { class BedtoolsCoverageToCounts(val root: Configurable) extends ToolCommandFuntion {
...@@ -45,10 +44,10 @@ object BedtoolsCoverageToCounts extends ToolCommand { ...@@ -45,10 +44,10 @@ object BedtoolsCoverageToCounts extends ToolCommand {
case class Args(input: File = null, output: File = null) extends AbstractArgs case class Args(input: File = null, output: File = null) extends AbstractArgs
class OptParser extends AbstractOptParser { class OptParser extends AbstractOptParser {
opt[File]('I', "input") required () valueName ("<file>") action { (x, c) => opt[File]('I', "input") required () valueName "<file>" action { (x, c) =>
c.copy(input = x) c.copy(input = x)
} }
opt[File]('o', "output") required () unbounded () valueName ("<file>") action { (x, c) => opt[File]('o', "output") required () unbounded () valueName "<file>" action { (x, c) =>
c.copy(output = x) c.copy(output = x)
} }
} }
...@@ -62,8 +61,8 @@ object BedtoolsCoverageToCounts extends ToolCommand { ...@@ -62,8 +61,8 @@ object BedtoolsCoverageToCounts extends ToolCommand {
if (!commandArgs.input.exists) throw new IllegalStateException("Input file not found, file: " + commandArgs.input) if (!commandArgs.input.exists) throw new IllegalStateException("Input file not found, file: " + commandArgs.input)
val counts: Map[String, Long] = Map() val counts: mutable.Map[String, Long] = mutable.Map()
for (line <- Source.fromFile(commandArgs.input).getLines) { for (line <- Source.fromFile(commandArgs.input).getLines()) {
val values = line.split("\t") val values = line.split("\t")
val gene = values(3) val gene = values(3)
val count = values(6).toLong val count = values(6).toLong
...@@ -77,6 +76,6 @@ object BedtoolsCoverageToCounts extends ToolCommand { ...@@ -77,6 +76,6 @@ object BedtoolsCoverageToCounts extends ToolCommand {
for ((seq, count) <- sortedCounts) { for ((seq, count) <- sortedCounts) {
if (count > 0) writer.println(seq + "\t" + count) if (count > 0) writer.println(seq + "\t" + count)
} }
writer.close writer.close()
} }
} }
\ No newline at end of file
...@@ -25,6 +25,7 @@ import nl.lumc.sasc.biopet.utils.ConfigUtils ...@@ -25,6 +25,7 @@ import nl.lumc.sasc.biopet.utils.ConfigUtils
import org.broadinstitute.gatk.utils.commandline.{ Input, Output } import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import scala.collection.JavaConversions._ import scala.collection.JavaConversions._
import scala.collection.mutable
class BiopetFlagstat(val root: Configurable) extends ToolCommandFuntion with Summarizable { class BiopetFlagstat(val root: Configurable) extends ToolCommandFuntion with Summarizable {
javaMainClass = getClass.getName javaMainClass = getClass.getName
...@@ -63,13 +64,13 @@ object BiopetFlagstat extends ToolCommand { ...@@ -63,13 +64,13 @@ object BiopetFlagstat extends ToolCommand {
case class Args(inputFile: File = null, summaryFile: Option[File] = None, region: Option[String] = None) extends AbstractArgs case class Args(inputFile: File = null, summaryFile: Option[File] = None, region: Option[String] = None) extends AbstractArgs
class OptParser extends AbstractOptParser { class OptParser extends AbstractOptParser {
opt[File]('I', "inputFile") required () valueName ("<file>") action { (x, c) => opt[File]('I', "inputFile") required () valueName "<file>" action { (x, c) =>
c.copy(inputFile = x) c.copy(inputFile = x)
} text ("input bam file") } text "input bam file"
opt[File]('s', "summaryFile") valueName ("<file>") action { (x, c) => opt[File]('s', "summaryFile") valueName "<file>" action { (x, c) =>
c.copy(summaryFile = Some(x)) c.copy(summaryFile = Some(x))
} text ("summary output file") } text "summary output file"
opt[String]('r', "region") valueName ("<chr:start-stop>") action { (x, c) => opt[String]('r', "region") valueName "<chr:start-stop>" action { (x, c) =>
c.copy(region = Some(x)) c.copy(region = Some(x))
} }
} }
...@@ -82,7 +83,7 @@ object BiopetFlagstat extends ToolCommand { ...@@ -82,7 +83,7 @@ object BiopetFlagstat extends ToolCommand {
val commandArgs: Args = argsParser.parse(args, Args()) getOrElse sys.exit(1) val commandArgs: Args = argsParser.parse(args, Args()) getOrElse sys.exit(1)
val inputSam = SamReaderFactory.makeDefault.open(commandArgs.inputFile) val inputSam = SamReaderFactory.makeDefault.open(commandArgs.inputFile)
val iterSam = if (commandArgs.region == None) inputSam.iterator else { val iterSam = if (commandArgs.region.isEmpty) inputSam.iterator else {
val regionRegex = """(.*):(.*)-(.*)""".r val regionRegex = """(.*):(.*)-(.*)""".r
commandArgs.region.get match { commandArgs.region.get match {
case regionRegex(chr, start, stop) => inputSam.query(chr, start.toInt, stop.toInt, false) case regionRegex(chr, start, stop) => inputSam.query(chr, start.toInt, stop.toInt, false)
...@@ -91,7 +92,7 @@ object BiopetFlagstat extends ToolCommand { ...@@ -91,7 +92,7 @@ object BiopetFlagstat extends ToolCommand {
} }
val flagstatCollector = new FlagstatCollector val flagstatCollector = new FlagstatCollector
flagstatCollector.loadDefaultFunctions flagstatCollector.loadDefaultFunctions()
val m = 10 val m = 10
val max = 60 val max = 60
for (t <- 0 to (max / m)) for (t <- 0 to (max / m))
...@@ -144,12 +145,11 @@ object BiopetFlagstat extends ToolCommand { ...@@ -144,12 +145,11 @@ object BiopetFlagstat extends ToolCommand {
} }