Commit eebab126 authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Pindel update wrapper, specifing the output files (pindel generates more files)

parent 314d4942
......@@ -59,6 +59,21 @@ class PindelCaller(val root: Configurable) extends BiopetCommandLineFunction wit
@Output(doc = "Output file of pindel, pointing to the DEL file")
var outputFile: File = _
@Output(doc="", required=false)
var outputINV: File = _
@Output(doc="", required=false)
var outputTD: File = _
@Output(doc="", required=false)
var outputLI: File = _
@Output(doc="", required=false)
var outputBP: File = _
@Output(doc="", required=false)
var outputSI: File = _
@Output(doc="", required=false)
var outputRP: File = _
@Output(doc="", required=false)
var outputCloseEndMapped: File = _
var RP: Option[Int] = config("RP")
var minDistanceToTheEnd: Option[Int] = config("min_distance_to_the_end")
// var threads
......@@ -126,6 +141,23 @@ class PindelCaller(val root: Configurable) extends BiopetCommandLineFunction wit
}
}
/** setting the output files for the many outputfiles pindel has */
outputINV = new File(outputPrefix + File.separator, "sample_INV")
outputTD = new File(outputPrefix + File.separator, "sample_TD")
if (reportLongInsertions) {
outputLI = new File(outputPrefix + File.separator, "sample_LI")
}
if (reportBreakpoints){
outputBP = new File(outputPrefix + File.separator, "sample_BP")
}
outputSI = new File(outputPrefix + File.separator, "sample_SI")
outputRP = new File(outputPrefix + File.separator, "sample_RP")
if (reportCloseMappedReads) {
outputCloseEndMapped = new File(outputPrefix + File.separator, "sample_CloseEndMapped")
}
// set the output file, the DELetion call is always made
// TODO: add more outputs for the LI, SI, INV etc...
outputFile = new File(outputPrefix + File.separator, "sample_D")
......
......@@ -15,8 +15,8 @@ class PindelVCF(val root: Configurable) extends BiopetCommandLineFunction with R
override def defaultCoreMemory = 2.0
override def defaultThreads = 1
def versionRegex = """Version:? (.*)""".r
override def versionExitcode = List(1)
def versionRegex = """Version:?[ ]+(.*)""".r
override def versionExitcode = List(0)
def versionCommand = executable + " -h"
/**
......@@ -28,12 +28,15 @@ class PindelVCF(val root: Configurable) extends BiopetCommandLineFunction with R
@Output
var outputVCF: File = _
var referenceDate: String = config("reference_date", freeVar = false)
var rDate: String = config("rdate", freeVar = false)
override def beforeGraph: Unit = {
if (reference == null) reference = referenceFasta()
}
@Input
var pindelOutputInputHolder: File = _
var pindelOutput: Option[File] = config("pindel_output")
var pindelOutputRoot: Option[File] = config("pindel_output_root")
var chromosome: Option[String] = config("chromosome")
......@@ -60,8 +63,9 @@ class PindelVCF(val root: Configurable) extends BiopetCommandLineFunction with R
var gatkCompatible: Boolean = config("gatk_compatible", default = false)
def cmdLine = required(executable) +
required("--reference", reference) +
required("--reference_name", referenceSpecies) +
required("--reference_date", referenceDate) +
required("--reference_date", rDate) +
optional("--pindel_output", pindelOutput) +
optional("--pindel_output_root", pindelOutputRoot) +
required("--vcf", outputVCF) +
......
......@@ -29,6 +29,11 @@ class Pindel(val root: Configurable) extends SvCaller {
def this() = this(null)
/** Default pipeline config */
override def defaults = Map("pindelvcf" -> Map(
"rdate" -> new SimpleDateFormat("yyyyMMdd").format(Calendar.getInstance().getTime())
))
def biopetScript() {
for ((sample, bamFile) <- inputBams) {
val pindelDir = new File(outputDir, sample)
......@@ -51,8 +56,9 @@ class Pindel(val root: Configurable) extends SvCaller {
val todayformat = new SimpleDateFormat("yyyyMMdd")
val pindelVcf = new PindelVCF(this)
pindelVcf.pindelOutputRoot = Some(pindelDir)
pindelVcf.referenceDate = todayformat.format(today) // officially, we should enter the date of the genome here
pindelVcf.pindelOutputInputHolder = pindel.outputFile
pindelVcf.pindelOutputRoot = Some(new File(pindelDir, "sample"))
pindelVcf.rDate = todayformat.format(today) // officially, we should enter the date of the genome here
pindelVcf.outputVCF = new File(pindelDir, s"${sample}.pindel.vcf")
add(pindelVcf)
}
......
Supports Markdown
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