Commit 7e6ef439 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Adding centrifuge to testing

parent deced04c
...@@ -9,8 +9,8 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output } ...@@ -9,8 +9,8 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
import scala.util.matching.Regex import scala.util.matching.Regex
/** /**
* Created by pjvanthof on 19/09/16. * Created by pjvanthof on 19/09/16.
*/ */
class Centrifuge(val root: Configurable) extends BiopetCommandLineFunction with Version { class Centrifuge(val root: Configurable) extends BiopetCommandLineFunction with Version {
@Input(doc = "Input: FastQ or FastA", required = true) @Input(doc = "Input: FastQ or FastA", required = true)
var inputR1: File = _ var inputR1: File = _
...@@ -38,14 +38,14 @@ class Centrifuge(val root: Configurable) extends BiopetCommandLineFunction with ...@@ -38,14 +38,14 @@ class Centrifuge(val root: Configurable) extends BiopetCommandLineFunction with
def versionRegex: Regex = ".* version (.*)".r def versionRegex: Regex = ".* version (.*)".r
/** /**
* This function needs to be implemented to define the command that is executed * This function needs to be implemented to define the command that is executed
* *
* @return Command to run * @return Command to run
*/ */
def cmdLine: String = executable + def cmdLine: String = executable +
//TODO: Options //TODO: Options
optional("--threads", threads) optional("--threads", threads)
required("-x", index) + required("-x", index) +
(inputR2 match { (inputR2 match {
case Some(r2) => required("-1", inputR1) + required("-2", r2) case Some(r2) => required("-1", inputR1) + required("-2", r2)
case _ => required("-U", inputR1) case _ => required("-U", inputR1)
......
...@@ -7,8 +7,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable ...@@ -7,8 +7,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output } import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/** /**
* Created by pjvanthof on 19/09/16. * Created by pjvanthof on 19/09/16.
*/ */
class CentrifugeKreport(val root: Configurable) extends BiopetCommandLineFunction { class CentrifugeKreport(val root: Configurable) extends BiopetCommandLineFunction {
@Input(doc = "Output files centrifuge", required = true) @Input(doc = "Output files centrifuge", required = true)
var centrifugeOutputFiles: List[File] = Nil var centrifugeOutputFiles: List[File] = Nil
......
...@@ -8,8 +8,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable ...@@ -8,8 +8,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript import org.broadinstitute.gatk.queue.QScript
/** /**
* Created by pjvanthof on 19/09/16. * Created by pjvanthof on 19/09/16.
*/ */
class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScript with SampleLibraryTag { class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScript with SampleLibraryTag {
var fastqR1: File = _ var fastqR1: File = _
...@@ -35,7 +35,7 @@ class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScrip ...@@ -35,7 +35,7 @@ class GearsCentrifuge(val root: Configurable) extends QScript with SummaryQScrip
add(centrifuge) add(centrifuge)
val centrifugeKreport = new CentrifugeKreport(this) val centrifugeKreport = new CentrifugeKreport(this)
centrifugeKreport.centrifugeOutputFiles += centrifuge.output centrifugeKreport.centrifugeOutputFiles :+= centrifuge.output
centrifugeKreport.output = new File(outputDir, s"$outputName.centrifuge.kreport") centrifugeKreport.output = new File(outputDir, s"$outputName.centrifuge.kreport")
add(centrifugeKreport) add(centrifugeKreport)
......
...@@ -17,6 +17,7 @@ package nl.lumc.sasc.biopet.pipelines.gears ...@@ -17,6 +17,7 @@ package nl.lumc.sasc.biopet.pipelines.gears
import java.io.File import java.io.File
import com.google.common.io.Files import com.google.common.io.Files
import nl.lumc.sasc.biopet.extensions.centrifuge.{ Centrifuge, CentrifugeKreport }
import nl.lumc.sasc.biopet.extensions.kraken.{ Kraken, KrakenReport } import nl.lumc.sasc.biopet.extensions.kraken.{ Kraken, KrakenReport }
import nl.lumc.sasc.biopet.extensions.picard.SamToFastq import nl.lumc.sasc.biopet.extensions.picard.SamToFastq
import nl.lumc.sasc.biopet.extensions.samtools.SamtoolsView import nl.lumc.sasc.biopet.extensions.samtools.SamtoolsView
...@@ -49,6 +50,7 @@ abstract class TestGearsSingle extends TestNGSuite with Matchers { ...@@ -49,6 +50,7 @@ abstract class TestGearsSingle extends TestNGSuite with Matchers {
def paired: Boolean = false def paired: Boolean = false
def hasOutputName: Boolean = false def hasOutputName: Boolean = false
def kraken: Option[Boolean] = None def kraken: Option[Boolean] = None
def centrifuge: Boolean = false
def qiimeClosed: Boolean = false def qiimeClosed: Boolean = false
def qiimeOpen: Boolean = false def qiimeOpen: Boolean = false
def qiimeRtax: Boolean = false def qiimeRtax: Boolean = false
...@@ -61,6 +63,7 @@ abstract class TestGearsSingle extends TestNGSuite with Matchers { ...@@ -61,6 +63,7 @@ abstract class TestGearsSingle extends TestNGSuite with Matchers {
def testGears(): Unit = { def testGears(): Unit = {
val map = ConfigUtils.mergeMaps(Map( val map = ConfigUtils.mergeMaps(Map(
"gears_use_qiime_rtax" -> qiimeRtax, "gears_use_qiime_rtax" -> qiimeRtax,
"gears_use_centrifuge" -> centrifuge,
"gears_use_qiime_closed" -> qiimeClosed, "gears_use_qiime_closed" -> qiimeClosed,
"gears_use_qiime_open" -> qiimeOpen, "gears_use_qiime_open" -> qiimeOpen,
"gears_use_seq_count" -> seqCount, "gears_use_seq_count" -> seqCount,
...@@ -108,6 +111,7 @@ abstract class TestGearsSingle extends TestNGSuite with Matchers { ...@@ -108,6 +111,7 @@ abstract class TestGearsSingle extends TestNGSuite with Matchers {
gears.summarySettings("gear_use_qiime_open") shouldBe qiimeOpen gears.summarySettings("gear_use_qiime_open") shouldBe qiimeOpen
gears.krakenScript.isDefined shouldBe kraken.getOrElse(true) gears.krakenScript.isDefined shouldBe kraken.getOrElse(true)
gears.centrifugeScript.isDefined shouldBe centrifuge
gears.qiimeClosed.isDefined shouldBe qiimeClosed gears.qiimeClosed.isDefined shouldBe qiimeClosed
gears.qiimeOpen.isDefined shouldBe qiimeOpen gears.qiimeOpen.isDefined shouldBe qiimeOpen
gears.qiimeRatx.isDefined shouldBe qiimeRtax gears.qiimeRatx.isDefined shouldBe qiimeRtax
...@@ -119,7 +123,11 @@ abstract class TestGearsSingle extends TestNGSuite with Matchers { ...@@ -119,7 +123,11 @@ abstract class TestGearsSingle extends TestNGSuite with Matchers {
gears.functions.count(_.isInstanceOf[Kraken]) shouldBe (if (kraken.getOrElse(true)) 1 else 0) gears.functions.count(_.isInstanceOf[Kraken]) shouldBe (if (kraken.getOrElse(true)) 1 else 0)
gears.functions.count(_.isInstanceOf[KrakenReport]) shouldBe (if (kraken.getOrElse(true)) 1 else 0) gears.functions.count(_.isInstanceOf[KrakenReport]) shouldBe (if (kraken.getOrElse(true)) 1 else 0)
gears.functions.count(_.isInstanceOf[KrakenReportToJson]) shouldBe (if (kraken.getOrElse(true)) 1 else 0) gears.functions.count(_.isInstanceOf[KrakenReportToJson]) shouldBe
((if (kraken.getOrElse(true)) 1 else 0) + (if (centrifuge) 1 else 0))
gears.functions.count(_.isInstanceOf[Centrifuge]) shouldBe (if (centrifuge) 1 else 0)
gears.functions.count(_.isInstanceOf[CentrifugeKreport]) shouldBe (if (centrifuge) 1 else 0)
} }
} }
} }
...@@ -132,6 +140,9 @@ class GearsSingleDefaultTest extends TestGearsSingle ...@@ -132,6 +140,9 @@ class GearsSingleDefaultTest extends TestGearsSingle
class GearsSingleKrakenTest extends TestGearsSingle { class GearsSingleKrakenTest extends TestGearsSingle {
override def kraken = Some(true) override def kraken = Some(true)
} }
class GearsSingleCentrifugeTest extends TestGearsSingle {
override def centrifuge = true
}
class GearsSingleQiimeClosedTest extends TestGearsSingle { class GearsSingleQiimeClosedTest extends TestGearsSingle {
override def qiimeClosed = true override def qiimeClosed = true
} }
...@@ -149,6 +160,10 @@ class GearsSingleKrakenPairedTest extends TestGearsSingle { ...@@ -149,6 +160,10 @@ class GearsSingleKrakenPairedTest extends TestGearsSingle {
override def paired = true override def paired = true
override def kraken = Some(true) override def kraken = Some(true)
} }
class GearsSingleCentrifugePairedTest extends TestGearsSingle {
override def paired = true
override def centrifuge = true
}
class GearsSingleQiimeClosedPairedTest extends TestGearsSingle { class GearsSingleQiimeClosedPairedTest extends TestGearsSingle {
override def paired = true override def paired = true
override def qiimeClosed = true override def qiimeClosed = true
...@@ -168,6 +183,7 @@ class GearsSingleseqCountPairedTest extends TestGearsSingle { ...@@ -168,6 +183,7 @@ class GearsSingleseqCountPairedTest extends TestGearsSingle {
class GearsSingleAllTest extends TestGearsSingle { class GearsSingleAllTest extends TestGearsSingle {
override def kraken = Some(true) override def kraken = Some(true)
override def centrifuge = true
override def qiimeClosed = true override def qiimeClosed = true
override def qiimeOpen = true override def qiimeOpen = true
override def qiimeRtax = true override def qiimeRtax = true
...@@ -175,6 +191,7 @@ class GearsSingleAllTest extends TestGearsSingle { ...@@ -175,6 +191,7 @@ class GearsSingleAllTest extends TestGearsSingle {
} }
class GearsSingleAllPairedTest extends TestGearsSingle { class GearsSingleAllPairedTest extends TestGearsSingle {
override def kraken = Some(true) override def kraken = Some(true)
override def centrifuge = true
override def qiimeClosed = true override def qiimeClosed = true
override def qiimeOpen = true override def qiimeOpen = true
override def qiimeRtax = true override def qiimeRtax = true
......
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