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

Added faidx

parent e32ecc0b
No related branches found
No related tags found
No related merge requests found
/**
* Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines.
*
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
*
* Contact us at: sasc@lumc.nl
*
* A dual licensing mode is applied. The source code within this project that are
* not part of GATK Queue is freely available for non-commercial use under an AGPL
* license; For commercial users or users who do not want to follow the AGPL
* license, please contact us to obtain a separate license.
*/
package nl.lumc.sasc.biopet.extensions.samtools
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Input, Output}
/** Extension for samtools flagstat */
class SamtoolsFaidx(val root: Configurable) extends Samtools {
@Input(doc = "Bam File")
var input: File = _
@Output(doc = "output File")
private var _output: File = _
def output = _output
override def beforeGraph: Unit = {
_output = new File(input.getParentFile, input.getName + ".fai")
}
/** Returns command to execute */
def cmdLine = required(executable) + required("faidx") + required(input)
}
object SamtoolsFaidx {
def apply(root: Configurable, input: File): SamtoolsFaidx = {
val faidx = new SamtoolsFaidx(root)
faidx.input = input
faidx._output = new File(input.getParentFile, input.getName + ".fai")
faidx
}
}
\ No newline at end of file
......@@ -19,6 +19,7 @@ import java.io.File
import nl.lumc.sasc.biopet.core.{PipelineCommand, BiopetQScript}
import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.extensions.samtools.SamtoolsFaidx
import nl.lumc.sasc.biopet.extensions.{Zcat, Curl}
import nl.lumc.sasc.biopet.utils.ConfigUtils
import org.broadinstitute.gatk.queue.QScript
......@@ -49,17 +50,20 @@ class GenerateIndexes(val root: Configurable) extends QScript with BiopetQScript
throw new IllegalArgumentException(s"No fasta_url found for $speciesName - $genomeName")).toString
val genomeDir = new File(speciesDir, genomeName)
val fastaFile = new File(genomeDir, "reference.fa")
val curl = new Curl(this)
curl.url = fastaUrl
if (fastaUrl.endsWith(".gz")) {
curl.output = new File(genomeDir, "reference.fa.gz")
curl.isIntermediate = true
add(Zcat(this, curl.output, new File(genomeDir, "reference.fa")))
} else curl.output = new File(genomeDir, "reference.fa")
add(Zcat(this, curl.output, fastaFile))
} else curl.output = fastaFile
add(curl)
//TODO: fai
val faidx = SamtoolsFaidx(this, fastaFile)
add(faidx)
//TODO: dict
//TODO: other indexes
......
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