Commit 1eada82e authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Switch pipeline to reference module

parent 1bdbed83
@HD VN:1.4 SO:unsorted
@SQ SN:chr1 LN:9 UR:file:/home/pjvan_thof/pipelines/biopet/public/mapping/src/test/resources/ref.fa M5:fe15dbbd0900310caf32827f6da57550
......@@ -5,6 +5,8 @@
*/
package nl.lumc.sasc.biopet.pipelines.gatk
import java.io.{ FileOutputStream, File }
import com.google.common.io.Files
import nl.lumc.sasc.biopet.core.config.Config
import nl.lumc.sasc.biopet.extensions.bwa.BwaMem
......@@ -90,10 +92,22 @@ class ShivaTest extends TestNGSuite with Matchers {
object ShivaTest {
val outputDir = Files.createTempDir()
private def copyFile(name: String): Unit = {
val is = getClass.getResourceAsStream("/" + name)
val os = new FileOutputStream(new File(outputDir, name))
org.apache.commons.io.IOUtils.copy(is, os)
os.close()
}
copyFile("ref.fa")
copyFile("ref.dict")
copyFile("ref.fa.fai")
val config = Map(
"name_prefix" -> "test",
"output_dir" -> outputDir,
"reference" -> "test",
"reference" -> (outputDir + File.separator + "ref.fa"),
"referenceFasta" -> (outputDir + File.separator + "ref.fa"),
"gatk_jar" -> "test",
"samtools" -> Map("exe" -> "test"),
"bcftools" -> Map("exe" -> "test"),
......
......@@ -17,7 +17,7 @@ package nl.lumc.sasc.biopet.extensions.bwa
import java.io.File
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import nl.lumc.sasc.biopet.core.{ Reference, BiopetCommandLineFunction }
import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.core.summary.Summarizable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
......@@ -27,7 +27,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
*
* Based on version 0.7.12-r1039
*/
class BwaMem(val root: Configurable) extends Bwa {
class BwaMem(val root: Configurable) extends Bwa with Reference {
@Input(doc = "Fastq file R1", shortName = "R1")
var R1: File = _
......@@ -35,7 +35,7 @@ class BwaMem(val root: Configurable) extends Bwa {
var R2: File = _
@Input(doc = "The reference file for the bam files.", shortName = "R")
var reference: File = config("reference")
var reference: File = referenceFasta()
@Output(doc = "Output file SAM", shortName = "output")
var output: File = _
......
......@@ -35,7 +35,7 @@ import nl.lumc.sasc.biopet.pipelines.mapping.Mapping
* Chip-Seq analysis pipeline
* This pipeline performs QC,mapping and peak calling
*/
class Carp(val root: Configurable) extends QScript with MultiSampleQScript with SummaryQScript {
class Carp(val root: Configurable) extends QScript with MultiSampleQScript with SummaryQScript with Reference {
qscript =>
def this() = this(null)
......
@HD VN:1.4 SO:unsorted
@SQ SN:chr1 LN:9 UR:file:/home/pjvan_thof/pipelines/biopet/public/mapping/src/test/resources/ref.fa M5:fe15dbbd0900310caf32827f6da57550
......@@ -15,7 +15,7 @@
*/
package nl.lumc.sasc.biopet.pipelines.carp
import java.io.File
import java.io.{ FileOutputStream, File }
import com.google.common.io.Files
import org.apache.commons.io.FileUtils
......@@ -97,8 +97,20 @@ class CarpTest extends TestNGSuite with Matchers {
object CarpTest {
val outputDir = Files.createTempDir()
private def copyFile(name: String): Unit = {
val is = getClass.getResourceAsStream("/" + name)
val os = new FileOutputStream(new File(outputDir, name))
org.apache.commons.io.IOUtils.copy(is, os)
os.close()
}
copyFile("ref.fa")
copyFile("ref.dict")
copyFile("ref.fa.fai")
val executables = Map(
"reference" -> "test",
"reference" -> (outputDir + File.separator + "ref.fa"),
"referenceFasta" -> (outputDir + File.separator + "ref.fa"),
"fastqc" -> Map("exe" -> "test"),
"seqtk" -> Map("exe" -> "test"),
"sickle" -> Map("exe" -> "test"),
......
......@@ -21,10 +21,9 @@ import scala.math._
import org.broadinstitute.gatk.queue.QScript
import nl.lumc.sasc.biopet.core.{ SampleLibraryTag, PipelineCommand }
import nl.lumc.sasc.biopet.core._
import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.core.summary.SummaryQScript
import nl.lumc.sasc.biopet.core.{ SampleLibraryTag, BiopetQScript, PipelineCommand }
import nl.lumc.sasc.biopet.extensions._
import nl.lumc.sasc.biopet.extensions.bwa.{ BwaSamse, BwaSampe, BwaAln, BwaMem }
import nl.lumc.sasc.biopet.extensions.{ Gsnap, Tophat }
......@@ -35,7 +34,7 @@ import nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics
import nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep
// TODO: documentation
class Mapping(val root: Configurable) extends QScript with SummaryQScript with SampleLibraryTag {
class Mapping(val root: Configurable) extends QScript with SummaryQScript with SampleLibraryTag with Reference {
def this() = this(null)
......@@ -112,7 +111,7 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
"aligner" -> aligner,
"chunking" -> chunking,
"numberChunks" -> numberChunks.getOrElse(1)
)
) ++ (if (root == null) Map() else Map("reference" -> referenceSummary))
/** Will be executed before script */
def init() {
......
@HD VN:1.4 SO:unsorted
@SQ SN:chr1 LN:9 UR:file:/home/pjvan_thof/pipelines/biopet/public/mapping/src/test/resources/ref.fa M5:fe15dbbd0900310caf32827f6da57550
......@@ -15,7 +15,7 @@
*/
package nl.lumc.sasc.biopet.pipelines.mapping
import java.io.File
import java.io.{ FileOutputStream, File }
import com.google.common.io.Files
import nl.lumc.sasc.biopet.extensions._
......@@ -130,8 +130,20 @@ class MappingTest extends TestNGSuite with Matchers {
object MappingTest {
val outputDir = Files.createTempDir()
private def copyFile(name: String): Unit = {
val is = getClass.getResourceAsStream("/" + name)
val os = new FileOutputStream(new File(outputDir, name))
org.apache.commons.io.IOUtils.copy(is, os)
os.close()
}
copyFile("ref.fa")
copyFile("ref.dict")
copyFile("ref.fa.fai")
val executables = Map(
"reference" -> "test",
"reference" -> (outputDir + File.separator + "ref.fa"),
"referenceFasta" -> (outputDir + File.separator + "ref.fa"),
"fastqc" -> Map("exe" -> "test"),
"seqtk" -> Map("exe" -> "test"),
"sickle" -> Map("exe" -> "test"),
......
......@@ -19,7 +19,7 @@ import java.io.File
import htsjdk.samtools.SamReaderFactory
import nl.lumc.sasc.biopet.core.summary.SummaryQScript
import nl.lumc.sasc.biopet.core.MultiSampleQScript
import nl.lumc.sasc.biopet.core.{ Reference, MultiSampleQScript }
import nl.lumc.sasc.biopet.extensions.Ln
import nl.lumc.sasc.biopet.extensions.picard.{ AddOrReplaceReadGroups, SamToFastq, MarkDuplicates }
import nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics
......@@ -31,7 +31,7 @@ import scala.collection.JavaConversions._
*
* Created by pjvan_thof on 2/26/15.
*/
trait ShivaTrait extends MultiSampleQScript with SummaryQScript {
trait ShivaTrait extends MultiSampleQScript with SummaryQScript with Reference {
qscript =>
/** Executed before running the script */
......@@ -286,8 +286,8 @@ trait ShivaTrait extends MultiSampleQScript with SummaryQScript {
def summaryFile = new File(outputDir, "Shiva.summary.json")
/** Settings of pipeline for summary */
def summarySettings = Map()
def summarySettings = Map("reference" -> referenceSummary)
/** Files for the summary */
def summaryFiles = Map()
def summaryFiles = Map("referenceFasta" -> referenceFasta())
}
@HD VN:1.4 SO:unsorted
@SQ SN:chr1 LN:9 UR:file:/home/pjvan_thof/pipelines/biopet/public/mapping/src/test/resources/ref.fa M5:fe15dbbd0900310caf32827f6da57550
......@@ -15,6 +15,8 @@
*/
package nl.lumc.sasc.biopet.pipelines.shiva
import java.io.{ File, FileOutputStream }
import com.google.common.io.Files
import nl.lumc.sasc.biopet.core.config.Config
import nl.lumc.sasc.biopet.extensions.bwa.BwaMem
......@@ -85,10 +87,22 @@ class ShivaTest extends TestNGSuite with Matchers {
object ShivaTest {
val outputDir = Files.createTempDir()
private def copyFile(name: String): Unit = {
val is = getClass.getResourceAsStream("/" + name)
val os = new FileOutputStream(new File(outputDir, name))
org.apache.commons.io.IOUtils.copy(is, os)
os.close()
}
copyFile("ref.fa")
copyFile("ref.dict")
copyFile("ref.fa.fai")
val config = Map(
"name_prefix" -> "test",
"output_dir" -> outputDir,
"reference" -> "test",
"reference" -> (outputDir + File.separator + "ref.fa"),
"referenceFasta" -> (outputDir + File.separator + "ref.fa"),
"gatk_jar" -> "test",
"samtools" -> Map("exe" -> "test"),
"bcftools" -> Map("exe" -> "test"),
......
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