Skip to content
Snippets Groups Projects
Commit f1441306 authored by bow's avatar bow
Browse files

Merge branch 'develop' into feature-gentrap

Conflicts:
	public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Tophat.scala
	public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/picard/CollectAlignmentSummaryMetrics.scala
	public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/picard/CollectInsertSizeMetrics.scala
	public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/picard/MarkDuplicates.scala
	public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/picard/Picard.scala
parents 848279f4 5d854a9f
No related branches found
No related tags found
No related merge requests found
Showing
with 56 additions and 9 deletions
......@@ -21,7 +21,10 @@ import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Argument, Input, Output }
class TopHat(val root: Configurable) extends BiopetCommandLineFunction {
/**
* Extension for Tophat
*/
class Tophat(val root: Configurable) extends BiopetCommandLineFunction {
@Input(doc = "FastQ file(s) R1", shortName = "R1")
var R1: List[File] = List.empty[File]
......
......@@ -7,6 +7,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
/**
* Extension for VariantEffectPredictor
* Created by ahbbollen on 15-1-15.
*/
class VariantEffectPredictor(val root: Configurable) extends BiopetCommandLineFunction {
......@@ -134,6 +135,7 @@ class VariantEffectPredictor(val root: Configurable) extends BiopetCommandLineFu
}
}
/** Returns command to execute */
def cmdLine = required(executable) +
required(vep_script) +
required("-i", input) +
......
......@@ -27,6 +27,7 @@ class WigToBigWig(val root: Configurable) extends BiopetCommandLineFunction {
var clip: Boolean = config("clip", default = false)
var unc: Boolean = config("unc", default = false)
/** Returns command to execute */
def cmdLine = required(executable) +
optional("-blockSize=", blockSize, spaceSeparated = false) +
optional("-itemsPerSlot=", itemsPerSlot, spaceSeparated = false) +
......
......@@ -20,6 +20,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import java.io.File
/** Extension for zcat */
class Zcat(val root: Configurable) extends BiopetCommandLineFunction {
@Input(doc = "Zipped file")
var input: File = _
......@@ -29,10 +30,12 @@ class Zcat(val root: Configurable) extends BiopetCommandLineFunction {
executable = config("exe", default = "zcat")
/** Returns command to execute */
def cmdLine = required(executable) + required(input) + " > " + required(output)
}
object Zcat {
/** Returns a default zcat */
def apply(root: Configurable, input: File, output: File): Zcat = {
val zcat = new Zcat(root)
zcat.input = input
......
......@@ -17,6 +17,7 @@ package nl.lumc.sasc.biopet.extensions.bedtools
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
/** General abstract class for bedtools extensions */
abstract class Bedtools extends BiopetCommandLineFunction {
override def subPath = "bedtools" :: super.subPath
executable = config("exe", default = "bedtools", submodule = "bedtools")
......
......@@ -19,6 +19,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output, Argument }
import java.io.File
/** Extension for bedtools coverage */
class BedtoolsCoverage(val root: Configurable) extends Bedtools {
@Input(doc = "Input file (bed/gff/vcf/bam)")
......@@ -45,6 +46,7 @@ class BedtoolsCoverage(val root: Configurable) extends Bedtools {
if (input.getName.endsWith(".bam")) inputTag = "-abam"
}
/** Returns command to execute */
def cmdLine = required(executable) + required("coverage") +
required(inputTag, input) +
required("-b", intersectFile) +
......@@ -55,6 +57,7 @@ class BedtoolsCoverage(val root: Configurable) extends Bedtools {
}
object BedtoolsCoverage {
/** Returns defaul bedtools coverage */
def apply(root: Configurable, input: File, intersect: File, output: File,
depth: Boolean = true, sameStrand: Boolean = false, diffStrand: Boolean = false): BedtoolsCoverage = {
val bedtoolsCoverage = new BedtoolsCoverage(root)
......@@ -64,6 +67,6 @@ object BedtoolsCoverage {
bedtoolsCoverage.depth = depth
bedtoolsCoverage.sameStrand = sameStrand
bedtoolsCoverage.diffStrand = diffStrand
return bedtoolsCoverage
bedtoolsCoverage
}
}
\ No newline at end of file
......@@ -19,6 +19,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output, Argument }
import java.io.File
/** Extension for bedtools intersect */
class BedtoolsIntersect(val root: Configurable) extends Bedtools {
@Input(doc = "Input file (bed/gff/vcf/bam)")
......@@ -42,6 +43,7 @@ class BedtoolsIntersect(val root: Configurable) extends Bedtools {
if (input.getName.endsWith(".bam")) inputTag = "-abam"
}
/** Returns command to execute */
def cmdLine = required(executable) + required("intersect") +
required(inputTag, input) +
required("-b", intersectFile) +
......@@ -51,6 +53,7 @@ class BedtoolsIntersect(val root: Configurable) extends Bedtools {
}
object BedtoolsIntersect {
/** Returns default bedtools intersect */
def apply(root: Configurable, input: File, intersect: File, output: File,
minOverlap: Double = 0, count: Boolean = false): BedtoolsIntersect = {
val bedtoolsIntersect = new BedtoolsIntersect(root)
......
......@@ -3,6 +3,8 @@ package nl.lumc.sasc.biopet.extensions.bwa
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
/**
* General bwa extension
*
* Created by pjvan_thof on 1/16/15.
*/
abstract class Bwa extends BiopetCommandLineFunction {
......
......@@ -6,6 +6,10 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
/**
* Extension for bwa aln
*
* Based on version 0.7.12-r1039
*
* Created by pjvan_thof on 1/16/15.
*/
class BwaAln(val root: Configurable) extends Bwa {
......@@ -44,6 +48,7 @@ class BwaAln(val root: Configurable) extends Bwa {
override val defaultVmem = "5G"
override val defaultThreads = 8
/** Returns command to execute */
def cmdLine = required(executable) +
required("aln") +
optional("-n", n) +
......
......@@ -22,6 +22,11 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.core.summary.Summarizable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/**
* Extension for bwa mem
*
* Based on version 0.7.12-r1039
*/
class BwaMem(val root: Configurable) extends Bwa {
@Input(doc = "Fastq file R1", shortName = "R1")
var R1: File = _
......
......@@ -10,7 +10,6 @@ import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
*
* based on executable version 0.7.10-r789
*
* @param root Configurable
*/
class BwaSampe(val root: Configurable) extends Bwa {
@Input(doc = "Fastq file R1", required = true)
......
......@@ -6,7 +6,10 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
/**
* Created by pjvan_thof on 1/16/15.
* BWA samse wrapper
*
* based on executable version 0.7.10-r789
*
*/
class BwaSamse(val root: Configurable) extends Bwa {
@Input(doc = "Fastq file", required = true)
......@@ -24,6 +27,7 @@ class BwaSamse(val root: Configurable) extends Bwa {
var n: Option[Int] = config("n")
var r: String = _
/** Returns command to execute */
def cmdLine = required(executable) +
required("samse") +
optional("-n", n) +
......
......@@ -6,6 +6,7 @@ package nl.lumc.sasc.biopet.extensions.igvtools
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
/** General igvtools extension */
abstract class IGVTools extends BiopetCommandLineFunction {
executable = config("exe", default = "igvtools", submodule = "igvtools", freeVar = false)
override def versionCommand = executable + " version"
......
......@@ -61,6 +61,7 @@ class IGVToolsCount(val root: Configurable) extends IGVTools {
throw new IllegalArgumentException("TDF file should have a .tdf file-extension"))
}
/** Returns command to execute */
def cmdLine = {
required(executable) +
required("count") +
......@@ -81,10 +82,7 @@ class IGVToolsCount(val root: Configurable) extends IGVTools {
required(genomeChromSizes)
}
/**
* This part should never fail, these values are set within this wrapper
*
*/
/** This part should never fail, these values are set within this wrapper */
private def outputArg: String = {
(tdf, wig) match {
case (None, None) => throw new IllegalArgumentException("Either TDF or WIG should be supplied");
......
......@@ -3,6 +3,8 @@ package nl.lumc.sasc.biopet.extensions.macs2
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
/**
* General igvtools extension
*
* Created by sajvanderzeeuw on 12/19/14.
*/
abstract class Macs2 extends BiopetCommandLineFunction {
......
......@@ -5,6 +5,7 @@ import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
/** Extension for macs2*/
class Macs2CallPeak(val root: Configurable) extends Macs2 {
@Input(doc = "Treatment input", required = true)
var treatment: File = _
......@@ -56,6 +57,7 @@ class Macs2CallPeak(val root: Configurable) extends Macs2 {
var broadcutoff: Option[Int] = config("broadcutoff")
var callsummits: Boolean = config("callsummits", default = false)
/** Sets output files */
override def beforeGraph: Unit = {
if (name.isEmpty) throw new IllegalArgumentException("Name is not defined")
if (outputdir == null) throw new IllegalArgumentException("Outputdir is not defined")
......@@ -67,6 +69,7 @@ class Macs2CallPeak(val root: Configurable) extends Macs2 {
output_gapped = new File(outputdir + name.get + ".gappedPeak")
}
/** Returns command to execute */
def cmdLine = {
required(executable) + required("callpeak") +
required("--treatment", treatment) + /* Treatment sample */
......
......@@ -19,6 +19,7 @@ import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output, Argument }
/** Extension for picard AddOrReplaceReadGroups */
class AddOrReplaceReadGroups(val root: Configurable) extends Picard {
javaMainClass = "picard.sam.AddOrReplaceReadGroups"
......@@ -61,6 +62,7 @@ class AddOrReplaceReadGroups(val root: Configurable) extends Picard {
@Argument(doc = "RGPI", required = false)
var RGPI: Option[Int] = _
/** Returns command to execute */
override def commandLine = super.commandLine +
required("INPUT=", input, spaceSeparated = false) +
required("OUTPUT=", output, spaceSeparated = false) +
......@@ -77,6 +79,7 @@ class AddOrReplaceReadGroups(val root: Configurable) extends Picard {
}
object AddOrReplaceReadGroups {
/** Returns default AddOrReplaceReadGroups */
def apply(root: Configurable, input: File, output: File, sortOrder: String = null): AddOrReplaceReadGroups = {
val addOrReplaceReadGroups = new AddOrReplaceReadGroups(root)
addOrReplaceReadGroups.input = input
......
......@@ -19,6 +19,7 @@ import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output, Argument }
/** Extension for picard CalculateHsMetrics */
class CalculateHsMetrics(val root: Configurable) extends Picard {
javaMainClass = "picard.analysis.directed.CalculateHsMetrics"
......@@ -46,6 +47,7 @@ class CalculateHsMetrics(val root: Configurable) extends Picard {
@Argument(doc = "BAIT_SET_NAME", required = false)
var baitSetName: String = _
/** Returns command to execute */
override def commandLine = super.commandLine +
required("INPUT=", input, spaceSeparated = false) +
required("OUTPUT=", output, spaceSeparated = false) +
......@@ -58,6 +60,7 @@ class CalculateHsMetrics(val root: Configurable) extends Picard {
}
object CalculateHsMetrics {
/** Returns default CalculateHsMetrics */
def apply(root: Configurable, input: File, baitIntervals: File, targetIntervals: File, outputDir: File): CalculateHsMetrics = {
val calculateHsMetrics = new CalculateHsMetrics(root)
calculateHsMetrics.input = input
......
......@@ -20,6 +20,7 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.core.summary.Summarizable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output, Argument }
/** Extension for picard CollectAlignmentSummaryMetrics */
class CollectAlignmentSummaryMetrics(val root: Configurable) extends Picard with Summarizable {
javaMainClass = "picard.analysis.CollectAlignmentSummaryMetrics"
......@@ -50,6 +51,7 @@ class CollectAlignmentSummaryMetrics(val root: Configurable) extends Picard with
@Argument(doc = "STOP_AFTER", required = false)
var stopAfter: Option[Long] = config("stopAfter")
/** Returns command to execute */
override def commandLine = super.commandLine +
required("INPUT=", input, spaceSeparated = false) +
required("OUTPUT=", output, spaceSeparated = false) +
......@@ -63,6 +65,7 @@ class CollectAlignmentSummaryMetrics(val root: Configurable) extends Picard with
def summaryFiles: Map[String, File] = Map()
/** Returns stats for summary */
def summaryStats: Map[String, Any] = Picard.getMetrics(output) match {
case None => Map()
case Some((header, content)) =>
......@@ -79,6 +82,7 @@ class CollectAlignmentSummaryMetrics(val root: Configurable) extends Picard with
}
object CollectAlignmentSummaryMetrics {
/** Returns default CollectAlignmentSummaryMetrics */
def apply(root: Configurable, input: File, outputDir: File): CollectAlignmentSummaryMetrics = {
val collectAlignmentSummaryMetrics = new CollectAlignmentSummaryMetrics(root)
collectAlignmentSummaryMetrics.input = input
......
......@@ -19,6 +19,7 @@ import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output, Argument }
/** Extension for picard CollectGcBiasMetrics */
class CollectGcBiasMetrics(val root: Configurable) extends Picard {
javaMainClass = "picard.analysis.CollectGcBiasMetrics"
......@@ -51,9 +52,9 @@ class CollectGcBiasMetrics(val root: Configurable) extends Picard {
override def beforeGraph {
if (outputChart == null) outputChart = new File(output + ".pdf")
//require(reference.exists)
}
/** Returns command to execute */
override def commandLine = super.commandLine +
repeat("INPUT=", input, spaceSeparated = false) +
required("OUTPUT=", output, spaceSeparated = false) +
......@@ -67,6 +68,7 @@ class CollectGcBiasMetrics(val root: Configurable) extends Picard {
}
object CollectGcBiasMetrics {
/** Returns default CollectGcBiasMetrics */
def apply(root: Configurable, input: File, outputDir: File): CollectGcBiasMetrics = {
val collectGcBiasMetrics = new CollectGcBiasMetrics(root)
collectGcBiasMetrics.input :+= input
......
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