Commit 136e28ce authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

First wrappers for kopisu #106

parent 1dc0cde8
/**
* Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines.
*
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
*
* Contact us at: sasc@lumc.nl
*
* A dual licensing mode is applied. The source code within this project that are
* not part of GATK Queue 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 us to obtain a separate license.
*/
package nl.lumc.sasc.biopet.extensions.conifer
import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
abstract class Conifer extends BiopetCommandLineFunction {
override def subPath = "conifer" :: super.subPath
executable = config("exe", default = "conifer")
override val versionRegex = """(.*)""".r
override val versionExitcode = List(0)
override def versionCommand = executable + " --version"
}
/**
* Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines.
*
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
*
* Contact us at: sasc@lumc.nl
*
* A dual licensing mode is applied. The source code within this project that are
* not part of GATK Queue 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 us to obtain a separate license.
*/
package nl.lumc.sasc.biopet.extensions.conifer
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Argument, Input, Output}
class ConiferAnalyze(val root: Configurable) extends Conifer {
@Input(doc = "Probes / capture kit definition as bed file: chr,start,stop,gene-annot", required = true)
var probes: File = _
@Input(doc = "Path to Conifer RPKM files", required = true)
var rpkm_dir: File = _
@Output(doc = "Output RPKM.txt", shortName = "out")
var output: File = _
@Argument(doc = "SVD, number of components to remove", minRecommendedValue = 2, maxRecommendedValue = 5,
minValue = 2, maxValue = 20)
var svd: Option[Int] = config("svd")
@Argument(doc="Minimum population median RPKM per probe")
var min_rpkm: Option[Double] = config("min_rpkm")
override def afterGraph {
this.checkExecutable
}
def cmdLine = required(executable) +
required("rpkm")+
" --probes" + required(probes) +
" --rpkm_dir" + required(rpkm_dir) +
" --output" + required(output) +
optional("--svd",svd) +
optional("--min_rpkm", min_rpkm)
}
/**
* Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines.
*
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
*
* Contact us at: sasc@lumc.nl
*
* A dual licensing mode is applied. The source code within this project that are
* not part of GATK Queue 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 us to obtain a separate license.
*/
package nl.lumc.sasc.biopet.extensions.conifer
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Argument, Input, Output}
class ConiferCall(val root: Configurable) extends Conifer {
@Input(doc = "Input analysis.hdf5", required = true)
var input: File = _
@Output(doc = "Output calls.txt", shortName = "out")
var output: File = _
override def afterGraph {
this.checkExecutable
}
def cmdLine = required(executable) +
required("call")+
" --input" + required(input) +
" --output" + required(output)
}
/**
* Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines.
*
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
*
* Contact us at: sasc@lumc.nl
*
* A dual licensing mode is applied. The source code within this project that are
* not part of GATK Queue 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 us to obtain a separate license.
*/
package nl.lumc.sasc.biopet.extensions.conifer
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Output, Input}
class ConiferRPKM(val root: Configurable) extends Conifer {
@Input(doc = "Bam file", required = true)
var bamFile: File = _
@Input(doc = "Probes / capture kit definition as bed file: chr,start,stop,gene-annot", required = true)
var probes: File = _
@Output(doc = "Output RPKM.txt", shortName = "out")
var output: File = _
private var config_file: File = _
override def afterGraph {
this.checkExecutable
}
def cmdLine = required(executable) +
required("rpkm")+
" --probes" + required(probes) +
" --input" + required(bamFile) +
" --output" + required(output)
}
/target/
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/scala" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="BiopetFramework" />
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.11.2" level="project" />
<orderEntry type="library" name="Maven: org.broadinstitute.gatk:gatk-queue:3.3" level="project" />
<orderEntry type="library" name="Maven: org.broadinstitute.gatk:gatk-tools-public:3.3" level="project" />
<orderEntry type="library" name="Maven: org.broadinstitute.gatk:gatk-engine:3.3" level="project" />
<orderEntry type="library" name="Maven: org.scala-lang:scala-compiler:2.10.2" level="project" />
<orderEntry type="library" name="Maven: org.scala-lang:scala-reflect:2.10.2" level="project" />
<orderEntry type="library" name="Maven: log4j:log4j:1.2.15" level="project" />
<orderEntry type="library" name="Maven: net.sf.jgrapht:jgrapht:0.8.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-email:1.2" level="project" />
<orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
<orderEntry type="library" name="Maven: javax.mail:mail:1.4.4" level="project" />
<orderEntry type="module-library">
<library name="Maven: com.sun:tools:1.4.2">
<CLASSES>
<root url="jar:///usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Maven: org.broadinstitute.gatk:gatk-queue-extensions-distribution:3.3" level="project" />
<orderEntry type="library" name="Maven: org.broadinstitute.gatk:gatk-tools-protected:3.3" level="project" />
<orderEntry type="library" name="Maven: gov.nist.math:jama:1.0.2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.broadinstitute.gatk:gatk-queue-extensions-generator:3.3" level="project" />
<orderEntry type="library" name="Maven: org.broadinstitute.gatk:gatk-utils:3.3" level="project" />
<orderEntry type="library" name="Maven: samtools:htsjdk:1.120.1620" level="project" />
<orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.0.3-rc3" level="project" />
<orderEntry type="library" name="Maven: picard:picard:1.120.1579" level="project" />
<orderEntry type="library" name="Maven: org.apache.ant:ant:1.8.2" level="project" />
<orderEntry type="module-library">
<library name="Maven: com.sun:tools.jar:1.5">
<CLASSES>
<root url="jar:///usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Maven: colt:colt:1.2.0" level="project" />
<orderEntry type="library" name="Maven: concurrent:concurrent:1.3.4" level="project" />
<orderEntry type="library" name="Maven: it.unimi.dsi:fastutil:6.5.3" level="project" />
<orderEntry type="library" name="Maven: org.simpleframework:simple-xml:2.0.4" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: stax:stax:1.2.0" level="project" />
<orderEntry type="library" name="Maven: org.reflections:reflections:0.9.9-RC1" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.16.1-GA" level="project" />
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.1" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.6.1" level="project" />
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.18" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-jexl:2.1.1" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.5" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.1" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-math:2.2" level="project" />
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:3.2.7" level="project" />
<orderEntry type="library" name="Maven: net.java.dev.jets3t:jets3t:0.8.1" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.3" level="project" />
<orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
<orderEntry type="library" name="Maven: com.jamesmurty.utils:java-xmlbuilder:0.4" level="project" />
<orderEntry type="library" name="Maven: us.levk:drmaa-gridengine:6.2u5" level="project" />
<orderEntry type="library" name="Maven: us.levk:drmaa-common:1.0" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.2.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.1.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.1" level="project" />
<orderEntry type="library" name="Maven: com.google.code.cofoja:cofoja:1.0-r139" level="project" />
<orderEntry type="library" name="Maven: io.argonaut:argonaut_2.11:6.1-M4" level="project" />
<orderEntry type="library" name="Maven: org.scalaz:scalaz-core_2.11:7.1.0" level="project" />
<orderEntry type="library" name="Maven: org.scala-lang.modules:scala-parser-combinators_2.11:1.0.2" level="project" />
<orderEntry type="library" name="Maven: org.scala-lang.modules:scala-xml_2.11:1.0.2" level="project" />
<orderEntry type="library" name="Maven: com.github.julien-truffaut:monocle-core_2.11:0.5.0" level="project" />
<orderEntry type="library" name="Maven: org.biojava:biojava3-core:3.1.0" level="project" />
<orderEntry type="library" name="Maven: org.biojava:biojava3-sequencing:3.1.0" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
<orderEntry type="library" name="Maven: com.github.scopt:scopt_2.10:3.2.0" level="project" />
</component>
</module>
\ No newline at end of file
<!--
Biopet is built on top of GATK Queue for building bioinformatic
pipelines. It is mainly intended to support LUMC SHARK cluster which is running
SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
should also be able to execute Biopet tools and pipelines.
Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
Contact us at: sasc@lumc.nl
A dual licensing mode is applied. The source code within this project that are
not part of GATK Queue 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 us to obtain a separate license.
-->
<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>Kopisu</artifactId>
<packaging>jar</packaging>
<parent>
<groupId>nl.lumc.sasc</groupId>
<artifactId>Biopet</artifactId>
<version>0.3.0-DEV</version>
<relativePath>../</relativePath>
</parent>
<inceptionYear>2014</inceptionYear>
<name>Kopisu</name>
<dependencies>
<dependency>
<groupId>nl.lumc.sasc</groupId>
<artifactId>BiopetFramework</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
/**
* Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines.
*
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
*
* Contact us at: sasc@lumc.nl
*
* A dual licensing mode is applied. The source code within this project that are
* not part of GATK Queue 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 us to obtain a separate license.
*/
package nl.lumc.sasc.biopet.pipelines.sage
import nl.lumc.sasc.biopet.core.{ MultiSampleQScript, PipelineCommand }
import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.extensions.Cat
import nl.lumc.sasc.biopet.extensions.bedtools.BedtoolsCoverage
import nl.lumc.sasc.biopet.extensions.picard.MergeSamFiles
import nl.lumc.sasc.biopet.pipelines.flexiprep.Flexiprep
import nl.lumc.sasc.biopet.pipelines.mapping.Mapping
import nl.lumc.sasc.biopet.tools.PrefixFastq
import nl.lumc.sasc.biopet.tools.BedtoolsCoverageToCounts
import nl.lumc.sasc.biopet.scripts.SquishBed
import nl.lumc.sasc.biopet.tools.SageCountFastq
import nl.lumc.sasc.biopet.tools.SageCreateLibrary
import nl.lumc.sasc.biopet.tools.SageCreateTagCounts
import org.broadinstitute.gatk.queue.QScript
class Kopisu(val root: Configurable) extends QScript with MultiSampleQScript {
def this() = this(null)
@Input(doc = "Input bamfile", required = true)
var bamFile: File = config("bam")
class LibraryOutput extends AbstractLibraryOutput {
}
class SampleOutput extends AbstractSampleOutput {
}
def init() {
if (!outputDir.endsWith("/")) outputDir += "/"
}
def biopetScript() {
runSamplesJobs
}
// Called for each sample
def runSingleSampleJobs(sampleConfig: Map[String, Any]): SampleOutput = {
val sampleOutput = new SampleOutput
var libraryBamfiles: List[File] = List()
var libraryFastqFiles: List[File] = List()
val sampleID: String = sampleConfig("ID").toString
val sampleDir: String = globalSampleDir + sampleID + "/"
for ((library, libraryFiles) <- runLibraryJobs(sampleConfig)) {
}
return sampleOutput
}
// Called for each run from a sample
def runSingleLibraryJobs(runConfig: Map[String, Any], sampleConfig: Map[String, Any]): LibraryOutput = {
val libraryOutput = new LibraryOutput
val runID: String = runConfig("ID").toString
val sampleID: String = sampleConfig("ID").toString
val runDir: String = globalSampleDir + sampleID + "/run_" + runID + "/"
if (runConfig.contains("bam")) {
} else this.logger.error("Sample: " + sampleID + ": No R1 found for run: " + runConfig)
return libraryOutput
}
}
object Kopisu extends PipelineCommand
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