Skip to content
Snippets Groups Projects
Commit c6a89d92 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added closed reference method

parent 15cd85a4
No related branches found
No related tags found
No related merge requests found
......@@ -2,15 +2,15 @@ package nl.lumc.sasc.biopet.extensions
import java.io.File
import nl.lumc.sasc.biopet.core.{Version, BiopetCommandLineFunction}
import nl.lumc.sasc.biopet.core.{ Version, BiopetCommandLineFunction }
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.Input
import scala.util.matching.Regex
/**
* Created by pjvanthof on 16/12/15.
*/
* Created by pjvanthof on 16/12/15.
*/
class Flash(val root: Configurable) extends BiopetCommandLineFunction with Version {
executable = config("exe", default = "flash", freeVar = false)
......@@ -47,7 +47,7 @@ class Flash(val root: Configurable) extends BiopetCommandLineFunction with Versi
var compressProgArgs: Option[String] = config("compress_prog_args")
var outputSuffix: Option[String] = config("output_suffix")
private def suffix = outputSuffix.getOrElse("fastq") + (if(compress) ".gz" else "")
private def suffix = outputSuffix.getOrElse("fastq") + (if (compress) ".gz" else "")
def combinedFastq = new File(outputDirectory, s"$outputPrefix.extendedFrags.$suffix")
def notCombinedR1 = new File(outputDirectory, s"$outputPrefix.notCombined_1.$suffix")
......
......@@ -2,7 +2,7 @@ package nl.lumc.sasc.biopet.extensions.qiime
import java.io.File
import nl.lumc.sasc.biopet.core.{BiopetCommandLineFunction, Version}
import nl.lumc.sasc.biopet.core.{ BiopetCommandLineFunction, Version }
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.Input
......@@ -36,6 +36,11 @@ class PickClosedReferenceOtus(val root: Configurable) extends BiopetCommandLineF
var print_only: Boolean = config("print_only", default = false)
var suppress_taxonomy_assignment: Boolean = config("suppress_taxonomy_assignment", default = false)
override def beforeGraph(): Unit = {
super.beforeGraph()
jobOutputFile = new File(outputDir, "std.log")
}
def cmdLine = executable +
required("-i", inputFasta) +
required("-o", outputDir) +
......
package nl.lumc.sasc.biopet.pipelines.gears
import nl.lumc.sasc.biopet.core.{ BiopetQScript, SampleLibraryTag }
import nl.lumc.sasc.biopet.extensions.Flash
import nl.lumc.sasc.biopet.extensions.qiime._
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript
/**
* Created by pjvan_thof on 12/4/15.
*/
class GearsQiimeClosed(val root: Configurable) extends QScript with BiopetQScript with SampleLibraryTag {
var fastqR1: File = _
var fastqR2: Option[File] = None
override def defaults = Map(
"splitlibrariesfastq" -> Map(
"barcode_type" -> "not-barcoded"
)
)
def init() = {
require(fastqR1 != null)
}
def biopetScript() = {
val fastqFile = fastqR2 match {
case Some(r2) =>
val flash = new Flash(this)
flash.outputDirectory = new File(outputDir, "combine_reads_flash")
flash.fastqR1 = fastqR1
flash.fastqR2 = r2
add(flash)
flash.combinedFastq
case _ => fastqR1
}
val splitLib = new SplitLibrariesFastq(this)
splitLib.input :+= fastqFile
splitLib.outputDir = new File(outputDir, "split_libraries_fastq")
sampleId.foreach(splitLib.sample_ids :+= _)
add(splitLib)
val closedReference = new PickClosedReferenceOtus(this)
closedReference.inputFasta = splitLib.outputSeqs
closedReference.outputDir = new File(outputDir, "pick_closed_reference_otus")
add(closedReference)
}
}
......@@ -43,6 +43,7 @@ class GearsSingle(val root: Configurable) extends QScript with SummaryQScript wi
var gearsUseKraken: Boolean = config("gears_use_kraken", default = true)
var gearsUserQiimeRtax: Boolean = config("gear_use_qiime_rtax", default = false)
var gearsUserQiimeClosed: Boolean = config("gear_use_qiime_closed", default = false)
/** Executed before running the script */
def init(): Unit = {
......@@ -120,6 +121,16 @@ class GearsSingle(val root: Configurable) extends QScript with SummaryQScript wi
addAll(qiimeRatx.functions)
}
if (gearsUserQiimeClosed) {
val qiimeClosed = new GearsQiimeClosed(this)
qiimeClosed.outputDir = new File(outputDir, "qiime_rtax")
qiimeClosed.fastqR1 = flexiprep.fastqR1Qc
qiimeClosed.fastqR2 = flexiprep.fastqR2Qc
qiimeClosed.init()
qiimeClosed.biopetScript()
addAll(qiimeClosed.functions)
}
addSummaryJobs()
}
......
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