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

Fix reference

parent 40f1af70
......@@ -17,20 +17,20 @@ package nl.lumc.sasc.biopet.extensions
import java.io.File
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import nl.lumc.sasc.biopet.core.{ Reference, BiopetCommandLineFunction }
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
/**
* Created by pjvan_thof on 3/3/15.
*/
class Freebayes(val root: Configurable) extends BiopetCommandLineFunction {
class Freebayes(val root: Configurable) extends BiopetCommandLineFunction with Reference {
@Input(required = true)
var bamfiles: List[File] = Nil
@Input(required = true)
var reference: File = config("reference")
var reference: File = _
@Output(required = true)
var outputVcf: File = null
......@@ -42,6 +42,11 @@ class Freebayes(val root: Configurable) extends BiopetCommandLineFunction {
override val versionRegex = """version: (.*)""".r
override def versionCommand = executable + " --version"
override def beforeGraph: Unit = {
super.beforeGraph
reference = referenceFasta()
}
def cmdLine = executable +
required("--fasta-reference", reference) +
repeat("--bam", bamfiles) +
......
......@@ -15,12 +15,13 @@
*/
package nl.lumc.sasc.biopet.extensions.samtools
import nl.lumc.sasc.biopet.core.Reference
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import java.io.File
/** Extension for samtools mpileup */
class SamtoolsMpileup(val root: Configurable) extends Samtools {
class SamtoolsMpileup(val root: Configurable) extends Samtools with Reference {
@Input(doc = "Bam File")
var input: List[File] = Nil
......@@ -28,7 +29,7 @@ class SamtoolsMpileup(val root: Configurable) extends Samtools {
var output: File = _
@Input(doc = "Reference fasta")
var reference: File = config("reference")
var reference: File = _
@Input(doc = "Interval bed", required = false)
var intervalBed: Option[File] = config("interval_bed")
......@@ -40,6 +41,11 @@ class SamtoolsMpileup(val root: Configurable) extends Samtools {
var depth: Option[Int] = config("depth")
var outputMappingQuality: Boolean = config("output_mapping_quality", default = false)
override def beforeGraph: Unit = {
super.beforeGraph
reference = referenceFasta()
}
def cmdBase = required(executable) +
required("mpileup") +
optional("-f", reference) +
......
......@@ -18,7 +18,7 @@ package nl.lumc.sasc.biopet.tools
import java.io.File
import java.io.PrintWriter
import htsjdk.samtools.SamReaderFactory
import nl.lumc.sasc.biopet.core.{ ToolCommandFuntion, BiopetJavaCommandLineFunction, ToolCommand }
import nl.lumc.sasc.biopet.core.{ Reference, ToolCommandFuntion, BiopetJavaCommandLineFunction, ToolCommand }
import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.extensions.samtools.SamtoolsMpileup
import nl.lumc.sasc.biopet.utils.ConfigUtils
......@@ -29,7 +29,7 @@ import scala.math.round
import scala.math.floor
import scala.collection.JavaConversions._
class MpileupToVcf(val root: Configurable) extends ToolCommandFuntion {
class MpileupToVcf(val root: Configurable) extends ToolCommandFuntion with Reference {
javaMainClass = getClass.getName
@Input(doc = "Input mpileup file", shortName = "mpileup", required = false)
......@@ -46,7 +46,7 @@ class MpileupToVcf(val root: Configurable) extends ToolCommandFuntion {
var homoFraction: Option[Double] = config("homoFraction")
var ploidy: Option[Int] = config("ploidy")
var sample: String = _
var reference: String = config("reference")
var reference: String = _
override val defaultCoreMemory = 3.0
......@@ -55,6 +55,7 @@ class MpileupToVcf(val root: Configurable) extends ToolCommandFuntion {
override def beforeGraph {
super.beforeGraph
reference = referenceFasta().getAbsolutePath
val samtoolsMpileup = new SamtoolsMpileup(this)
}
......
......@@ -21,7 +21,7 @@ import htsjdk.samtools.reference.FastaSequenceFile
import htsjdk.variant.variantcontext.{ Allele, VariantContext, Genotype }
import htsjdk.variant.vcf.VCFFileReader
import nl.lumc.sasc.biopet.core.summary.{ SummaryQScript, Summarizable }
import nl.lumc.sasc.biopet.core.{ ToolCommandFuntion, BiopetJavaCommandLineFunction, ToolCommand }
import nl.lumc.sasc.biopet.core.{ Reference, ToolCommandFuntion, BiopetJavaCommandLineFunction, ToolCommand }
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
import scala.collection.JavaConversions._
......@@ -35,7 +35,7 @@ import scala.util.Random
/**
* Created by pjvan_thof on 1/10/15.
*/
class VcfStats(val root: Configurable) extends ToolCommandFuntion with Summarizable {
class VcfStats(val root: Configurable) extends ToolCommandFuntion with Summarizable with Reference {
javaMainClass = getClass.getName
@Input(doc = "Input fastq", shortName = "I", required = true)
......@@ -59,9 +59,10 @@ class VcfStats(val root: Configurable) extends ToolCommandFuntion with Summariza
var genotypeTags: List[String] = Nil
var allInfoTags = false
var allGenotypeTags = false
var reference: File = config("reference")
var reference: File = _
override def beforeGraph: Unit = {
reference = referenceFasta()
index = new File(input.getAbsolutePath + ".tbi")
}
......
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