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

Remove some test and optimize code

parent 08bcca4d
......@@ -15,28 +15,24 @@
*/
package nl.lumc.sasc.biopet.pipelines.mapping
import java.io.{ File, FileOutputStream }
import java.io.{File, FileOutputStream}
import com.google.common.io.Files
import nl.lumc.sasc.biopet.utils.config.Config
import nl.lumc.sasc.biopet.extensions._
import nl.lumc.sasc.biopet.extensions.bwa.{ BwaAln, BwaMem, BwaSampe, BwaSamse }
import nl.lumc.sasc.biopet.extensions.picard.{ AddOrReplaceReadGroups, MarkDuplicates, MergeSamFiles, SortSam }
import nl.lumc.sasc.biopet.pipelines.flexiprep.Fastqc
import nl.lumc.sasc.biopet.extensions.tools.{ FastqSync, SeqStat }
import nl.lumc.sasc.biopet.utils.ConfigUtils
import nl.lumc.sasc.biopet.utils.config.Config
import org.apache.commons.io.FileUtils
import org.broadinstitute.gatk.queue.QSettings
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.{ AfterClass, DataProvider, Test }
import org.testng.annotations.{AfterClass, DataProvider, Test}
/**
* Test class for [[Mapping]]
*
* Created by pjvan_thof on 2/12/15.
*/
abstract class AbstractTestMapping extends TestNGSuite with Matchers {
abstract class AbstractTestMapping(val aligner: String) extends TestNGSuite with Matchers {
def initPipeline(map: Map[String, Any]): Mapping = {
new Mapping {
override def configName = "mapping"
......@@ -46,13 +42,10 @@ abstract class AbstractTestMapping extends TestNGSuite with Matchers {
}
}
val aligner: String
@DataProvider(name = "mappingOptions")
def mappingOptions = {
val aligners = Array("bwa-mem", "bwa-aln", "star", "star-2pass", "bowtie", "stampy", "gsnap", "tophat")
val paired = Array(true, false)
val chunks = Array(1, 5, 10, 100)
val chunks = Array(1, 5)
val skipMarkDuplicates = Array(true, false)
val skipFlexipreps = Array(true, false)
val zipped = Array(true, false)
......@@ -100,42 +93,17 @@ abstract class AbstractTestMapping extends TestNGSuite with Matchers {
}
}
class MappingBwaMemTest extends AbstractTestMapping {
val aligner = "bwa-mem"
}
class MappingBwaAlnTest extends AbstractTestMapping {
val aligner = "bwa-aln"
}
class MappingStarTest extends AbstractTestMapping {
val aligner = "star"
}
class MappingStar2PassTest extends AbstractTestMapping {
val aligner = "star-2pass"
}
class MappingBowtieTest extends AbstractTestMapping {
val aligner = "bowtie"
}
class MappingStampyTest extends AbstractTestMapping {
val aligner = "stampy"
}
class MappingGsnapTest extends AbstractTestMapping {
val aligner = "gsnap"
}
class MappingTophatTest extends AbstractTestMapping {
val aligner = "tophat"
}
class MappingBwaMemTest extends AbstractTestMapping("bwa-mem")
class MappingBwaAlnTest extends AbstractTestMapping("bwa-aln")
class MappingStarTest extends AbstractTestMapping("star")
class MappingStar2PassTest extends AbstractTestMapping("star-2pass")
class MappingBowtieTest extends AbstractTestMapping("bowtie")
class MappingStampyTest extends AbstractTestMapping("stampy")
class MappingGsnapTest extends AbstractTestMapping("gsnap")
class MappingTophatTest extends AbstractTestMapping("tophat")
object MappingTest {
val aligners = Array("bwa-mem", "bwa-aln", "star", "star-2pass", "bowtie", "stampy", "gsnap", "tophat")
val outputDir = Files.createTempDir()
new File(outputDir, "input").mkdirs()
......
Supports Markdown
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