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

Rename Seqstat -> SeqStat

parent e4b0834e
Branches
Tags
No related merge requests found
...@@ -38,7 +38,7 @@ import nl.lumc.sasc.biopet.utils.ConfigUtils ...@@ -38,7 +38,7 @@ import nl.lumc.sasc.biopet.utils.ConfigUtils
* *
* @param root Configuration object for the pipeline * @param root Configuration object for the pipeline
*/ */
class Seqstat(val root: Configurable) extends ToolCommandFuntion with Summarizable { class SeqStat(val root: Configurable) extends ToolCommandFuntion with Summarizable {
javaMainClass = getClass.getName javaMainClass = getClass.getName
@Input(doc = "Input FASTQ", shortName = "input", required = true) @Input(doc = "Input FASTQ", shortName = "input", required = true)
...@@ -76,16 +76,16 @@ object FqEncoding extends Enumeration { ...@@ -76,16 +76,16 @@ object FqEncoding extends Enumeration {
val Unknown = Value(0, "Unknown") val Unknown = Value(0, "Unknown")
} }
object Seqstat extends ToolCommand { object SeqStat extends ToolCommand {
def apply(root: Configurable, input: File, output: File): Seqstat = { def apply(root: Configurable, input: File, output: File): SeqStat = {
val seqstat = new Seqstat(root) val seqstat = new SeqStat(root)
seqstat.input = input seqstat.input = input
seqstat.output = new File(output, input.getName.substring(0, input.getName.lastIndexOf(".")) + ".seqstats.json") seqstat.output = new File(output, input.getName.substring(0, input.getName.lastIndexOf(".")) + ".seqstats.json")
seqstat seqstat
} }
def apply(root: Configurable, fastqfile: File, outDir: String): Seqstat = { def apply(root: Configurable, fastqfile: File, outDir: String): SeqStat = {
val seqstat = new Seqstat(root) val seqstat = new SeqStat(root)
seqstat.input = fastqfile seqstat.input = fastqfile
seqstat.output = new File(outDir, fastqfile.getName.substring(0, fastqfile.getName.lastIndexOf(".")) + ".seqstats.json") seqstat.output = new File(outDir, fastqfile.getName.substring(0, fastqfile.getName.lastIndexOf(".")) + ".seqstats.json")
seqstat seqstat
......
...@@ -27,9 +27,9 @@ import org.testng.annotations.{ DataProvider, Test } ...@@ -27,9 +27,9 @@ import org.testng.annotations.{ DataProvider, Test }
import scala.collection.JavaConverters._ import scala.collection.JavaConverters._
class SeqstatTest extends TestNGSuite with MockitoSugar with Matchers { class SeqStatTest extends TestNGSuite with MockitoSugar with Matchers {
import nl.lumc.sasc.biopet.tools.Seqstat._ import nl.lumc.sasc.biopet.tools.SeqStat._
import nl.lumc.sasc.biopet.tools.FqEncoding._ import nl.lumc.sasc.biopet.tools.FqEncoding._
private def resourceFile(p: String): File = private def resourceFile(p: String): File =
...@@ -59,7 +59,7 @@ class SeqstatTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -59,7 +59,7 @@ class SeqstatTest extends TestNGSuite with MockitoSugar with Matchers {
def testSeqCountReads(fqMock: FastqReader) = { def testSeqCountReads(fqMock: FastqReader) = {
when(fqMock.iterator) thenReturn recordsOver("1", "2", "3", "4", "5") when(fqMock.iterator) thenReturn recordsOver("1", "2", "3", "4", "5")
val seqstat = Seqstat val seqstat = SeqStat
val numReads = seqstat.seqStat(fqMock) val numReads = seqstat.seqStat(fqMock)
numReads shouldBe 5 numReads shouldBe 5
} }
...@@ -67,7 +67,7 @@ class SeqstatTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -67,7 +67,7 @@ class SeqstatTest extends TestNGSuite with MockitoSugar with Matchers {
@Test(dataProvider = "mockReaderProvider", groups = Array("phredscore"), singleThreaded = true, dependsOnGroups = Array("read")) @Test(dataProvider = "mockReaderProvider", groups = Array("phredscore"), singleThreaded = true, dependsOnGroups = Array("read"))
def testEncodingDetectionSanger(fqMock: FastqReader) = { def testEncodingDetectionSanger(fqMock: FastqReader) = {
val seqstat = Seqstat val seqstat = SeqStat
seqstat.summarize() seqstat.summarize()
seqstat.phredEncoding shouldBe Sanger seqstat.phredEncoding shouldBe Sanger
...@@ -76,7 +76,7 @@ class SeqstatTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -76,7 +76,7 @@ class SeqstatTest extends TestNGSuite with MockitoSugar with Matchers {
@Test(dataProvider = "mockReaderProvider", groups = Array("nucleocount"), singleThreaded = true, dependsOnGroups = Array("phredscore")) @Test(dataProvider = "mockReaderProvider", groups = Array("nucleocount"), singleThreaded = true, dependsOnGroups = Array("phredscore"))
def testEncodingNucleotideCount(fqMock: FastqReader) = { def testEncodingNucleotideCount(fqMock: FastqReader) = {
val seqstat = Seqstat val seqstat = SeqStat
nucleotideHistoMap('N') shouldEqual 5 nucleotideHistoMap('N') shouldEqual 5
nucleotideHistoMap('A') shouldEqual 5 nucleotideHistoMap('A') shouldEqual 5
nucleotideHistoMap('C') shouldEqual 5 nucleotideHistoMap('C') shouldEqual 5
...@@ -87,7 +87,7 @@ class SeqstatTest extends TestNGSuite with MockitoSugar with Matchers { ...@@ -87,7 +87,7 @@ class SeqstatTest extends TestNGSuite with MockitoSugar with Matchers {
@Test(dataProvider = "mockReaderProvider", groups = Array("basehistogram"), singleThreaded = true, dependsOnGroups = Array("nucleocount")) @Test(dataProvider = "mockReaderProvider", groups = Array("basehistogram"), singleThreaded = true, dependsOnGroups = Array("nucleocount"))
def testEncodingBaseHistogram(fqMock: FastqReader) = { def testEncodingBaseHistogram(fqMock: FastqReader) = {
val seqstat = Seqstat val seqstat = SeqStat
baseHistogram(40) shouldEqual 5 baseHistogram(40) shouldEqual 5
baseHistogram(39) shouldEqual 10 baseHistogram(39) shouldEqual 10
baseHistogram(34) shouldEqual 15 baseHistogram(34) shouldEqual 15
......
...@@ -54,7 +54,7 @@ object BiopetExecutablePublic extends BiopetExecutable { ...@@ -54,7 +54,7 @@ object BiopetExecutablePublic extends BiopetExecutable {
nl.lumc.sasc.biopet.tools.BastyGenerateFasta, nl.lumc.sasc.biopet.tools.BastyGenerateFasta,
nl.lumc.sasc.biopet.tools.MergeAlleles, nl.lumc.sasc.biopet.tools.MergeAlleles,
nl.lumc.sasc.biopet.tools.SamplesTsvToJson, nl.lumc.sasc.biopet.tools.SamplesTsvToJson,
nl.lumc.sasc.biopet.tools.Seqstat, nl.lumc.sasc.biopet.tools.SeqStat,
nl.lumc.sasc.biopet.tools.VepNormalizer, nl.lumc.sasc.biopet.tools.VepNormalizer,
nl.lumc.sasc.biopet.tools.AnnotateVcfWithBed, nl.lumc.sasc.biopet.tools.AnnotateVcfWithBed,
nl.lumc.sasc.biopet.tools.VcfWithVcf) nl.lumc.sasc.biopet.tools.VcfWithVcf)
......
...@@ -22,7 +22,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Argument } ...@@ -22,7 +22,7 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Argument }
import nl.lumc.sasc.biopet.core.{ SampleLibraryTag, BiopetQScript, PipelineCommand } import nl.lumc.sasc.biopet.core.{ SampleLibraryTag, BiopetQScript, PipelineCommand }
import nl.lumc.sasc.biopet.core.config.Configurable import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.extensions._ import nl.lumc.sasc.biopet.extensions._
import nl.lumc.sasc.biopet.tools.Seqstat import nl.lumc.sasc.biopet.tools.SeqStat
import nl.lumc.sasc.biopet.tools.FastqSync import nl.lumc.sasc.biopet.tools.FastqSync
class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with SampleLibraryTag { class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with SampleLibraryTag {
...@@ -186,14 +186,14 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with ...@@ -186,14 +186,14 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
deps_R2 ::= R2.get deps_R2 ::= R2.get
} }
val seqstat_R1 = Seqstat(this, R1, outDir) val seqstat_R1 = SeqStat(this, R1, outDir)
seqstat_R1.isIntermediate = true seqstat_R1.isIntermediate = true
seqstat_R1.deps = deps_R1 seqstat_R1.deps = deps_R1
add(seqstat_R1) add(seqstat_R1)
addSummarizable(seqstat_R1, "seqstat_R1") addSummarizable(seqstat_R1, "seqstat_R1")
if (paired) { if (paired) {
val seqstat_R2 = Seqstat(this, R2.get, outDir) val seqstat_R2 = SeqStat(this, R2.get, outDir)
seqstat_R2.isIntermediate = true seqstat_R2.isIntermediate = true
seqstat_R2.deps = deps_R2 seqstat_R2.deps = deps_R2
add(seqstat_R2) add(seqstat_R2)
...@@ -259,13 +259,13 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with ...@@ -259,13 +259,13 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
if (paired) R2 = Some(sickle.output_R2) if (paired) R2 = Some(sickle.output_R2)
} }
val seqstat_R1_after = Seqstat(this, R1, outDir) val seqstat_R1_after = SeqStat(this, R1, outDir)
seqstat_R1_after.deps = deps_R1 seqstat_R1_after.deps = deps_R1
add(seqstat_R1_after) add(seqstat_R1_after)
addSummarizable(seqstat_R1_after, "seqstat_R1_after") addSummarizable(seqstat_R1_after, "seqstat_R1_after")
if (paired) { if (paired) {
val seqstat_R2_after = Seqstat(this, R2.get, outDir) val seqstat_R2_after = SeqStat(this, R2.get, outDir)
seqstat_R2_after.deps = deps_R2 seqstat_R2_after.deps = deps_R2
add(seqstat_R2_after) add(seqstat_R2_after)
addSummarizable(seqstat_R2_after, "seqstat_R2_after") addSummarizable(seqstat_R2_after, "seqstat_R2_after")
......
...@@ -26,7 +26,7 @@ import org.testng.annotations.{ AfterClass, DataProvider, Test } ...@@ -26,7 +26,7 @@ import org.testng.annotations.{ AfterClass, DataProvider, Test }
import nl.lumc.sasc.biopet.core.config.Config import nl.lumc.sasc.biopet.core.config.Config
import nl.lumc.sasc.biopet.extensions.{ Sickle, Gzip, Zcat } import nl.lumc.sasc.biopet.extensions.{ Sickle, Gzip, Zcat }
import nl.lumc.sasc.biopet.tools.Seqstat import nl.lumc.sasc.biopet.tools.SeqStat
import nl.lumc.sasc.biopet.tools.FastqSync import nl.lumc.sasc.biopet.tools.FastqSync
import nl.lumc.sasc.biopet.utils.ConfigUtils import nl.lumc.sasc.biopet.utils.ConfigUtils
...@@ -78,7 +78,7 @@ class FlexiprepTest extends TestNGSuite with Matchers { ...@@ -78,7 +78,7 @@ class FlexiprepTest extends TestNGSuite with Matchers {
else if (!paired && (skipClip && skipTrim)) 1 else if (!paired && (skipClip && skipTrim)) 1
else if (paired && !(skipClip && skipTrim)) 4 else if (paired && !(skipClip && skipTrim)) 4
else if (!paired && !(skipClip && skipTrim)) 2) else if (!paired && !(skipClip && skipTrim)) 2)
flexiprep.functions.count(_.isInstanceOf[Seqstat]) shouldBe (if (paired) 4 else 2) flexiprep.functions.count(_.isInstanceOf[SeqStat]) shouldBe (if (paired) 4 else 2)
flexiprep.functions.count(_.isInstanceOf[Zcat]) shouldBe (if (zipped) (if (paired) 2 else 1) else 0) flexiprep.functions.count(_.isInstanceOf[Zcat]) shouldBe (if (zipped) (if (paired) 2 else 1) else 0)
flexiprep.functions.count(_.isInstanceOf[SeqtkSeq]) shouldBe (if (paired) 2 else 1) flexiprep.functions.count(_.isInstanceOf[SeqtkSeq]) shouldBe (if (paired) 2 else 1)
flexiprep.functions.count(_.isInstanceOf[Cutadapt]) shouldBe (if (skipClip) 0 else (if (paired) 2 else 1)) flexiprep.functions.count(_.isInstanceOf[Cutadapt]) shouldBe (if (skipClip) 0 else (if (paired) 2 else 1))
......
...@@ -29,7 +29,7 @@ import nl.lumc.sasc.biopet.core.config.Config ...@@ -29,7 +29,7 @@ import nl.lumc.sasc.biopet.core.config.Config
import nl.lumc.sasc.biopet.extensions.bwa.{ BwaSamse, BwaSampe, BwaAln, BwaMem } import nl.lumc.sasc.biopet.extensions.bwa.{ BwaSamse, BwaSampe, BwaAln, BwaMem }
import nl.lumc.sasc.biopet.extensions.picard.{ MergeSamFiles, AddOrReplaceReadGroups, MarkDuplicates, SortSam } import nl.lumc.sasc.biopet.extensions.picard.{ MergeSamFiles, AddOrReplaceReadGroups, MarkDuplicates, SortSam }
import nl.lumc.sasc.biopet.pipelines.flexiprep.{ SeqtkSeq, Cutadapt, Fastqc } import nl.lumc.sasc.biopet.pipelines.flexiprep.{ SeqtkSeq, Cutadapt, Fastqc }
import nl.lumc.sasc.biopet.tools.{ Seqstat, FastqSync } import nl.lumc.sasc.biopet.tools.{ SeqStat, FastqSync }
import nl.lumc.sasc.biopet.utils.ConfigUtils import nl.lumc.sasc.biopet.utils.ConfigUtils
/** /**
...@@ -91,7 +91,7 @@ class MappingTest extends TestNGSuite with Matchers { ...@@ -91,7 +91,7 @@ class MappingTest extends TestNGSuite with Matchers {
//Flexiprep //Flexiprep
mapping.functions.count(_.isInstanceOf[Fastqc]) shouldBe (if (skipFlexiprep) 0 else if (paired) 4 else 2) mapping.functions.count(_.isInstanceOf[Fastqc]) shouldBe (if (skipFlexiprep) 0 else if (paired) 4 else 2)
mapping.functions.count(_.isInstanceOf[Zcat]) shouldBe (if (!zipped || (chunks > 1 && skipFlexiprep)) 0 else if (paired) 2 else 1) mapping.functions.count(_.isInstanceOf[Zcat]) shouldBe (if (!zipped || (chunks > 1 && skipFlexiprep)) 0 else if (paired) 2 else 1)
mapping.functions.count(_.isInstanceOf[Seqstat]) shouldBe ((if (skipFlexiprep) 0 else if (paired) 4 else 2) * chunks) mapping.functions.count(_.isInstanceOf[SeqStat]) shouldBe ((if (skipFlexiprep) 0 else if (paired) 4 else 2) * chunks)
mapping.functions.count(_.isInstanceOf[SeqtkSeq]) shouldBe ((if (skipFlexiprep) 0 else if (paired) 2 else 1) * chunks) mapping.functions.count(_.isInstanceOf[SeqtkSeq]) shouldBe ((if (skipFlexiprep) 0 else if (paired) 2 else 1) * chunks)
mapping.functions.count(_.isInstanceOf[Cutadapt]) shouldBe ((if (skipFlexiprep) 0 else if (paired) 2 else 1) * chunks) mapping.functions.count(_.isInstanceOf[Cutadapt]) shouldBe ((if (skipFlexiprep) 0 else if (paired) 2 else 1) * chunks)
mapping.functions.count(_.isInstanceOf[FastqSync]) shouldBe ((if (skipFlexiprep) 0 else if (paired && !skipFlexiprep) 1 else 0) * chunks) mapping.functions.count(_.isInstanceOf[FastqSync]) shouldBe ((if (skipFlexiprep) 0 else if (paired && !skipFlexiprep) 1 else 0) * chunks)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment