From 23084ff1e531f1da267b74a565f94e2bac28e586 Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Wed, 21 May 2014 10:40:21 +0200
Subject: [PATCH] - output file for star

---
 .../java/nl/lumc/sasc/biopet/wrappers/Star.scala   |  4 ++--
 .../nl/lumc/sasc/biopet/pipelines/gatk/Gatk.scala  | 14 +++-----------
 .../sasc/biopet/pipelines/mapping/Mapping.scala    |  2 +-
 3 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/biopet-framework/src/main/java/nl/lumc/sasc/biopet/wrappers/Star.scala b/biopet-framework/src/main/java/nl/lumc/sasc/biopet/wrappers/Star.scala
index f898b6676..b599fae78 100644
--- a/biopet-framework/src/main/java/nl/lumc/sasc/biopet/wrappers/Star.scala
+++ b/biopet-framework/src/main/java/nl/lumc/sasc/biopet/wrappers/Star.scala
@@ -18,7 +18,7 @@ class Star(private var globalConfig: Config) extends CommandLineFunction {
   @Input(doc="Fastq file R2", shortName="R2", required=false) var R2: File = _
   @Argument(doc="Output Directory", shortName="outputDir") var outputDir: String = _
   @Argument(doc="GenomeDir", required=false) var genomeDir: String = _
-  if (genomeDir == null) genomeDir = config.getAsString("genomeDir", referenceFile.getParent + "/star")
+  if (genomeDir == null) genomeDir = config.getAsString("genomeDir", referenceFile.getParent + "/star/ref")
   
   @Argument(doc="STAR runmode", shortName="runmode", required=false) var runmode: String = _
   
@@ -30,7 +30,7 @@ class Star(private var globalConfig: Config) extends CommandLineFunction {
   if (threads > maxThreads) threads = maxThreads
   nCoresRequest = Option(threads)
 
-  @Output var outputSam: File = new File(outputDir + "/star_output.sam")
+  @Output var outputSam: File = new File(outputDir + "/Aligned.out.sam")
   
   def commandLine : String= {
     //init()
diff --git a/gatk/src/main/java/nl/lumc/sasc/biopet/pipelines/gatk/Gatk.scala b/gatk/src/main/java/nl/lumc/sasc/biopet/pipelines/gatk/Gatk.scala
index 120a97a86..0b3e73391 100644
--- a/gatk/src/main/java/nl/lumc/sasc/biopet/pipelines/gatk/Gatk.scala
+++ b/gatk/src/main/java/nl/lumc/sasc/biopet/pipelines/gatk/Gatk.scala
@@ -91,7 +91,7 @@ class Gatk(private var globalConfig: Config) extends QScript {
         
         //indel recal
         val indelVariantRecalibrator = new VariantRecalibrator() with gatkArguments {
-          this.input +:= genotypeGVCFs.out
+          this.input +:= snpApplyRecalibration.out
           this.nt = 4
           this.memoryLimit = 2 * nt
           this.recal_file = swapExt(genotypeGVCFs.out,".vcf",".indel.recal")
@@ -104,10 +104,10 @@ class Gatk(private var globalConfig: Config) extends QScript {
         add(indelVariantRecalibrator)
         
         val indelApplyRecalibration = new ApplyRecalibration() with gatkArguments {
-          this.input +:= genotypeGVCFs.out
+          this.input +:= snpApplyRecalibration.out
           this.recal_file = indelVariantRecalibrator.recal_file
           this.tranches_file = indelVariantRecalibrator.tranches_file
-          this.out = swapExt(genotypeGVCFs.out,".vcf",".indel.recal.vcf")
+          this.out = swapExt(genotypeGVCFs.out,".recal.vcf",".indel.recal.vcf")
           this.ts_filter_level = 99.0
           this.mode = org.broadinstitute.sting.gatk.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode.INDEL
           this.nt = 3
@@ -115,14 +115,6 @@ class Gatk(private var globalConfig: Config) extends QScript {
           if (scatterCount > 1) this.scatterCount = scatterCount
         }
         add(indelApplyRecalibration)
-        
-        // merge snp and indels
-        val catVariants = new CatVariants() {
-          this.variant = Seq(snpApplyRecalibration.out,indelApplyRecalibration.out)
-          this.outputFile = swapExt(genotypeGVCFs.out,".vcf",".recal.vcf")
-          this.reference = referenceFile
-        }
-        add(catVariants)
       } else logger.warn("No gVCFs to genotype")
       
       
diff --git a/mapping/src/main/java/nl/lumc/sasc/biopet/pipelines/mapping/Mapping.scala b/mapping/src/main/java/nl/lumc/sasc/biopet/pipelines/mapping/Mapping.scala
index 2e07f081b..df4d26fb6 100644
--- a/mapping/src/main/java/nl/lumc/sasc/biopet/pipelines/mapping/Mapping.scala
+++ b/mapping/src/main/java/nl/lumc/sasc/biopet/pipelines/mapping/Mapping.scala
@@ -88,7 +88,7 @@ class Mapping(private var globalConfig: Config) extends QScript {
       bamFile = addSortSam(List(bwaCommand.output), swapExt(outputDir,bwaCommand.output,".sam",".bam"), outputDir)
     } else if (aligner == "star") {
       val starCommand = new Star(config) { R1 = fastq_R1; if (paired) R2 = fastq_R2; this.outputDir = qscript.outputDir + "star/" ;
-                                          outputSam = new File(this.outputDir + "/star_output.sam") }
+                                          outputSam = new File(this.outputDir + "/Aligned.out.sam") }
       add(starCommand)
       bamFile = addAddOrReplaceReadGroups(List(starCommand.outputSam), swapExt(outputDir,starCommand.outputSam,".sam",".bam"), outputDir)
     }
-- 
GitLab