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

Added objects again

parent 298ca175
......@@ -5,23 +5,6 @@
*/
package nl.lumc.sasc.biopet.extensions.gatk.broad
//import java.io.File
//
//import nl.lumc.sasc.biopet.utils.config.Configurable
//
//class AnalyzeCovariates(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.AnalyzeCovariates with GatkGeneral {
//}
//
//object AnalyzeCovariates {
// def apply(root: Configurable, before: File, after: File, plots: File): AnalyzeCovariates = {
// val ac = new AnalyzeCovariates(root)
// ac.before = before
// ac.after = after
// ac.plots = plots
// ac
// }
//}
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
......@@ -175,3 +158,13 @@ class AnalyzeCovariates(val root: Configurable) extends CommandLineGATK with Sca
conditional(filter_mismatching_base_and_quals, "-filterMBQ", escape = true, format = "%s") +
conditional(filter_bases_not_stored, "-filterNoBases", escape = true, format = "%s")
}
object AnalyzeCovariates {
def apply(root: Configurable, before: File, after: File, plots: File): AnalyzeCovariates = {
val ac = new AnalyzeCovariates(root)
ac.before = before
ac.after = after
ac.plots = plots
ac
}
}
......@@ -15,14 +15,6 @@ package nl.lumc.sasc.biopet.extensions.gatk.broad
// if (config.contains("known_sites")) knownSites :+= new File(config("known_sites").asString)
//}
//
//object BaseRecalibrator {
// def apply(root: Configurable, input: File, output: File): BaseRecalibrator = {
// val br = new BaseRecalibrator(root)
// br.input_file :+= input
// br.out = output
// br
// }
//}
import java.io.File
......@@ -489,3 +481,12 @@ class BaseRecalibrator(val root: Configurable) extends CommandLineGATK /* with S
conditional(filter_mismatching_base_and_quals, "-filterMBQ", escape = true, format = "%s") +
conditional(filter_bases_not_stored, "-filterNoBases", escape = true, format = "%s")
}
object BaseRecalibrator {
def apply(root: Configurable, input: File, output: File): BaseRecalibrator = {
val br = new BaseRecalibrator(root)
br.input_file :+= input
br.out = output
br
}
}
......@@ -34,16 +34,6 @@ package nl.lumc.sasc.biopet.extensions.gatk.broad
// if (out.getName.endsWith(".vcf.gz")) vcfIndex = new File(out.getAbsolutePath + ".tbi")
// }
//}
//
//object GenotypeGVCFs {
// def apply(root: Configurable, gvcfFiles: List[File], output: File): GenotypeGVCFs = {
// val gg = new GenotypeGVCFs(root)
// gg.variant = gvcfFiles
// gg.out = output
// if (gg.out.getName.endsWith(".vcf.gz")) gg.vcfIndex = new File(gg.out.getAbsolutePath + ".tbi")
// gg
// }
//}
import java.io.File
......@@ -394,3 +384,13 @@ class GenotypeGVCFs(val root: Configurable) extends CommandLineGATK with Scatter
conditional(filter_mismatching_base_and_quals, "-filterMBQ", escape = true, format = "%s") +
conditional(filter_bases_not_stored, "-filterNoBases", escape = true, format = "%s")
}
object GenotypeGVCFs {
def apply(root: Configurable, gvcfFiles: List[File], output: File): GenotypeGVCFs = {
val gg = new GenotypeGVCFs(root)
gg.variant = gvcfFiles
gg.out = output
//if (gg.out.getName.endsWith(".vcf.gz")) gg.vcfIndex = new File(gg.out.getAbsolutePath + ".tbi")
gg
}
}
......@@ -57,23 +57,6 @@ package nl.lumc.sasc.biopet.extensions.gatk.broad
// }
//}
//
//object HaplotypeCaller {
// def apply(root: Configurable, inputFiles: List[File], outputFile: File): HaplotypeCaller = {
// val hc = new HaplotypeCaller(root)
// hc.input_file = inputFiles
// hc.out = outputFile
// if (hc.out.getName.endsWith(".vcf.gz")) hc.vcfIndex = new File(hc.out.getAbsolutePath + ".tbi")
// hc
// }
//
// def gvcf(root: Configurable, inputFile: File, outputFile: File): HaplotypeCaller = {
// val hc = apply(root, List(inputFile), outputFile)
// hc.emitRefConfidence = org.broadinstitute.gatk.tools.walkers.haplotypecaller.ReferenceConfidenceMode.GVCF
// hc.variant_index_type = GATKVCFIndexType.LINEAR
// hc.variant_index_parameter = Some(hc.config("variant_index_parameter", default = 128000).asInt)
// hc
// }
//}
import java.io.File
......@@ -81,6 +64,7 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk._
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import org.broadinstitute.gatk.utils.commandline.{ Argument, Gather, Input, _ }
import org.broadinstitute.gatk.utils.variant.GATKVCFIndexType
class HaplotypeCaller(val root: Configurable) extends CommandLineGATK with ScatterGatherableFunction {
analysisName = "HaplotypeCaller"
......@@ -1131,3 +1115,21 @@ class HaplotypeCaller(val root: Configurable) extends CommandLineGATK with Scatt
conditional(filter_mismatching_base_and_quals, "-filterMBQ", escape = true, format = "%s") +
conditional(filter_bases_not_stored, "-filterNoBases", escape = true, format = "%s")
}
object HaplotypeCaller {
def apply(root: Configurable, inputFiles: List[File], outputFile: File): HaplotypeCaller = {
val hc = new HaplotypeCaller(root)
hc.input_file = inputFiles
hc.out = outputFile
//if (hc.out.getName.endsWith(".vcf.gz")) hc.vcfIndex = new File(hc.out.getAbsolutePath + ".tbi")
hc
}
def gvcf(root: Configurable, inputFile: File, outputFile: File): HaplotypeCaller = {
val hc = apply(root, List(inputFile), outputFile)
hc.emitRefConfidence = "GVCF"
hc.variant_index_type = GATKVCFIndexType.LINEAR
hc.variant_index_parameter = Some(hc.config("variant_index_parameter", default = 128000).asInt)
hc
}
}
......@@ -5,31 +5,6 @@
*/
package nl.lumc.sasc.biopet.extensions.gatk.broad
//import java.io.File
//
//import nl.lumc.sasc.biopet.utils.config.Configurable
//import org.broadinstitute.gatk.utils.commandline.{ Gather, Output }
//
//class IndelRealigner(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.IndelRealigner with GatkGeneral {
//
// @Gather(enabled = false)
// @Output
// protected var bamIndex: File = _
//
// if (config.contains("scattercount")) scatterCount = config("scattercount")
//}
//
//object IndelRealigner {
// def apply(root: Configurable, input: File, targetIntervals: File, outputDir: File): IndelRealigner = {
// val ir = new IndelRealigner(root)
// ir.input_file :+= input
// ir.targetIntervals = targetIntervals
// ir.out = new File(outputDir, input.getName.stripSuffix(".bam") + ".realign.bam")
// ir.bamIndex = new File(outputDir, input.getName.stripSuffix(".bam") + ".realign.bai")
// ir
// }
//}
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
......@@ -430,3 +405,14 @@ class IndelRealigner(val root: Configurable) extends CommandLineGATK with Scatte
conditional(filter_mismatching_base_and_quals, "-filterMBQ", escape = true, format = "%s") +
conditional(filter_bases_not_stored, "-filterNoBases", escape = true, format = "%s")
}
object IndelRealigner {
def apply(root: Configurable, input: File, targetIntervals: File, outputDir: File): IndelRealigner = {
val ir = new IndelRealigner(root)
ir.input_file :+= input
ir.targetIntervals = targetIntervals
ir.out = new File(outputDir, input.getName.stripSuffix(".bam") + ".realign.bam")
ir.deps :+= new File(outputDir, input.getName.stripSuffix(".bam") + ".realign.bai")
ir
}
}
......@@ -5,23 +5,6 @@
*/
package nl.lumc.sasc.biopet.extensions.gatk.broad
//import java.io.File
//
//import nl.lumc.sasc.biopet.utils.config.Configurable
//
//class PrintReads(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.PrintReads with GatkGeneral {
// if (config.contains("scattercount")) scatterCount = config("scattercount")
//}
//
//object PrintReads {
// def apply(root: Configurable, input: File, output: File): PrintReads = {
// val br = new PrintReads(root)
// br.input_file :+= input
// br.out = output
// br
// }
//}
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
......@@ -221,3 +204,12 @@ class PrintReads(val root: Configurable) extends CommandLineGATK with ScatterGat
conditional(filter_mismatching_base_and_quals, "-filterMBQ", escape = true, format = "%s") +
conditional(filter_bases_not_stored, "-filterNoBases", escape = true, format = "%s")
}
object PrintReads {
def apply(root: Configurable, input: File, output: File): PrintReads = {
val br = new PrintReads(root)
br.input_file :+= input
br.out = output
br
}
}
......@@ -5,25 +5,6 @@
*/
package nl.lumc.sasc.biopet.extensions.gatk.broad
//import java.io.File
//
//import nl.lumc.sasc.biopet.utils.config.Configurable
//
//class RealignerTargetCreator(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.RealignerTargetCreator with GatkGeneral {
// if (config.contains("scattercount")) scatterCount = config("scattercount")
//
// if (config.contains("known")) known ++= config("known").asFileList
//}
//
//object RealignerTargetCreator {
// def apply(root: Configurable, input: File, outputDir: File): RealignerTargetCreator = {
// val re = new RealignerTargetCreator(root)
// re.input_file :+= input
// re.out = new File(outputDir, input.getName.stripSuffix(".bam") + ".realign.intervals")
// re
// }
//}
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
......@@ -194,3 +175,12 @@ class RealignerTargetCreator(val root: Configurable) extends CommandLineGATK wit
conditional(filter_mismatching_base_and_quals, "-filterMBQ", escape = true, format = "%s") +
conditional(filter_bases_not_stored, "-filterNoBases", escape = true, format = "%s")
}
object RealignerTargetCreator {
def apply(root: Configurable, input: File, outputDir: File): RealignerTargetCreator = {
val re = new RealignerTargetCreator(root)
re.input_file :+= input
re.out = new File(outputDir, input.getName.stripSuffix(".bam") + ".realign.intervals")
re
}
}
......@@ -44,17 +44,6 @@ package nl.lumc.sasc.biopet.extensions.gatk.broad
// memoryLimit = Option(nct.getOrElse(1) * memoryLimit.getOrElse(2.0))
// }
//}
//
//object UnifiedGenotyper {
// def apply(root: Configurable, inputFiles: List[File], outputFile: File): UnifiedGenotyper = {
// val ug = new UnifiedGenotyper(root)
// ug.input_file = inputFiles
// ug.out = outputFile
// if (ug.out.getName.endsWith(".vcf.gz")) ug.vcfIndex = new File(ug.out.getAbsolutePath + ".tbi")
// ug
// }
//
//}
import java.io.File
......@@ -892,3 +881,13 @@ class UnifiedGenotyper(val root: Configurable) extends CommandLineGATK with Scat
conditional(filter_mismatching_base_and_quals, "-filterMBQ", escape = true, format = "%s") +
conditional(filter_bases_not_stored, "-filterNoBases", escape = true, format = "%s")
}
object UnifiedGenotyper {
def apply(root: Configurable, inputFiles: List[File], outputFile: File): UnifiedGenotyper = {
val ug = new UnifiedGenotyper(root)
ug.input_file = inputFiles
ug.out = outputFile
//if (ug.out.getName.endsWith(".vcf.gz")) ug.vcfIndex = new File(ug.out.getAbsolutePath + ".tbi")
ug
}
}
......@@ -28,8 +28,8 @@ import java.io.File
import nl.lumc.sasc.biopet.core.ScatterGatherableFunction
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk.{CatVariantsGatherer, GATKScatterFunction, LocusScatterFunction, TaggedFile}
import org.broadinstitute.gatk.utils.commandline.{Argument, Gather, Output, _}
import org.broadinstitute.gatk.queue.extensions.gatk.{ CatVariantsGatherer, GATKScatterFunction, LocusScatterFunction, TaggedFile }
import org.broadinstitute.gatk.utils.commandline.{ Argument, Gather, Output, _ }
class VariantAnnotator(val root: Configurable) extends CommandLineGATK with ScatterGatherableFunction {
analysisName = "VariantAnnotator"
......
......@@ -17,7 +17,7 @@ class HaplotypeCallerAllele(val root: Configurable) extends Variantcaller {
def biopetScript() {
val hc = broad.HaplotypeCaller(this, inputBams.values.toList, outputFile)
hc.alleles = config("input_alleles")
hc.genotyping_mode = org.broadinstitute.gatk.tools.walkers.genotyper.GenotypingOutputMode.GENOTYPE_GIVEN_ALLELES
hc.genotyping_mode = "GENOTYPE_GIVEN_ALLELES"
add(hc)
}
}
......@@ -17,7 +17,7 @@ class UnifiedGenotyperAllele(val root: Configurable) extends Variantcaller {
def biopetScript() {
val ug = broad.UnifiedGenotyper(this, inputBams.values.toList, outputFile)
ug.alleles = config("input_alleles")
ug.genotyping_mode = org.broadinstitute.gatk.tools.walkers.genotyper.GenotypingOutputMode.GENOTYPE_GIVEN_ALLELES
ug.genotyping_mode = "GENOTYPE_GIVEN_ALLELES"
add(ug)
}
}
package nl.lumc.sasc.biopet.core
/**
* Created by pjvan_thof on 4/26/16.
*/
* Created by pjvan_thof on 4/26/16.
*/
trait ScatterGatherableFunction extends BiopetCommandLineFunction
with org.broadinstitute.gatk.queue.function.scattergather.ScatterGatherableFunction {
scatterCount = config("scatter_count", freeVar = true)
......
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