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

Added raxml to Basty

parent 7f249dcf
......@@ -10,7 +10,7 @@ class Raxml(val root: Configurable) extends BiopetCommandLineFunction {
override val defaultThreads = 4
override def versionCommand = executable + " -v"
override val versionRegex = """.*version \w* .*""".r
@Input(doc = "Input phy/fasta file", required = true)
var input: File = _
......@@ -28,35 +28,35 @@ class Raxml(val root: Configurable) extends BiopetCommandLineFunction {
@Argument(doc = "Name of output files", required = true)
var n: String = _
@Argument(doc = "Name of output files", required = true)
var f: String = "d"
@Argument(doc = "Output directory", required = false)
var w: String = jobLocalDir.getAbsolutePath
@Input(required = false)
var t: File = _
@Input(required = false)
var z: File = _
@Output(doc = "Output files", required = false)
private var out: List[File] = Nil
executable = config("exe", default = "raxmlHPC")
override def afterGraph {
super.afterGraph
f match {
case "d" if b.isEmpty => out +:= getBestTree
case "d" if b.isEmpty => out +:= getBestTree
case "d" if b.isDefined => out +:= getBootstrap
}
}
def getBestTree: File = new File(w + File.separator + "RAxML_bestTree." + n)
def getBootstrap: File = new File(w + File.separator + "RAxML_bootstrap." + n)
def cmdLine = required(executable) +
required("-m", m) +
required("-s", input) +
......
package nl.lumc.sasc.biopet.pipelines.basty
import java.io.File
import nl.lumc.sasc.biopet.core.MultiSampleQScript
import nl.lumc.sasc.biopet.core.PipelineCommand
import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.extensions.Cat
import nl.lumc.sasc.biopet.extensions.Raxml
import nl.lumc.sasc.biopet.pipelines.gatk.GatkPipeline
import nl.lumc.sasc.biopet.tools.BastyGenerateFasta
import org.broadinstitute.gatk.queue.QScript
......@@ -38,8 +40,43 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
runSamplesJobs()
add(Cat(this, refVariants :: samplesOutput.map(_._2.outputVariants).toList, outputDir + "fastas/variant.fasta"))
add(Cat(this, refVariantSnps :: samplesOutput.map(_._2.outputVariantsSnps).toList, outputDir + "fastas/variant.snps_only.fasta"))
val catVariants = Cat(this, refVariants :: samplesOutput.map(_._2.outputVariants).toList, outputDir + "fastas/variant.fasta")
add(catVariants)
val catVariantsSnps = Cat(this, refVariantSnps :: samplesOutput.map(_._2.outputVariantsSnps).toList, outputDir + "fastas/variant.snps_only.fasta")
add(catVariantsSnps)
val seed = scala.util.Random.nextInt
def addRaxml(input: File, outputDir: String, outputName: String) {
val raxmlMl = new Raxml(this)
raxmlMl.input = input
raxmlMl.m = config("raxml_ml_model", default = "GTRGAMMAX")
raxmlMl.p = config("seed", default = seed)
raxmlMl.n = outputName + "_ml"
raxmlMl.w = outputDir
raxmlMl.N = config("ml_runs", default = 20, submodule = "raxml")
add(raxmlMl)
val raxmlBoot = new Raxml(this)
raxmlMl.input = input
raxmlBoot.m = config("raxml_ml_model", default = "GTRGAMMAX")
raxmlBoot.p = config("seed", default = seed)
raxmlBoot.b = config("seed", default = seed)
raxmlBoot.w = outputDir
raxmlBoot.n = outputName + "_boot"
add(raxmlBoot)
val raxmlBi = new Raxml(this)
raxmlMl.input = input
raxmlBi.t = raxmlMl.getBestTree
raxmlBi.z = raxmlBoot.getBootstrap
raxmlBi.m = config("raxml_ml_model", default = "GTRGAMMAX")
raxmlBi.p = config("seed", default = seed)
raxmlBi.n = outputName + "_bi"
raxmlBi.w = outputDir
add(raxmlBi)
}
addRaxml(catVariantsSnps.output, outputDir + "raxml", "snps")
}
// Called for each sample
......
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