Commit e7237458 authored by Sander Bollen's avatar Sander Bollen
Browse files

refactor (move test and packages to correct folder)

parent d67cd69b
......@@ -3,7 +3,7 @@ package nl.lumc.sasc.biopet.extensions.bcftools
import java.io.File
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Argument, Output, Input}
import org.broadinstitute.gatk.utils.commandline.{ Argument, Input, Output }
/**
* Created by ahbbollen on 12-10-15.
......@@ -112,8 +112,6 @@ class BcftoolsView(val root: Configurable) extends Bcftools {
@Argument(doc = "Exclude privates")
var excludePrivate: Boolean = false
override def beforeGraph() = {
super.beforeGraph()
......@@ -126,21 +124,21 @@ class BcftoolsView(val root: Configurable) extends Bcftools {
def baseCmd = {
executable + conditional(dropGenotype, "-G") + conditional(headerOnly, "-h") +
required("-l", compressionLevel) + required("-O", outputType) +
optional("-r", regions) + optional("-R", regionFile) +
optional("-t", targets) + optional("-T", targetFile) +
conditional(trimAltAlleles, "-a") + conditional(noUpdate, "-I") +
repeat("-s", samples) + optional("-S", sampleFile) +
optional("-c", minAC) + optional("-C", maxAC) +
optional("-e", exclude) + optional("-f", applyFilters) +
optional("-g", genotype) + optional("-i", include) +
conditional(known, "-k") + optional("-m", minAlleles) +
optional("-M", maxAlleles) + conditional(novel, "-n") +
conditional(phased, "-p") + conditional(excludePhased, "-P") +
optional("-q", minAF) + optional("-Q", maxAF) +
conditional(uncalled, "-u") + conditional(excludeUncalled, "-U") +
optional("-v", types) + conditional(onlyPrivate, "-x") +
conditional(excludePrivate, "-X")
required("-l", compressionLevel) + required("-O", outputType) +
optional("-r", regions) + optional("-R", regionFile) +
optional("-t", targets) + optional("-T", targetFile) +
conditional(trimAltAlleles, "-a") + conditional(noUpdate, "-I") +
repeat("-s", samples) + optional("-S", sampleFile) +
optional("-c", minAC) + optional("-C", maxAC) +
optional("-e", exclude) + optional("-f", applyFilters) +
optional("-g", genotype) + optional("-i", include) +
conditional(known, "-k") + optional("-m", minAlleles) +
optional("-M", maxAlleles) + conditional(novel, "-n") +
conditional(phased, "-p") + conditional(excludePhased, "-P") +
optional("-q", minAF) + optional("-Q", maxAF) +
conditional(uncalled, "-u") + conditional(excludeUncalled, "-U") +
optional("-v", types) + conditional(onlyPrivate, "-x") +
conditional(excludePrivate, "-X")
}
def cmdPipeInput = {
......
package nl.lumc.sasc.biopet.extensions
import java.io.File
import nl.lumc.sasc.biopet.extensions.bcftools.BcftoolsView
import org.scalatest.Matchers
import org.scalatest.mock.MockitoSugar
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test
/**
* Created by ahbbollen on 12-10-15.
*/
class BcfToolsTest extends TestNGSuite with MockitoSugar with Matchers {
@Test
def BcfToolsViewTest = {
val view = new BcftoolsView(null)
view.executable = "bcftools"
val tmpInput = File.createTempFile("bcftoolstest", ".vcf")
tmpInput.deleteOnExit()
val tmpOutput = File.createTempFile("bcftoolstest", ".vcf.gz")
tmpOutput.deleteOnExit()
val inputPath = tmpInput.getAbsolutePath
val outputPath = tmpOutput.getAbsolutePath
view.input = tmpInput
view.output = tmpOutput
// view.cmdLine should equal(s"bcftools -o $outputPath $inputPath}")
}
}
......@@ -89,7 +89,7 @@ class ManweTest extends TestNGSuite with Matchers {
out.deleteOnExit()
manwe.output = out
manwe.uri = Some("/uri/1")
manwe.uri = "/uri/1"
manwe.cmd should equal(s"manwe data-sources download /uri/1 -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
}
......@@ -130,7 +130,7 @@ class ManweTest extends TestNGSuite with Matchers {
out.deleteOnExit()
manwe.output = out
manwe.uri = Some("/uri/1")
manwe.uri = "/uri/1"
manwe.cmd should equal(s"manwe samples activate /uri/1 -c /usr/local/nonexistent.conf > ${out.getAbsolutePath}")
}
......
package nl.lumc.sasc.biopet.pipelines.toucan
import nl.lumc.sasc.biopet.extensions.manwe.{ManweAnnotateVcf, ManweSamplesActivate, ManweSamplesImport}
import nl.lumc.sasc.biopet.extensions.manwe.{ ManweAnnotateVcf, ManweSamplesActivate, ManweSamplesImport }
import nl.lumc.sasc.biopet.utils.config.Configurable
import scala.io.Source
......@@ -10,8 +10,8 @@ import scala.io.Source
* Wrapper for manwe activate after importing and annotating
*/
class ManweActivateAfterAnnotImport(root: Configurable,
annotate: ManweAnnotateVcf,
imported: ManweSamplesImport) extends ManweSamplesActivate(root) {
annotate: ManweAnnotateVcf,
imported: ManweSamplesImport) extends ManweSamplesActivate(root) {
override def beforeGraph: Unit = {
super.beforeGraph
......
......@@ -2,7 +2,7 @@ package nl.lumc.sasc.biopet.pipelines.toucan
import java.io.File
import nl.lumc.sasc.biopet.extensions.manwe.{ManweAnnotateVcf, ManweDataSourcesDownload}
import nl.lumc.sasc.biopet.extensions.manwe.{ ManweAnnotateVcf, ManweDataSourcesDownload }
import nl.lumc.sasc.biopet.utils.config.Configurable
import scala.io.Source
......@@ -13,7 +13,6 @@ import scala.io.Source
class ManweDownloadAfterAnnotate(root: Configurable,
annotate: ManweAnnotateVcf) extends ManweDataSourcesDownload(root) {
override def beforeGraph: Unit = {
super.beforeGraph
require(annotate != null, "Annotate should be defined")
......@@ -23,7 +22,6 @@ class ManweDownloadAfterAnnotate(root: Configurable,
override def beforeCmd: Unit = {
super.beforeCmd
val reader = Source.fromFile(annotate.output)
this.uri = reader.getLines().toList.head
reader.close()
......
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