Commit 685c021e authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added PickRepSet

parent a49ae40e
......@@ -2,14 +2,14 @@ package nl.lumc.sasc.biopet.extensions.qiime
import java.io.File
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import nl.lumc.sasc.biopet.core.{ Version, BiopetCommandLineFunction }
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.Input
/**
* Created by pjvan_thof on 12/4/15.
*/
class PickOtus(val root: Configurable) extends BiopetCommandLineFunction {
class PickOtus(val root: Configurable) extends BiopetCommandLineFunction with Version {
executable = config("exe", default = "pick_otus.py")
@Input(required = true)
......@@ -18,8 +18,9 @@ class PickOtus(val root: Configurable) extends BiopetCommandLineFunction {
var outputDir: File = null
override def defaultThreads = 2
override def defaultCoreMemory = 5.0
def versionCommand = executable + " --version"
def versionRegex = """Version: (.*)""".r
var otu_picking_method: Option[String] = config("otu_picking_method")
var clustering_algorithm: Option[String] = config("clustering_algorithm")
......@@ -76,6 +77,19 @@ class PickOtus(val root: Configurable) extends BiopetCommandLineFunction {
var usearch61_sort_method: Option[String] = config("usearch61_sort_method")
var sizeorder: Boolean = config("sizeorder", default = false)
private lazy val name = inputFasta.getName.stripSuffix(".fasta").stripSuffix(".fa").stripSuffix(".fna")
def clustersFile = new File(outputDir, s"${name}_clusters.uc")
def logFile = new File(outputDir, s"${name}_otus.log")
def otusTxt = new File(outputDir, s"${name}_otus.txt")
override def beforeGraph(): Unit = {
super.beforeGraph()
outputFiles :+= clustersFile
outputFiles :+= logFile
outputFiles :+= otusTxt
}
def cmdLine = executable +
required("-i", inputFasta) +
required("-o", outputDir) +
......
package nl.lumc.sasc.biopet.extensions.qiime
import java.io.File
import nl.lumc.sasc.biopet.core.{ Version, BiopetCommandLineFunction }
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
/**
* Created by pjvan_thof on 12/4/15.
*/
class PickRepSet(val root: Configurable) extends BiopetCommandLineFunction with Version {
executable = config("exe", default = "pick_rep_set.py")
@Input(required = true)
var inputFile: File = _
@Output
var outputFasta: Option[File] = None
@Output
var logFile: Option[File] = None
@Input(required = false)
var reference_seqs_fp: Option[File] = config("reference_seqs_fp")
var outputDir: File = _
var sortBy: Option[String] = config("sort_by")
def versionCommand = executable + " --version"
def versionRegex = """Version: (.*)""".r
var rep_set_picking_method: Option[String] = config("rep_set_picking_method")
def cmdLine = executable +
required("-i", inputFile) +
optional("-f", outputFasta) +
optional("-m", rep_set_picking_method) +
required("-o", outputDir) +
optional("-l", logFile) +
optional("-s", sortBy) +
optional("-r", reference_seqs_fp)
}
package nl.lumc.sasc.biopet.pipelines.gears
import nl.lumc.sasc.biopet.core.BiopetQScript
import nl.lumc.sasc.biopet.extensions.qiime.PickOtus
import nl.lumc.sasc.biopet.extensions.qiime.{ PickRepSet, PickOtus }
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript
......@@ -23,5 +23,13 @@ class GearsQiimeRatx(val root: Configurable) extends QScript with BiopetQScript
pickOtus.inputFasta = fastaR1
pickOtus.outputDir = new File(outputDir, "pick_otus")
add(pickOtus)
val pickRepSet = new PickRepSet(this)
pickRepSet.outputDir = new File(outputDir, "pick_rep_set")
pickRepSet.inputFile = pickOtus.otusTxt
pickRepSet.outputFasta = Some(new File(pickRepSet.outputDir, fastaR1.getName))
pickRepSet.logFile = Some(new File(pickRepSet.outputDir, fastaR1.getName
.stripSuffix(".fasta").stripSuffix(".fa").stripSuffix(".fna") + ".log"))
add(pickRepSet)
}
}
Markdown is supported
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