diff --git a/public/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SnptestToVcf.scala b/public/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SnptestToVcf.scala index f990a0e4d6aa322e1436a1d802b9d723429a3d44..19bc0c11232a63dc103b261c8084e7e681e143ff 100644 --- a/public/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SnptestToVcf.scala +++ b/public/biopet-tools/src/main/scala/nl/lumc/sasc/biopet/tools/SnptestToVcf.scala @@ -60,11 +60,11 @@ object SnptestToVcf extends ToolCommand { val reference = new FastaSequenceFile(referenceFasta, true) val vcfHeader = new VCFHeader() vcfHeader.setSequenceDictionary(reference.getSequenceDictionary) - val writer = new AsyncVariantContextWriter(new VariantContextWriterBuilder() + val writer = new VariantContextWriterBuilder() .setOutputFile(outputVcf) .setReferenceDictionary(vcfHeader.getSequenceDictionary) .unsetOption(Options.INDEX_ON_THE_FLY) - .build) + .build writer.writeHeader(vcfHeader) writer.close() } diff --git a/public/gwas-test/src/main/scala/nl/lumc/sasc/biopet/pipelines/gwastest/GwasTest.scala b/public/gwas-test/src/main/scala/nl/lumc/sasc/biopet/pipelines/gwastest/GwasTest.scala index ce4d48ef4ec7698288159ec32f83c9a83e9db8cd..69539ec403001ea6feda1ed11aac70d6d7af58c8 100644 --- a/public/gwas-test/src/main/scala/nl/lumc/sasc/biopet/pipelines/gwastest/GwasTest.scala +++ b/public/gwas-test/src/main/scala/nl/lumc/sasc/biopet/pipelines/gwastest/GwasTest.scala @@ -94,15 +94,17 @@ class GwasTest(val root: Configurable) extends QScript with BiopetQScript with R val snpTests = BedRecordList.fromReference(referenceFasta()) .scatter(config("bin_size", default = 1000000)) .allRecords.map { region => - val regionDir = new File(outputDir, "snptest" + File.separator + region.chr) + val name = s"${region.chr}-${region.start + 1}-${region.end}" + + val regionDir = new File(outputDir, ".queue" + File.separator + "regions" + File.separator + region.chr) regionDir.mkdirs() - val bedFile = new File(regionDir, s"${region.chr}-${region.start + 1}-${region.end}.bed") + val bedFile = new File(regionDir, s"${name}.bed") BedRecordList.fromList(List(region)).writeToFile(bedFile) bedFile.deleteOnExit() val sv = new SelectVariants(this) sv.inputFiles :+= chrVcfFiles.getOrElse(region.chr, vcfFile) - sv.outputFile = new File(regionDir, s"${region.chr}-${region.start + 1}-${region.end}.vcf.gz") + sv.outputFile = new File(regionDir, s"${name}.vcf.gz") sv.intervals :+= bedFile sv.isIntermediate = true add(sv) @@ -110,12 +112,12 @@ class GwasTest(val root: Configurable) extends QScript with BiopetQScript with R val snptest = new Snptest(this) snptest.inputGenotypes :+= sv.outputFile snptest.inputSampleFiles :+= phenotypeFile - snptest.outputFile = Some(new File(regionDir, s"${region.chr}-${region.start + 1}-${region.end}.snptest")) + snptest.outputFile = Some(new File(regionDir, s"${name}.snptest")) add(snptest) val snptestToVcf = new SnptestToVcf(this) snptestToVcf.inputInfo = snptest.outputFile.get - snptestToVcf.outputVcf = new File(regionDir, s"${region.chr}-${region.start + 1}-${region.end}.snptest.vcf.gz") + snptestToVcf.outputVcf = new File(regionDir, s"${name}.snptest.vcf.gz") snptestToVcf.contig = region.chr add(snptestToVcf)