From 480684fb9bcb9b2c4acc362573aeb0aa76a507bc Mon Sep 17 00:00:00 2001 From: Sander Bollen <a.h.b.bollen@lumc.nl> Date: Fri, 14 Aug 2015 11:43:04 +0200 Subject: [PATCH] > 85% class coverage for BastyGenerateFasta --- .../nl/lumc/sasc/biopet/tools/BastyGenerateFasta.scala | 3 +++ .../lumc/sasc/biopet/tools/BastyGenerateFastaTest.scala | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/BastyGenerateFasta.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/BastyGenerateFasta.scala index deb9aa38c..b682eda9d 100644 --- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/BastyGenerateFasta.scala +++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/BastyGenerateFasta.scala @@ -172,9 +172,12 @@ object BastyGenerateFasta extends ToolCommand { if (cmdArgs.outputConsensus != null || cmdArgs.outputConsensusVariants != null) { writeConsensus() } + + //FIXME: what to do if outputcConsensus is set, but not outputConsensusVariants (and vice versa)? } protected def writeConsensus() { + //FIXME: preferably split this up in functions, so that they can be unit tested val referenceFile = new IndexedFastaSequenceFile(cmdArgs.reference) val referenceDict = referenceFile.getSequenceDictionary diff --git a/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/BastyGenerateFastaTest.scala b/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/BastyGenerateFastaTest.scala index dea9abb7f..d67f36517 100644 --- a/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/BastyGenerateFastaTest.scala +++ b/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/BastyGenerateFastaTest.scala @@ -47,6 +47,15 @@ class BastyGenerateFastaTest extends TestNGSuite with MockitoSugar with Matchers main(arguments) } + @Test def testMainVcfAndBamMore = { + val tmp = File.createTempFile("basty_out", ".fa") + val tmppath = tmp.getAbsolutePath + tmp.deleteOnExit() + + val arguments = Array("-V", chrQ_path, "--outputConsensus", tmppath, "--outputConsensusVariants", tmppath, "--bamFile", bam_path, "--sampleName", "Child_7006504", "--reference", chrQRef_path, "--outputName", "test") + main(arguments) + } + @Test def testGetMaxAllele = { val reader = new VCFFileReader(vepped, false) val record = reader.iterator().next() -- GitLab