Skip to content
Snippets Groups Projects
Commit aec67d97 authored by bow's avatar bow
Browse files

Merge branch 'feature-parralel_mapping_tests' into 'develop'

feature parralel mapping tests

This small improvement makes test for mapping 8x faster

See merge request !252
parents ba0cf48a 25cc88c4
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.{ AfterClass, DataProvider, Test }
class GentrapTest extends TestNGSuite with Matchers {
abstract class GentrapTestAbstract(val expressionMeasure: String) extends TestNGSuite with Matchers {
def initPipeline(map: Map[String, Any]): Gentrap = {
new Gentrap() {
......@@ -70,7 +70,7 @@ class GentrapTest extends TestNGSuite with Matchers {
.toMap
)
private lazy val validExpressionMeasures = Set(
val validExpressionMeasures = Set(
"fragments_per_gene", "fragments_per_exon", "bases_per_gene", "bases_per_exon",
"cufflinks_strict", "cufflinks_guided", "cufflinks_blind")
......@@ -96,7 +96,7 @@ class GentrapTest extends TestNGSuite with Matchers {
for {
sampleConfig <- sampleConfigs.toArray
expressionMeasure <- expressionMeasures
//expressionMeasure <- expressionMeasures
strandProtocol <- strandProtocols
} yield Array(sampleConfig, List(expressionMeasure), strandProtocol)
}
......@@ -175,6 +175,14 @@ class GentrapTest extends TestNGSuite with Matchers {
}
}
class GentrapFragmentsPerGeneTest extends GentrapTestAbstract("fragments_per_gene")
class GentrapFragmentsPerExonTest extends GentrapTestAbstract("fragments_per_exon")
class GentrapBasesPerGeneTest extends GentrapTestAbstract("bases_per_gene")
class GentrapBasesPerExonTest extends GentrapTestAbstract("bases_per_exon")
class GentrapCufflinksStrictTest extends GentrapTestAbstract("cufflinks_strict")
class GentrapCufflinksGuidedTest extends GentrapTestAbstract("cufflinks_guided")
class GentrapCufflinksBlindTest extends GentrapTestAbstract("cufflinks_blind")
object GentrapTest {
val outputDir = Files.createTempDir()
new File(outputDir, "input").mkdirs()
......
......@@ -141,8 +141,8 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
paired = input_R2.isDefined
if (readgroupId == null) readgroupId = sampleId.get + "-" + libId.get
else if (readgroupId == null) readgroupId = config("readgroup_id")
if (readgroupId == null)
readgroupId = config("readgroup_id", default = sampleId.get + "-" + libId.get)
if (outputName == null) outputName = readgroupId
......
......@@ -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.
*/
class MappingTest 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"
......@@ -48,15 +44,13 @@ class MappingTest extends TestNGSuite with Matchers {
@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)
for (
aligner <- aligners;
pair <- paired;
chunk <- chunks;
skipMarkDuplicate <- skipMarkDuplicates;
......@@ -99,7 +93,17 @@ class MappingTest extends TestNGSuite with Matchers {
}
}
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 outputDir = Files.createTempDir()
new File(outputDir, "input").mkdirs()
......
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