Commit 06e3d85c authored by Peter van 't Hof's avatar Peter van 't Hof

Added gff to gtf step

parent a4d3abf8
package nl.lumc.sasc.biopet.extensions
import java.io.File
import nl.lumc.sasc.biopet.core.{BiopetCommandLineFunction, Version}
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Input, Output}
/**
* Created by pjvanthof on 20/06/16.
*/
class GffRead(val root: Configurable) extends BiopetCommandLineFunction {
executable = config("exe", default = "gffread", freeVar = false)
@Input
var input: File = _
@Output
var output: File = _
var T: Boolean = config("T", default = false, freeVar = false)
def cmdLine = executable +
(if(inputAsStdin) "" else required(input)) +
(if (outputAsStsout) "" else required(output)) +
conditional(T, "-T")
}
......@@ -207,7 +207,23 @@ class GenerateIndexes(val root: Configurable) extends QScript with BiopetQScript
outputConfig += "dbsnp" -> cv.out
}
val gtfFile: Option[File] = genomeConfig.get("gtf_uri").map { gtfUri =>
val gffFile: Option[File] = genomeConfig.get("gff_uri").map { gtfUri =>
val outputFile = new File(annotationDir, new File(gtfUri.toString).getName.stripSuffix(".gz"))
val curl = new Curl(this)
curl.url = gtfUri.toString
if (gtfUri.toString.endsWith(".gz")) add(curl | Zcat(this) > outputFile)
else add(curl > outputFile)
outputConfig += "annotation_gff" -> outputFile
outputFile
}
val gtfFile: Option[File] = if (gffFile.isDefined) gffFile.map { gff =>
val gffRead = new GffRead(this)
gffRead.input = gff
gffRead.output = swapExt(annotationDir, gff, ".gff", ".gtf")
add(gffRead)
gffRead.output
} else genomeConfig.get("gtf_uri").map { gtfUri =>
val outputFile = new File(annotationDir, new File(gtfUri.toString).getName.stripSuffix(".gz"))
val curl = new Curl(this)
curl.url = gtfUri.toString
......
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