functional recalibrate script
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4034 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
4710015c17
commit
c85ab9db37
|
|
@ -12,6 +12,14 @@ class recalibrate extends QScript {
|
||||||
@Argument(doc="gatk jar file")
|
@Argument(doc="gatk jar file")
|
||||||
var gatkJarFile: File = _
|
var gatkJarFile: File = _
|
||||||
|
|
||||||
|
@Argument(doc="Assume initial count covariates has completed", required=false)
|
||||||
|
var skipInitialCountCovariates: Boolean = false
|
||||||
|
|
||||||
|
@Argument(shortName = "R", doc="ref")
|
||||||
|
var referenceFile: File = _
|
||||||
|
|
||||||
|
trait UNIVERSAL_GATK_ARGS extends CommandLineGATK { logging_level = "INFO"; jarFile = gatkJarFile; reference_sequence = referenceFile; }
|
||||||
|
|
||||||
def script = {
|
def script = {
|
||||||
for (bamIn <- bamIns) {
|
for (bamIn <- bamIns) {
|
||||||
val root = bamIn.getPath()
|
val root = bamIn.getPath()
|
||||||
|
|
@ -19,7 +27,8 @@ def script = {
|
||||||
val recalData = new File(bamRoot + ".recal_data.csv")
|
val recalData = new File(bamRoot + ".recal_data.csv")
|
||||||
val recalBam = new File(bamRoot + ".recal.bam")
|
val recalBam = new File(bamRoot + ".recal.bam")
|
||||||
val recalRecalData = new File(bamRoot + ".recal.recal_data.csv")
|
val recalRecalData = new File(bamRoot + ".recal.recal_data.csv")
|
||||||
//add(new CountCovariates(bamIn, recalData, "-OQ"))
|
if ( ! skipInitialCountCovariates )
|
||||||
|
add(new CountCovariates(bamIn, recalData) { useOriginalQualities = true } )
|
||||||
val tableRecal = new TableRecalibrate(bamIn, recalData, recalBam) { useOriginalQualities = true }
|
val tableRecal = new TableRecalibrate(bamIn, recalData, recalBam) { useOriginalQualities = true }
|
||||||
if ( scatter ) {
|
if ( scatter ) {
|
||||||
tableRecal.intervals = new File("/humgen/gsa-hpprojects/GATK/data/chromosomes.hg18.interval_list")
|
tableRecal.intervals = new File("/humgen/gsa-hpprojects/GATK/data/chromosomes.hg18.interval_list")
|
||||||
|
|
@ -39,7 +48,7 @@ class Index(bamIn: File) extends BamIndexFunction {
|
||||||
bamFile = bamIn
|
bamFile = bamIn
|
||||||
}
|
}
|
||||||
|
|
||||||
class CountCovariates(bamIn: File, recalDataIn: File) extends org.broadinstitute.sting.queue.extensions.gatk.CountCovariates {
|
class CountCovariates(bamIn: File, recalDataIn: File) extends org.broadinstitute.sting.queue.extensions.gatk.CountCovariates with UNIVERSAL_GATK_ARGS {
|
||||||
this.jarFile = gatkJarFile
|
this.jarFile = gatkJarFile
|
||||||
this.input_file :+= bamIn
|
this.input_file :+= bamIn
|
||||||
this.recal_file = recalDataIn
|
this.recal_file = recalDataIn
|
||||||
|
|
@ -47,12 +56,12 @@ class CountCovariates(bamIn: File, recalDataIn: File) extends org.broadinstitute
|
||||||
this.logging_level = "INFO"
|
this.logging_level = "INFO"
|
||||||
this.max_reads_at_locus = Some(20000)
|
this.max_reads_at_locus = Some(20000)
|
||||||
this.covariate ++= List("ReadGroupCovariate", "QualityScoreCovariate", "CycleCovariate", "DinucCovariate")
|
this.covariate ++= List("ReadGroupCovariate", "QualityScoreCovariate", "CycleCovariate", "DinucCovariate")
|
||||||
this.memoryLimit = Some(4)
|
this.memoryLimit = Some(3)
|
||||||
|
|
||||||
override def dotString = "CountCovariates: %s [args %s]".format(bamIn.getName, if (this.num_threads.isDefined) "-nt " + this.num_threads else "")
|
override def dotString = "CountCovariates: %s [args %s]".format(bamIn.getName, if (this.num_threads.isDefined) "-nt " + this.num_threads else "")
|
||||||
}
|
}
|
||||||
|
|
||||||
class TableRecalibrate(bamInArg: File, recalDataIn: File, bamOutArg: File) extends org.broadinstitute.sting.queue.extensions.gatk.TableRecalibration {
|
class TableRecalibrate(bamInArg: File, recalDataIn: File, bamOutArg: File) extends org.broadinstitute.sting.queue.extensions.gatk.TableRecalibration with UNIVERSAL_GATK_ARGS {
|
||||||
this.jarFile = gatkJarFile
|
this.jarFile = gatkJarFile
|
||||||
this.input_file :+= bamInArg
|
this.input_file :+= bamInArg
|
||||||
this.recal_file = recalDataIn
|
this.recal_file = recalDataIn
|
||||||
|
|
@ -70,7 +79,7 @@ class AnalyzeCovariates(recalDataIn: File, outputDir: File) extends org.broadin
|
||||||
this.path_to_resources = "/home/radon01/depristo/dev/GenomeAnalysisTK/trunk/R/"
|
this.path_to_resources = "/home/radon01/depristo/dev/GenomeAnalysisTK/trunk/R/"
|
||||||
this.ignoreQ = Some(5)
|
this.ignoreQ = Some(5)
|
||||||
this.path_to_Rscript = "/broad/software/free/Linux/redhat_5_x86_64/pkgs/r_2.7.2/bin/Rscript"
|
this.path_to_Rscript = "/broad/software/free/Linux/redhat_5_x86_64/pkgs/r_2.7.2/bin/Rscript"
|
||||||
this.memoryLimit = Some(4)
|
this.memoryLimit = Some(2)
|
||||||
|
|
||||||
override def dotString = "AnalyzeCovariates: %s".format(recalDataIn.getName)
|
override def dotString = "AnalyzeCovariates: %s".format(recalDataIn.getName)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue