Commit e8ea73f7 authored by Peter van 't Hof's avatar Peter van 't Hof

Fix style

parent 78a3291b
......@@ -17,9 +17,9 @@ package nl.lumc.sasc.biopet.core
import java.io.File
import htsjdk.samtools.reference.IndexedFastaSequenceFile
import nl.lumc.sasc.biopet.core.summary.{Summarizable, SummaryQScript}
import nl.lumc.sasc.biopet.core.summary.{ Summarizable, SummaryQScript }
import nl.lumc.sasc.biopet.utils._
import nl.lumc.sasc.biopet.utils.config.{Config, Configurable}
import nl.lumc.sasc.biopet.utils.config.{ Config, Configurable }
import scala.collection.JavaConversions._
......@@ -185,7 +185,8 @@ object Reference {
s"""Species found in general config:
|- ${globalSpecies.keys.toList.sorted.mkString("\n- ")}
|$warn
|""".stripMargin else s"No references found in global config. $warn"))
|""".stripMargin
else s"No references found in global config. $warn"))
val globalReferences = globalSpecies.getOrElse(species, Map()).asInstanceOf[Map[String, Any]]
val referenceName = Question.string("reference_name",
......@@ -193,7 +194,8 @@ object Reference {
s"""Reference for $species found in general config:
|- ${globalReferences.keys.toList.sorted.mkString("\n- ")}
|$warn
|""".stripMargin else s"No references found in global config. $warn"))
|""".stripMargin
else s"No references found in global config. $warn"))
val reference = globalReferences.getOrElse(referenceName, Map()).asInstanceOf[Map[String, Any]]
val referenceFasta: Option[String] = if (reference.contains("reference_fasta")) None else {
......
......@@ -4,11 +4,11 @@ import java.io.File
import nl.lumc.sasc.biopet.utils.config.Config
import nl.lumc.sasc.biopet.utils.summary.Summary
import nl.lumc.sasc.biopet.utils.{ConfigUtils, Question, ToolCommand}
import nl.lumc.sasc.biopet.utils.{ ConfigUtils, Question, ToolCommand }
/**
* Created by pjvanthof on 17/12/2016.
*/
* Created by pjvanthof on 17/12/2016.
*/
trait TemplateTool extends ToolCommand {
import TemplateTool._
case class Args(expert: Boolean = false) extends AbstractArgs
......@@ -20,10 +20,10 @@ trait TemplateTool extends ToolCommand {
}
/**
* Program will split fastq file in multiple fastq files
*
* @param args the command line arguments
*/
* Program will split fastq file in multiple fastq files
*
* @param args the command line arguments
*/
def main(args: Array[String]): Unit = {
val argsParser = new OptParser
val cmdArgs: Args = argsParser.parse(args, Args()) getOrElse (throw new IllegalArgumentException)
......@@ -84,7 +84,7 @@ object TemplateTool {
val sizes = configs.map(new Summary(_)).map(x => (x.samples.size, x.libraries.map(_._2.size).sum))
val samples = sizes.map(_._1).sum
val libs = sizes.map(_._2).sum
val mergedConfig = new Summary(configs.foldLeft(Map[String, Any]())((a,b) => ConfigUtils.mergeMaps(a, b)))
val mergedConfig = new Summary(configs.foldLeft(Map[String, Any]())((a, b) => ConfigUtils.mergeMaps(a, b)))
val mergesSamples = mergedConfig.samples.size
val mergesLibraries = mergedConfig.libraries.map(_._2.size).sum
if (mergesSamples != samples) println("WARNING: Overlapping samples detected")
......
......@@ -15,7 +15,7 @@
package nl.lumc.sasc.biopet
import nl.lumc.sasc.biopet.core.PipelineStatus
import nl.lumc.sasc.biopet.utils.{BiopetExecutable, MainCommand}
import nl.lumc.sasc.biopet.utils.{ BiopetExecutable, MainCommand }
object BiopetExecutableMain extends BiopetExecutable {
def pipelines: List[MainCommand] = List(
......
package nl.lumc.sasc.biopet.utils
/**
* Created by pjvanthof on 16/12/2016.
*/
* Created by pjvanthof on 16/12/2016.
*/
object Question {
def string(name: String,
......@@ -31,8 +31,8 @@ object Question {
}
def boolean(name: String,
default: Option[Boolean] = None,
description: Option[String] = None): Boolean = {
default: Option[Boolean] = None,
description: Option[String] = None): Boolean = {
description.foreach(println)
default.foreach(x => println(s"Default value: $x"))
print(s"$name (y/n) > ")
......
......@@ -2,12 +2,12 @@ package nl.lumc.sasc.biopet.pipelines.mapping.template
import java.io.File
import nl.lumc.sasc.biopet.core.{Reference, TemplateTool}
import nl.lumc.sasc.biopet.core.{ Reference, TemplateTool }
import nl.lumc.sasc.biopet.utils.Question
/**
* Created by pjvanthof on 17/12/2016.
*/
* Created by pjvanthof on 17/12/2016.
*/
object MultiSampleMapping extends TemplateTool {
override lazy val sampleConfigs: List[File] = TemplateTool.askSampleConfigs()
......@@ -19,10 +19,10 @@ object MultiSampleMapping extends TemplateTool {
val referenceConfig = map ++ Reference.askReference
val aligner = if (map.contains("aligner")) map("aligner").toString
else Question.string("Aligner", posibleValues = possibleAligners, default = Some("bwa-mem"))
else Question.string("Aligner", posibleValues = possibleAligners, default = Some("bwa-mem"))
referenceConfig ++ Map(
"aligner" -> aligner
)
)
}
}
......@@ -178,14 +178,14 @@ class ShivaVariantcalling(val root: Configurable) extends QScript
object ShivaVariantcalling extends PipelineCommand {
/** Will generate all available variantcallers */
protected[shiva] def callersList(root: Configurable): List[Variantcaller] =
new HaplotypeCallerGvcf(root) ::
new HaplotypeCallerAllele(root) ::
new UnifiedGenotyperAllele(root) ::
new UnifiedGenotyper(root) ::
new HaplotypeCaller(root) ::
new Freebayes(root) ::
new RawVcf(root) ::
new Bcftools(root) ::
new BcftoolsSingleSample(root) ::
new VarscanCnsSingleSample(root) :: Nil
new HaplotypeCallerGvcf(root) ::
new HaplotypeCallerAllele(root) ::
new UnifiedGenotyperAllele(root) ::
new UnifiedGenotyper(root) ::
new HaplotypeCaller(root) ::
new Freebayes(root) ::
new RawVcf(root) ::
new Bcftools(root) ::
new BcftoolsSingleSample(root) ::
new VarscanCnsSingleSample(root) :: Nil
}
\ No newline at end of file
......@@ -8,8 +8,8 @@ import nl.lumc.sasc.biopet.pipelines.shiva.ShivaVariantcalling
import nl.lumc.sasc.biopet.utils.Question
/**
* Created by pjvanthof on 17/12/2016.
*/
* Created by pjvanthof on 17/12/2016.
*/
object Shiva extends TemplateTool {
override lazy val sampleConfigs: List[File] = TemplateTool.askSampleConfigs()
......@@ -30,6 +30,6 @@ object Shiva extends TemplateTool {
"variantcallers" -> variantCallers,
"use_indel_realigner" -> useIndelRealigner,
"use_base_recalibration" -> useBaseRecalibration
)
)
}
}
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