Commit 4557807c authored by Peter van 't Hof's avatar Peter van 't Hof

Merge commit 'cfae9015'

Conflicts:
	flexiprep/nbactions.xml
	gatk/gatk-pipeline/src/main/scala/nl/lumc/sasc/biopet/pipelines/gatk/GatkPipeline.scala
	gatk/gatk-variantcalling/src/main/scala/nl/lumc/sasc/biopet/pipelines/gatk/GatkVariantcalling.scala
	mapping/examples/test.json
	mapping/nbactions.xml
	pom.xml
parent 4f6ea975
/target/
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics -BAM test.bam -outDir /home/pjvan_thof/pipelines/test -config /home/pjvan_thof/pipelines/biopet/bam-metrics/examples/test.json</exec.args>
<exec.executable>java</exec.executable>
<exec.workingdir>/home/pjvan_thof/pipelines/test</exec.workingdir>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics -BAM test.bam -outDir /home/pjvan_thof/pipelines/test -config /home/pjvan_thof/pipelines/biopet/bam-metrics/examples/test.json</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
<exec.workingdir>/home/pjvan_thof/pipelines/test</exec.workingdir>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics -BAM test.bam -outDir /home/pjvan_thof/pipelines/test -config /home/pjvan_thof/pipelines/biopet/bam-metrics/examples/test.json</exec.args>
<exec.executable>java</exec.executable>
<exec.workingdir>/home/pjvan_thof/pipelines/test</exec.workingdir>
</properties>
</action>
</actions>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>nl.lumc.sasc</groupId>
<artifactId>Bam-Metrics</artifactId>
<version>0.1.3</version>
<packaging>jar</packaging>
<name>Bam-Metrics</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>nl.lumc.sasc</groupId>
<artifactId>Biopet</artifactId>
<version>0.1.3</version>
<relativePath>../</relativePath>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sting.unpack.phase>prepare-package</sting.unpack.phase>
<sting.shade.phase>package</sting.shade.phase>
<app.main.class>nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics</app.main.class>
</properties>
<dependencies>
<!-- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>-->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>2.11.0</version>
</dependency>
<!-- <dependency>
<groupId>org.utgenome.thirdparty</groupId>
<artifactId>picard</artifactId>
<version>1.86.0</version>
</dependency>-->
<!-- <dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.9.2</artifactId>
<version>2.0.M4</version>
<scope>test</scope>
</dependency>-->
<dependency>
<groupId>nl.lumc.sasc</groupId>
<artifactId>Biopet-Framework</artifactId>
<version>0.1.3</version>
</dependency>
<dependency>
<groupId>org.broadinstitute.gatk</groupId>
<artifactId>gatk-queue-package-distribution</artifactId>
<version>3.2</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/scripts</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.2</version>
<executions>
<execution>
<id>scala-compile</id>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
<configuration>
<args>
<arg>-dependencyfile</arg>
<arg>${project.build.directory}/.scala_dependencies</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.2</version>
<executions>
<execution>
<id>default-test</id>
Disable the default-test by putting it in phase none
<phase>none</phase>
</execution>
</executions>
</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<finalName>${project.artifactId}-${project.version}</finalName>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>${app.main.class}</Main-Class>
<X-Compile-Source-JDK>${maven.compile.source}</X-Compile-Source-JDK>
<X-Compile-Target-JDK>${maven.compile.target}</X-Compile-Target-JDK>
</manifestEntries>
</transformer>
</transformers>
<artifactSet>
<excludes>
<exclude>org.broadinstitute.gatk:gatk-queue-package-distribution</exclude>
<exclude>junit:junit</exclude>
<exclude>org.scala-lang:scala-compiler</exclude>
<exclude>org.scala-lang:scala-library</exclude>
<exclude>org.scala-lang:scala-reflect</exclude>
<exclude>org.scala-lang.modules:*</exclude>
</excludes>
</artifactSet>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
{
"samtools": {"exe": "test"},
"star": {"exe": "test"},
"reference": "/blabla/blabla.fa",
"fastqc": { "exe": "/home/pjvan_thof/Downloads/FastQC/fastqc" },
"bwa": { "exe": "test" },
......
......@@ -3,26 +3,19 @@
<modelVersion>4.0.0</modelVersion>
<groupId>nl.lumc.sasc</groupId>
<artifactId>Biopet-Framework</artifactId>
<artifactId>Biopet</artifactId>
<version>0.1.3</version>
<packaging>jar</packaging>
<name>Biopet-Framework</name>
<name>Biopet</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>nl.lumc.sasc</groupId>
<artifactId>Biopet</artifactId>
<version>0.1.3</version>
<relativePath>../</relativePath>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sting.unpack.phase>prepare-package</sting.unpack.phase>
<sting.shade.phase>package</sting.shade.phase>
<sting.binary-dist.name>SASC-Pipelines</sting.binary-dist.name>
<app.main.class>org.broadinstitute.gatk.queue.QCommandLine</app.main.class>
<app.main.class>nl.lumc.sasc.biopet.core.BiopetExecutable</app.main.class>
</properties>
<dependencies>
......@@ -32,23 +25,11 @@
<version>6.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>2.11.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.11.0</version>
<version>2.11.2</version>
</dependency>
<!-- <dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.9.2</artifactId>
<version>2.0.M4</version>
<scope>test</scope>
</dependency>-->
<dependency>
<groupId>org.broadinstitute.gatk</groupId>
<artifactId>gatk-queue-package-distribution</artifactId>
......@@ -57,10 +38,18 @@
<dependency>
<groupId>io.argonaut</groupId>
<artifactId>argonaut_2.11</artifactId>
<version>6.1-M3</version>
<version>6.1-M4</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/scripts</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
......@@ -83,68 +72,47 @@
</execution>
</executions>
</plugin>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.2</version>
<executions>
<execution>
<id>default-test</id>
Disable the default-test by putting it in phase none
<phase>none</phase>
</execution>
</executions>
</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>${app.main.class}</Main-Class>
<X-Compile-Source-JDK>${maven.compile.source}</X-Compile-Source-JDK>
<X-Compile-Target-JDK>${maven.compile.target}</X-Compile-Target-JDK>
</manifestEntries>
</transformer>
</transformers>
<artifactSet>
<excludes>
<exclude>junit:junit</exclude>
<!-- <exclude>org.scala-lang:scala-compiler</exclude>-->
<!-- <exclude>org.scala-lang:scala-library</exclude>-->
<exclude>org.scala-lang:scala-reflect</exclude>
<exclude>org.scala-lang.modules:*</exclude>
</excludes>
</artifactSet>
<filters>
<filter>
<artifact>org.scala-lang:scala-compiler</artifact>
<includes>
<include>scala/tools/nsc/reporters/**</include>
</includes>
</filter>
<filter>
<artifact>org.broadinstitute.gatk:gatk-queue-package-distribution</artifact>
<excludes>
<!-- <exclude>scala/**</exclude>-->
</excludes>
<includes>
<include>*/**</include>
</includes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<finalName>${project.artifactId}</finalName>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>${app.main.class}</Main-Class>
<X-Compile-Source-JDK>${maven.compile.source}</X-Compile-Source-JDK>
<X-Compile-Target-JDK>${maven.compile.target}</X-Compile-Target-JDK>
</manifestEntries>
</transformer>
</transformers>
<filters>
<filter>
<artifact>org.broadinstitute.gatk:gatk-queue-package-distribution</artifact>
<includes>
<include>picard/**</include>
<include>htsjdk/**</include>
<include>javassist/**</include>
<include>com/google/**</include>
<include>org/reflections/</include>
<include>org/jgrapht/**</include>
<include>org/broadinstitute/**</include>
<include>org/apache/**</include>
<include>scala/tools/nsc/reporters/**</include>
</includes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
package nl.lumc.sasc.biopet.core
import nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics
import nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep
import nl.lumc.sasc.biopet.pipelines.gatk.GatkBenchmarkGenotyping
import nl.lumc.sasc.biopet.pipelines.gatk.GatkGenotyping
import nl.lumc.sasc.biopet.pipelines.gatk.GatkPipeline
import nl.lumc.sasc.biopet.pipelines.gatk.GatkVariantcalling
import nl.lumc.sasc.biopet.pipelines.gatk.GatkVcfSampleCompare
import nl.lumc.sasc.biopet.pipelines.gentrap.Gentrap
import nl.lumc.sasc.biopet.pipelines.mapping.Mapping
object BiopetExecutable {
val pipelines: Map[String,PipelineCommand] = Map(
"flexiprep" -> Flexiprep,
"mapping" -> Mapping,
"gentrap" -> Gentrap,
"bam-metrics" -> BamMetrics,
"gatk-benchmark-genotyping" -> GatkBenchmarkGenotyping,
"gatk-genotyping" -> GatkGenotyping,
"gatk-variantcalling" -> GatkVariantcalling,
"gatk-pipeline" -> GatkPipeline,
"gatk-vcf-sample-compare" -> GatkVcfSampleCompare
)
/**
* @param args the command line arguments
*/
def main(args: Array[String]): Unit = {
if (args.isEmpty) {
System.err.println(pipelineList)
System.exit(1)
}
else if (pipelines.contains(args.head)) pipelines(args.head).main(args.tail)
else {
System.err.println("Pipeline '" + args.head + "' does not exist")
System.err.println(pipelineList)
System.exit(1)
}
def pipelineList: String = {
val pipelinesArray = for ((k,v) <- pipelines) yield k
"Available pipelines:" + pipelinesArray.mkString("\n- ", "\n- ", "\n") + "please supply a valid pipeline"
}
}
}
......@@ -82,12 +82,10 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
val gatkVariantcalling = new GatkVariantcalling(this)
gatkVariantcalling.inputBams = libraryBamfiles
gatkVariantcalling.outputDir = outputDir + sampleID + "/variantcalling/"
gatkVariantcalling.outputName = sampleID
gatkVariantcalling.singleGenotyping = true
gatkVariantcalling.init
gatkVariantcalling.biopetScript
addAll(gatkVariantcalling.functions)
gvcfFiles :+= gatkVariantcalling.outputFileHc
gvcfFiles :+= gatkVariantcalling.outputFile
} else logger.warn("No bamfiles for variant calling for sample: " + sampleID)
return outputFiles
}
......
......@@ -4,7 +4,7 @@ import nl.lumc.sasc.biopet.core.{ BiopetQScript, PipelineCommand }
import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.extensions._
import org.broadinstitute.gatk.queue.QScript
import org.broadinstitute.gatk.queue.extensions.gatk.{ BaseRecalibrator, CommandLineGATK, HaplotypeCaller, IndelRealigner, PrintReads, RealignerTargetCreator, GenotypeGVCFs, AnalyzeCovariates , UnifiedGenotyper}
import org.broadinstitute.gatk.queue.extensions.gatk.{ BaseRecalibrator, CommandLineGATK, HaplotypeCaller, IndelRealigner, PrintReads, RealignerTargetCreator, GenotypeGVCFs, AnalyzeCovariates }
import org.broadinstitute.gatk.queue.function._
import org.broadinstitute.gatk.utils.commandline.{ Input, Output, Argument }
import org.broadinstitute.gatk.utils.variant.GATKVCFIndexType
......@@ -22,25 +22,22 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
var dbsnp: File = _
@Argument(doc = "OutputName", required = false)
var outputName: String = ""
var outputName: String = _
@Output(doc = "OutputFileHc", shortName = "outputFileHc", fullName = "outputFileHc", required = false)
var outputFileHc: File = _
@Output(doc = "OutputFile", required = false)
var outputFile: File = _
@Output(doc = "OutputFileUg", shortName = "outputFileUg", fullName = "outputFileUg", required = false)
var outputFileUg: File = _
var gvcfMode = true
var singleGenotyping = false
def init() {
if (gvcfMode) gvcfMode = config("gvcfmode", default = true)
if (configContains("singlegenotyping")) singleGenotyping = config("singlegenotyping")
if (!singleGenotyping) singleGenotyping = config("singlegenotyping")
if (reference == null) reference = config("reference", required = true)
if (dbsnp == null) dbsnp = config("dbsnp")
if (!outputName.isEmpty && !outputName.endsWith(".")) outputName += "."
if (outputFileHc == null) outputFileHc = outputDir + outputName + (if (gvcfMode) "hc.gvcf.vcf" else ".vcf")
if (outputFileUg == null) outputFileUg = outputDir + outputName + "ug.vcf"
if (outputFile == null) outputFile = outputDir +
(if (outputName != null && !outputName.endsWith(".")) outputName + "." else outputName) +
(if (gvcfMode) "hc.gvcf.vcf" else ".vcf")
if (outputDir == null) throw new IllegalStateException("Missing Output directory on gatk module")
else if (!outputDir.endsWith("/")) outputDir += "/"
}
......@@ -51,9 +48,8 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
var bamFile = if (dbsnp != null) addIndelRealign(inputBam, outputDir) else inputBam
bamFiles :+= addBaseRecalibrator(bamFile, outputDir)
}
addHaplotypeCaller(bamFiles, outputFileHc)
addUnifiedGenotyper(bamFiles, outputFileUg)
if (gvcfMode && singleGenotyping) addGenotypeGVCFs(List(outputFileHc), outputDir)
addHaplotypeCaller(bamFiles, outputFile)
if (gvcfMode && singleGenotyping) addGenotypeGVCFs(List(outputFile), outputDir)
}
trait gatkArguments extends CommandLineGATK {
......@@ -164,32 +160,6 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
return haplotypeCaller.out
}
def addUnifiedGenotyper(bamfiles: List[File], outputfile: File): File = {
val unifiedGenotyper = new UnifiedGenotyper with gatkArguments {
this.min_quality_score = config("minMappingQualityScore", 20, "UnifiedGenotyper").getInt.toByte
if (configContains("scattercount", "UnifiedGenotyper")) this.scatterCount = config("scattercount", 1, "UnifiedGenotyper")
this.input_file = bamfiles
this.out = outputfile
if (configContains("dbsnp")) this.dbsnp = config("dbsnp")
this.nct = config("threads", default = 3, submodule = "UnifiedGenotyper")
this.memoryLimit = this.nct * 2
if (configContains("allSitePLs")) this.allSitePLs = config("allSitePLs")
val inputType: String = config("inputtype", "dna")
if (inputType == "rna") {
this.stand_call_conf = config("stand_call_conf", 20, "UnifiedGenotyper")
this.stand_emit_conf = config("stand_emit_conf", 20, "UnifiedGenotyper")
} else {
this.stand_call_conf = config("stand_call_conf", 30, "UnifiedGenotyper")
this.stand_emit_conf = config("stand_emit_conf", 30, "UnifiedGenotyper")
}
}
add(unifiedGenotyper)
return unifiedGenotyper.out
}
def addGenotypeGVCFs(gvcfFiles: List[File], dir: String): File = {
val genotypeGVCFs = new GenotypeGVCFs() with gatkArguments {
......
/target/
\ No newline at end of file
# Flexiprep
For documentation see: https://git.lumc.nl/biopet/biopet/wikis/Flexiprep
## License
A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL license; For commercial users or users who do not want to follow the AGPL license, please contact sasc@lumc.nl to purchase a separate license.
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep -R1 /media/LocalData/test/1k_R1_001.tmp.fq.gz -outDir /home/pjvan_thof/pipelines/test -config /home/pjvan_thof/pipelines/biopet/flexiprep/examples/test.json -l DEBUG -sample test -library test -run</exec.args>
<exec.executable>java</exec.executable>
<exec.workingdir>/home/pjvan_thof/pipelines/test</exec.workingdir>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep -R1 /media/LocalData/test/1k_R1_001.tmp.fq.gz -outDir /home/pjvan_thof/pipelines/test -config /home/pjvan_thof/pipelines/biopet/flexiprep/examples/test.json -l DEBUG -sample test -library test -run</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
<exec.workingdir>/home/pjvan_thof/pipelines/test</exec.workingdir>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep -R1 /media/LocalData/test/1k_R1_001.tmp.fq.gz -outDir /home/pjvan_thof/pipelines/test -config /home/pjvan_thof/pipelines/biopet/flexiprep/examples/test.json -l DEBUG -sample test -library test -run</exec.args>
<exec.executable>java</exec.executable>
<exec.workingdir>/home/pjvan_thof/pipelines/test</exec.workingdir>
</properties>
</action>
</actions>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>nl.lumc.sasc</groupId>
<artifactId>Flexiprep</artifactId>
<version>0.1.3</version>
<packaging>jar</packaging>
<name>Flexiprep</name>
<url>http://maven.apache.org</url>