Commit a173f06d authored by Peter van 't Hof's avatar Peter van 't Hof

Merge remote-tracking branch 'remotes/origin/develop' into fix-BIOPET-538

# Conflicts:
#	Jenkinsfile
parents be27ea6a 527d43b8
node('local') {
try {
timeout(45) {
try {
stage('Init') {
tool 'JDK 8u102'
tool 'Apache Maven 3.3.9'
}
stage('Init') {
tool 'JDK 8u102'
tool 'Apache Maven 3.3.9'
}
stage('Checkout') {
checkout scm
sh 'git submodule update --init --recursive'
}
stage('Checkout') {
checkout scm
sh 'git submodule update --init --recursive'
}
stage('Build and Test') {
withMaven(maven: 'Apache Maven 3.3.9', jdk: 'JDK 8u102') {
sh 'mvn -B -T 2 -Dmaven.test.failure.ignore clean package'
stage('Build and Test') {
withMaven(maven: 'Apache Maven 3.3.9', jdk: 'JDK 8u102') {
sh 'mvn -B -T 2 -Dmaven.test.failure.ignore clean package'
}
}
}
stage('Report Tests') {
junit '*/target/surefire-reports/*.xml'
}
stage('Report Tests') {
junit '*/target/surefire-reports/*.xml'
}
stage('Check git on changes') {
sh 'if [ $(git diff | wc -l) -eq 0 ]; then true; else echo "[ERROR] Git is not clean anymore after build"; false; fi'
}
stage('Check git on changes') {
sh 'if [ $(git diff | wc -l) -eq 0 ]; then true; else echo "[ERROR] Git is not clean anymore after build"; false; fi'
}
stage('Check Documentation') {
sh 'mkdocs build --clean --strict'
}
stage('Check Documentation') {
sh 'mkdocs build --clean --strict'
}
if(currentBuild.result == null || "SUCCESS".equals(currentBuild.result)) {
currentBuild.result = "SUCCESS"
slackSend (color: '#00FF00', message: "${currentBuild.result}: Job '${env.JOB_NAME} #${env.BUILD_NUMBER}' (<${env.BUILD_URL}|Open>)", channel: '#biopet-bot', teamDomain: 'lumc', tokenCredentialId: 'lumc')
} else {
slackSend (color: '#FFFF00', message: "${currentBuild.result}: Job '${env.JOB_NAME} #${env.BUILD_NUMBER}' (<${env.BUILD_URL}|Open>)", channel: '#biopet-bot', teamDomain: 'lumc', tokenCredentialId: 'lumc')
}
if (currentBuild.result == null || "SUCCESS".equals(currentBuild.result)) {
currentBuild.result = "SUCCESS"
slackSend(color: '#00FF00', message: "${currentBuild.result}: Job '${env.JOB_NAME} #${env.BUILD_NUMBER}' (<${env.BUILD_URL}|Open>)", channel: '#biopet-bot', teamDomain: 'lumc', tokenCredentialId: 'lumc')
} else {
slackSend(color: '#FFFF00', message: "${currentBuild.result}: Job '${env.JOB_NAME} #${env.BUILD_NUMBER}' (<${env.BUILD_URL}|Open>)", channel: '#biopet-bot', teamDomain: 'lumc', tokenCredentialId: 'lumc')
}
} catch (e) {
if(currentBuild.result == null || "FAILED".equals(currentBuild.result)) {
currentBuild.result = "FAILED"
}
slackSend (color: '#FF0000', message: "${currentBuild.result}: Job '${env.JOB_NAME} #${env.BUILD_NUMBER}' (<${env.BUILD_URL}|Open>)", channel: '#biopet-bot', teamDomain: 'lumc', tokenCredentialId: 'lumc')
} catch (e) {
if (currentBuild.result == null || "FAILED".equals(currentBuild.result)) {
currentBuild.result = "FAILED"
}
slackSend(color: '#FF0000', message: "${currentBuild.result}: Job '${env.JOB_NAME} #${env.BUILD_NUMBER}' (<${env.BUILD_URL}|Open>)", channel: '#biopet-bot', teamDomain: 'lumc', tokenCredentialId: 'lumc')
throw e
throw e
}
}
}
......@@ -5,7 +5,7 @@
Biopet (Bio Pipeline Execution Toolkit) is the main pipeline development framework of the LUMC Sequencing Analysis Support Core team. It contains our main pipelines and some of the command line tools we develop in-house. It is meant to be used in the main [SHARK](https://humgenprojects.lumc.nl/trac/shark) computing cluster. While usage outside of SHARK is technically possible, some adjustments may need to be made in order to do so.
Full documantation is here: [Biopet documantation](http://biopet-docs.readthedocs.io/en/latest/)
Full documentation is here: [Biopet documentation](http://biopet-docs.readthedocs.io/en/latest/)
## Quick Start
......@@ -60,7 +60,7 @@ Biopet is based on the Queue framework developed by the Broad Institute as part
We welcome any kind of contribution, be it merge requests on the code base, documentation updates, or any kinds of other fixes! The main language we use is Scala, though the repository also contains a small bit of Python and R. Our main code repository is located at [https://github.com/biopet/biopet](https://github.com/biopet/biopet/issues), along with our issue tracker.
For more information please go to our [Developer documantation](http://biopet-docs.readthedocs.io/en/develop/developer/getting-started/)
For more information please go to our [Developer documentation](http://biopet-docs.readthedocs.io/en/develop/developer/getting-started/)
## About
......
......@@ -74,7 +74,7 @@ object VcfStats extends ToolCommand {
opt[File]('o', "outputDir") required () unbounded () maxOccurs 1 valueName "<file>" action { (x, c) =>
c.copy(outputDir = x)
} validate {
x => if (x == null) failure("Output directory required") else success
x => if (x == null) failure("Valid output directory required") else if (x.exists) success else failure(s"Output directory does not exist: $x")
} text "Path to directory for output (required)"
opt[File]('i', "intervals") unbounded () valueName "<file>" action { (x, c) =>
c.copy(intervals = Some(x))
......
......@@ -15,15 +15,16 @@
package nl.lumc.sasc.biopet.tools
import java.io.File
import java.nio.file.{ Files, Paths }
import java.nio.file.{Files, Paths}
import htsjdk.variant.vcf.VCFFileReader
import nl.lumc.sasc.biopet.tools.vcfstats.{ SampleStats, SampleToSampleStats, Stats, VcfStats }
import nl.lumc.sasc.biopet.tools.vcfstats.{SampleStats, SampleToSampleStats, Stats, VcfStats}
import nl.lumc.sasc.biopet.tools.vcfstats.VcfStats._
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test
import nl.lumc.sasc.biopet.utils.sortAnyAny
import org.apache.commons.io.FileUtils
import scala.collection.mutable
......@@ -162,6 +163,16 @@ class VcfStatsTest extends TestNGSuite with Matchers {
valueFromTsv(i, "Sample_ID_3", "bam") should be(empty)
}
@Test
def testNoExistOutputDir: Unit = {
val tmp = Files.createTempDirectory("vcfStats")
FileUtils.deleteDirectory(new File(tmp.toAbsolutePath.toString))
val vcf = resourcePath("/chrQ.vcf.gz")
val ref = resourcePath("/fake_chrQ.fa")
an [IllegalArgumentException] should be thrownBy main(Array("-I", vcf, "-R", ref, "-o", tmp.toAbsolutePath.toString))
}
@Test
def testMain() = {
val tmp = Files.createTempDirectory("vcfStats")
......
......@@ -103,8 +103,10 @@ At this moment the following variant callers can be used
* <a href="https://samtools.github.io/bcftools/bcftools.html">bcftools</a>
* <a href="https://samtools.github.io/bcftools/bcftools.html">bcftools_singlesample</a>
* <a href="https://github.com/ekg/freebayes">freebayes</a>
* <a href="http://varscan.sourceforge.net/">varscan</a>
* [raw](../tools/MpileupToVcf)
## Config options
To view all possible config options please navigate to our Gitlab wiki page
......
......@@ -64,13 +64,6 @@ class XhmmMethod(val root: Configurable) extends CnvMethod with Reference {
val firstMatrix = new XhmmMatrix(this)
firstMatrix.inputMatrix = merged.output
firstMatrix.outputMatrix = swapExt(xhmmDir, merged.output, ".depths.data", ".filtered_centered.data")
firstMatrix.minTargetSize = 10
firstMatrix.maxTargetSize = 10000
firstMatrix.minMeanTargetRD = 10
firstMatrix.maxMeanTargetRD = 500
firstMatrix.minMeanSampleRD = 25
firstMatrix.maxMeanSampleRD = 200
firstMatrix.maxSdSampleRD = 150
firstMatrix.outputExcludedSamples = Some(swapExt(xhmmDir, merged.output, ".depths.data", ".filtered.samples.txt"))
firstMatrix.outputExcludedTargets = Some(swapExt(xhmmDir, merged.output, ".depths.data", ".filtered.targets.txt"))
add(firstMatrix)
......
......@@ -69,23 +69,28 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
// merge VCF by sample
for ((sample, bamFile) <- inputBams) {
var sampleVCFS: List[Option[File]] = List.empty
callers.foreach { caller =>
sampleVCFS ::= caller.outputVCF(sample)
if (callers.size > 1) {
var sampleVCFS: List[Option[File]] = List.empty
callers.foreach { caller =>
sampleVCFS ::= caller.outputVCF(sample)
}
val mergeSVcalls = new Pysvtools(this)
mergeSVcalls.input = sampleVCFS.flatten
mergeSVcalls.output = new File(outputDir, sample + ".merged.vcf")
add(mergeSVcalls)
outputMergedVCFbySample += (sample -> mergeSVcalls.output)
} else {
outputMergedVCFbySample += (sample -> callers.head.outputVCF(sample).get)
}
val mergeSVcalls = new Pysvtools(this)
mergeSVcalls.input = sampleVCFS.flatten
mergeSVcalls.output = new File(outputDir, sample + ".merged.vcf")
add(mergeSVcalls)
outputMergedVCFbySample += (sample -> mergeSVcalls.output)
}
// merge all files from all samples in project
val mergeSVcallsProject = new Pysvtools(this)
mergeSVcallsProject.input = outputMergedVCFbySample.values.toList
mergeSVcallsProject.output = outputMergedVCF
add(mergeSVcallsProject)
if (inputBams.size > 1) {
// merge all files from all samples in project
val mergeSVcallsProject = new Pysvtools(this)
mergeSVcallsProject.input = outputMergedVCFbySample.values.toList
mergeSVcallsProject.output = outputMergedVCF
add(mergeSVcallsProject)
}
// merging the VCF calls by project
// basicly this will do all samples from this pipeline run
// group by "tags"
......@@ -104,7 +109,7 @@ class ShivaSvCalling(val root: Configurable) extends QScript with SummaryQScript
def summarySettings = Map("sv_callers" -> configCallers.toList)
/** Files for the summary */
def summaryFiles: Map[String, File] = Map("final_mergedvcf" -> outputMergedVCF)
def summaryFiles: Map[String, File] = Map("final_mergedvcf" -> (if (inputBams.size > 1) outputMergedVCF else outputMergedVCFbySample.values.head))
}
object ShivaSvCalling extends PipelineCommand
\ No newline at end of file
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