Commit 50382ca3 authored by Peter van 't Hof's avatar Peter van 't Hof

Fixinf nullpointers on unit tests

parent 7336a86d
......@@ -114,6 +114,7 @@ object BamMetricsTest {
copyFile("ref.fa.fai")
val executables = Map(
"skip_write_dependencies" -> true,
"refFlat" -> "bla.refFlat",
"reference_fasta" -> (outputDir + File.separator + "ref.fa"),
"samtools" -> Map("exe" -> "test"),
......
......@@ -144,6 +144,7 @@ object BastyTest {
copyFile("ref.fa.fai")
val config = Map(
"skip_write_dependencies" -> true,
"name_prefix" -> "test",
"cache" -> true,
"dir" -> "test",
......
......@@ -63,6 +63,8 @@ trait BiopetQScript extends Configurable with GatkLogging { qscript: QScript =>
/** Returns the extension to make the report */
def reportClass: Option[ReportBuilderExtension] = None
val skipWriteDependencies: Boolean = config("skip_write_dependencies", default = false)
/** Script from queue itself, final to force some checks for each pipeline and write report */
final def script() {
outputDir = config("output_dir")
......@@ -122,7 +124,7 @@ trait BiopetQScript extends Configurable with GatkLogging { qscript: QScript =>
}
})
WriteDependencies.writeDependencies(functions, new File(outputDir, ".log"), qSettings.runName)
if (!skipWriteDependencies) WriteDependencies.writeDependencies(functions, new File(outputDir, ".log"), qSettings.runName)
Logging.checkErrors()
logger.info("Script complete without errors")
......
......@@ -57,7 +57,11 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config
for (q <- qscript.summaryQScripts)
deps :+= q.summaryFile
for ((_, l) <- qscript.summarizables; s <- l) s match {
case f: QFunction => deps :+= f.firstOutput
case f: QFunction => try {
deps :+= f.firstOutput
} catch {
case e: NullPointerException => logger.warn("Queue values are not init")
}
case _ =>
}
......
......@@ -117,6 +117,7 @@ object CarpTest {
copyFile("ref.fa.fai")
val executables = Map(
"skip_write_dependencies" -> true,
"reference_fasta" -> (outputDir + File.separator + "ref.fa"),
"fastqc" -> Map("exe" -> "test"),
"seqtk" -> Map("exe" -> "test"),
......
......@@ -115,6 +115,7 @@ object FlexiprepTest {
Files.touch(r2Zipped)
val executables = Map(
"skip_write_dependencies" -> true,
"seqstat" -> Map("exe" -> "test"),
"fastqc" -> Map("exe" -> "test"),
"seqtk" -> Map("exe" -> "test"),
......
......@@ -234,6 +234,7 @@ object TestGearsSingle {
bam.deleteOnExit()
val executables = Map(
"skip_write_dependencies" -> true,
"kraken" -> Map("exe" -> "test", "db" -> "test"),
"centrifuge" -> Map("exe" -> "test", "centrifuge_index" -> "test"),
"centrifugekreport" -> Map("exe" -> "test"),
......
......@@ -113,6 +113,7 @@ object GearsTest {
Files.touch(bam)
val config = Map(
"skip_write_dependencies" -> true,
"output_dir" -> outputDir,
"kraken" -> Map("exe" -> "test", "db" -> "test"),
"krakenreport" -> Map("exe" -> "test", "db" -> "test"),
......
......@@ -141,7 +141,9 @@ object DownloadGenomesTest {
val outputDir = Files.createTempDir()
outputDir.deleteOnExit()
val config = Map("output_dir" -> outputDir,
val config = Map(
"skip_write_dependencies" -> true,
"output_dir" -> outputDir,
"bwa" -> Map("exe" -> "test"),
"star" -> Map("exe" -> "test"),
"hisat2build" -> Map("exe" -> "test"),
......
......@@ -186,6 +186,7 @@ object GentrapTest {
copyFile("ref.fa.fai")
val executables: Map[String, Any] = Map(
"skip_write_dependencies" -> true,
"reference_fasta" -> (outputDir + File.separator + "ref.fa"),
"refFlat" -> (outputDir + File.separator + "ref.fa"),
"annotation_gtf" -> (outputDir + File.separator + "ref.fa"),
......
......@@ -75,6 +75,7 @@ object GwasTestTest {
}
val config = Map(
"skip_write_dependencies" -> true,
"reference_fasta" -> reference.toString,
"phenotype_file" -> phenotypeFile.toString,
"output_dir" -> outputDir,
......
......@@ -93,6 +93,7 @@ object Impute2VcfTest {
}
val config = Map(
"skip_write_dependencies" -> true,
"reference_fasta" -> reference.toString,
"phenotype_file" -> phenotypeFile.toString,
"output_dir" -> outputDir,
......
......@@ -112,6 +112,7 @@ object KopisuTest {
Files.touch(new File(controlDir, "test.txt"))
val config = Map(
"skip_write_dependencies" -> true,
"name_prefix" -> "test",
"output_dir" -> outputDir,
"reference_fasta" -> (outputDir + File.separator + "ref.fa"),
......
......@@ -128,6 +128,7 @@ abstract class AbstractTestMapping(val aligner: String) extends TestNGSuite with
}
val executables = Map(
"skip_write_dependencies" -> true,
"reference_fasta" -> (outputDir + File.separator + "ref.fa"),
"db" -> "test",
"bowtie_index" -> (outputDir + File.separator + "ref"),
......
......@@ -184,6 +184,7 @@ object MultisampleMappingTestTrait {
copyFile("empty.sam")
val config = Map(
"skip_write_dependencies" -> true,
"name_prefix" -> "test",
"cache" -> true,
"dir" -> "test",
......
......@@ -131,6 +131,7 @@ object SageTest {
copyFile("ref.fa.fai")
val config: Map[String, Any] = Map(
"skip_write_dependencies" -> true,
"reference_fasta" -> (outputDir + File.separator + "ref.fa"),
"output_dir" -> outputDir.getAbsolutePath,
"fastqc" -> Map("exe" -> "test"),
......
......@@ -198,6 +198,7 @@ object ShivaSvCallingTest {
copyFile("ref.fa.fai")
val config = Map(
"skip_write_dependencies" -> true,
"name_prefix" -> "test",
"output_dir" -> outputDir,
"cache" -> true,
......
......@@ -191,6 +191,7 @@ object ShivaTest {
copyFile("ref.fa.fai")
val config = Map(
"skip_write_dependencies" -> true,
"name_prefix" -> "test",
"cache" -> true,
"dir" -> "test",
......
......@@ -230,6 +230,7 @@ object ShivaVariantcallingTest {
copyFile("ref.fa.fai")
val config = Map(
"skip_write_dependencies" -> true,
"name_prefix" -> "test",
"output_dir" -> outputDir,
"cache" -> true,
......
......@@ -119,6 +119,7 @@ object TinyCapTest {
Files.touch(annotationRefflat)
val config = Map(
"skip_write_dependencies" -> true,
"output_dir" -> outputDir,
"reference_fasta" -> (referenceFasta.getAbsolutePath),
"bowtie_index" -> (bowtieIndex.getAbsolutePath),
......
......@@ -107,6 +107,7 @@ object ToucanTest {
exacVcfFile.deleteOnExit()
val config = Map(
"skip_write_dependencies" -> true,
"reference_fasta" -> resourcePath("/fake_chrQ.fa"),
"output_dir" -> outputDir,
"gatk_jar" -> "test",
......
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