Skip to content
Snippets Groups Projects
Commit bdca6a2d authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Changed defaults and fix the pindelconfig script.

parent 9db6c09d
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ import java.io.File
import nl.lumc.sasc.biopet.core.{ BiopetCommandLineFunction, Reference, Version }
import nl.lumc.sasc.biopet.utils.Logging
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Argument, Input }
import org.broadinstitute.gatk.utils.commandline._
/**
* Extension for pindel
......@@ -29,7 +29,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Argument, Input }
*/
class PindelCaller(val root: Configurable) extends BiopetCommandLineFunction with Reference with Version {
executable = config("exe", default = "pindel", freeVar = false)
executable = config("exe", default = "pindel")
override def defaultCoreMemory = 3.0
override def defaultThreads = 4
......@@ -46,15 +46,18 @@ class PindelCaller(val root: Configurable) extends BiopetCommandLineFunction wit
@Input(doc = "Input specification for Pindel to use")
var input: File = _
@Argument(doc = "The pindel configuration file")
@Argument(doc = "The pindel configuration file", required = false)
var pindel_file: Option[File] = None
@Argument(doc = "Configuration file with: bam-location/insert size/name")
@Argument(doc = "Configuration file with: bam-location/insert size/name", required = false)
var config_file: Option[File] = None
@Argument(doc = "Work directory")
var output_prefix: File = _
@Output(doc = "Output file of pindel, pointing to the DEL file")
var output_file: File = _
var RP: Option[Int] = config("RP")
var min_distance_to_the_end: Option[Int] = config("min_distance_to_the_end")
// var threads
......@@ -66,16 +69,16 @@ class PindelCaller(val root: Configurable) extends BiopetCommandLineFunction wit
var maximum_allowed_mismatch_rate: Option[Float] = config("maximum_allowed_mismatch_rate")
var nm: Option[Int] = config("nm")
var report_inversions: Boolean = config("report_inversions")
var report_duplications: Boolean = config("report_duplications")
var report_long_insertions: Boolean = config("report_long_insertions")
var report_breakpoints: Boolean = config("report_breakpoints")
var report_close_mapped_reads: Boolean = config("report_close_mapped_reads")
var report_only_close_mapped_reads: Boolean = config("report_only_close_mapped_reads")
var report_interchromosomal_events: Boolean = config("report_interchromosomal_events")
var report_inversions: Boolean = config("report_inversions", default = false)
var report_duplications: Boolean = config("report_duplications", default = false)
var report_long_insertions: Boolean = config("report_long_insertions", default = false)
var report_breakpoints: Boolean = config("report_breakpoints", default = false)
var report_close_mapped_reads: Boolean = config("report_close_mapped_reads", default = false)
var report_only_close_mapped_reads: Boolean = config("report_only_close_mapped_reads", default = false)
var report_interchromosomal_events: Boolean = config("report_interchromosomal_events", default = false)
var IndelCorrection: Boolean = config("IndelCorrection")
var NormalSamples: Boolean = config("NormalSamples")
var IndelCorrection: Boolean = config("IndelCorrection", default = false)
var NormalSamples: Boolean = config("NormalSamples", default = false)
var breakdancer: Option[File] = config("breakdancer")
var include: Option[File] = config("include")
......@@ -90,12 +93,12 @@ class PindelCaller(val root: Configurable) extends BiopetCommandLineFunction wit
var minimum_support_for_event: Option[Int] = config("minimum_support_for_event")
var input_SV_Calls_for_assembly: Option[File] = config("input_SV_Calls_for_assembly")
var genotyping: Boolean = config("genotyping")
var genotyping: Boolean = config("genotyping", default = false)
var output_of_breakdancer_events: Option[File] = config("output_of_breakdancer_events")
var name_of_logfile: Option[File] = config("name_of_logfile")
var Ploidy: Option[File] = config("ploidy")
var detect_DD: Boolean = config("detect_DD")
var detect_DD: Boolean = config("detect_DD", default = false)
var MAX_DD_BREAKPOINT_DISTANCE: Option[Int] = config("MAX_DD_BREAKPOINT_DISTANCE")
var MAX_DISTANCE_CLUSTER_READS: Option[Int] = config("MAX_DISTANCE_CLUSTER_READS")
......@@ -119,6 +122,9 @@ class PindelCaller(val root: Configurable) extends BiopetCommandLineFunction wit
input = b.getAbsoluteFile
}
}
// set the output file
output_file = new File(output_prefix, "_D")
}
def cmdLine = required(executable) +
......
......@@ -57,8 +57,8 @@ object PindelConfig extends ToolCommand {
opt[Int]('s', "insertsize") valueName "<insertsize>" action { (x, c) =>
c.copy(insertsize = Some(x))
} text "Insertsize is missing"
opt[Int]('o', "output") valueName "<output>" action { (x, c) =>
c.copy(insertsize = Some(x))
opt[File]('o', "output") valueName "<output>" action { (x, c) =>
c.copy(output = Some(x))
} text "Output path is missing"
}
......@@ -75,8 +75,8 @@ object PindelConfig extends ToolCommand {
val bamReader = SamReaderFactory.makeDefault().open(input)
val writer = new PrintWriter(output)
for (readgroup <- bamReader.getFileHeader.getReadGroups().toList) {
writer.write(s"${input.getAbsoluteFile}\t${insertsize}\t${readgroup.getSample}\n")
for (samplename <- bamReader.getFileHeader.getReadGroups.map(_.getSample).distinct) {
writer.write("%s\t%d\t%s\n".format(input.getAbsoluteFile, insertsize, samplename))
}
bamReader.close()
writer.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment