Commit 96534e9b authored by Peter van 't Hof's avatar Peter van 't Hof

Added BamToChromSizes

parent bd33eb1b
......@@ -22,6 +22,7 @@
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<processorPath useClasspath="true" />
<module name="Bam2Wig" />
<module name="BamMetrics" />
<module name="BamToBigWig" />
<module name="bamtobigwig" />
......
......@@ -8,8 +8,8 @@
<file url="file://$PROJECT_DIR$/protected/biopet-gatk-pipelines" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/protected/biopet-protected-package" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/public" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/public/bam2wig" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/public/bammetrics" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/public/bamtobigwig" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/public/biopet-framework" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/public/biopet-public-package" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/public/flexiprep" charset="UTF-8" />
......
<component name="libraryTable">
<library name="Maven: nl.lumc.sasc:Bam2Wig:0.3.0-DEV">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/nl/lumc/sasc/Bam2Wig/0.3.0-DEV/Bam2Wig-0.3.0-DEV.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/nl/lumc/sasc/Bam2Wig/0.3.0-DEV/Bam2Wig-0.3.0-DEV-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/nl/lumc/sasc/Bam2Wig/0.3.0-DEV/Bam2Wig-0.3.0-DEV-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
......@@ -2,8 +2,8 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/public/bam2wig/Bam2Wig.iml" filepath="$PROJECT_DIR$/public/bam2wig/Bam2Wig.iml" />
<module fileurl="file://$PROJECT_DIR$/public/bammetrics/BamMetrics.iml" filepath="$PROJECT_DIR$/public/bammetrics/BamMetrics.iml" />
<module fileurl="file://$PROJECT_DIR$/public/bamtobigwig/BamToBigWig.iml" filepath="$PROJECT_DIR$/public/bamtobigwig/BamToBigWig.iml" />
<module fileurl="file://$PROJECT_DIR$/protected/basty/Basty.iml" filepath="$PROJECT_DIR$/protected/basty/Basty.iml" />
<module fileurl="file://$PROJECT_DIR$/public/Biopet.iml" filepath="$PROJECT_DIR$/public/Biopet.iml" />
<module fileurl="file://$PROJECT_DIR$/public/biopet-framework/BiopetFramework.iml" filepath="$PROJECT_DIR$/public/biopet-framework/BiopetFramework.iml" />
......
......@@ -21,6 +21,7 @@
<parameter value="$PROJECT_DIR$/public/mapping/target/.scala_dependencies" />
<parameter value="$PROJECT_DIR$/protected/biopet-gatk-extensions/target/.scala_dependencies" />
<parameter value="$PROJECT_DIR$/public/bamtobigwig/target/.scala_dependencies" />
<parameter value="$PROJECT_DIR$/public/bam2wig/target/.scala_dependencies" />
</parameters>
</component>
</project>
\ No newline at end of file
......@@ -95,7 +95,7 @@
<orderEntry type="module" module-name="Gentrap" />
<orderEntry type="module" module-name="Sage" />
<orderEntry type="module" module-name="Yamsvp" />
<orderEntry type="module" module-name="BamToBigWig" />
<orderEntry type="module" module-name="Bam2Wig" />
<orderEntry type="module" module-name="BiopetGatkPipelines" />
<orderEntry type="module" module-name="BiopetGatkExtensions" />
<orderEntry type="module" module-name="Basty" />
......
......@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>nl.lumc.sasc</groupId>
<artifactId>BamToBigWig</artifactId>
<artifactId>Bam2Wig</artifactId>
<packaging>jar</packaging>
<parent>
......@@ -16,7 +16,7 @@
</parent>
<inceptionYear>2014</inceptionYear>
<name>BamToBigWig</name>
<name>Bam2Wig</name>
<dependencies>
<dependency>
......
......@@ -2,19 +2,40 @@ package nl.lumc.sasc.biopet.pipelines.bamtobigwig
import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.core.{ BiopetQScript, PipelineCommand }
import nl.lumc.sasc.biopet.extensions.WigToBigWig
import org.broadinstitute.gatk.queue.QScript
import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
/**
* Created by pjvan_thof on 1/29/15.
*/
class BamToBigWig(val root: Configurable) extends QScript with BiopetQScript {
class Bam2Wig(val root: Configurable) extends QScript with BiopetQScript {
def this() = this(null)
@Input
var bamFile: File = _
@Output
var bigWigFile: File = _
def init(): Unit = {
}
def biopetScript(): Unit = {
//TODO: bam -> wig
val bs = new BamToChromSizes(this)
bs.bamFile = bamFile
bs.chromSizesFile = bamFile.getAbsoluteFile + ".chromsizes"
bs.isIntermediate = true
add(bs)
val wigToBigWig = new WigToBigWig(this)
//TODO: wigToBigWig.inputWigFile
wigToBigWig.inputChromSizesFile = bs.chromSizesFile
wigToBigWig.outputBigWig = bigWigFile
add(wigToBigWig)
}
}
object BamToBigWig extends PipelineCommand
\ No newline at end of file
object Bam2Wig extends PipelineCommand
\ No newline at end of file
package nl.lumc.sasc.biopet.pipelines.bamtobigwig
import java.io.{ PrintWriter, File }
import htsjdk.samtools.SamReaderFactory
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.queue.function.InProcessFunction
import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
import scala.collection.JavaConversions._
/**
* Created by pjvan_thof on 1/29/15.
*/
class BamToChromSizes(val root: Configurable) extends InProcessFunction with Configurable {
@Input
var bamFile: File = _
@Output
var chromSizesFile: File = _
def run(): Unit = {
val bamReader = SamReaderFactory.makeDefault().open(bamFile)
val writer = new PrintWriter(chromSizesFile)
for (ref <- bamReader.getFileHeader.getSequenceDictionary.getSequences) {
writer.println(ref.getSequenceName + "\t" + ref.getSequenceLength)
}
bamReader.close()
writer.close
}
}
<?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/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<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-1.7.0-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-1.7.0-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
......@@ -94,6 +94,6 @@
<orderEntry type="module" module-name="Gentrap" />
<orderEntry type="module" module-name="Sage" />
<orderEntry type="module" module-name="Yamsvp" />
<orderEntry type="module" module-name="BamToBigWig" />
<orderEntry type="module" module-name="Bam2Wig" />
</component>
</module>
\ No newline at end of file
......@@ -77,7 +77,7 @@
</dependency>
<dependency>
<groupId>nl.lumc.sasc</groupId>
<artifactId>BamToBigWig</artifactId>
<artifactId>Bam2Wig</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
......
......@@ -23,7 +23,7 @@ object BiopetExecutablePublic extends BiopetExecutable {
nl.lumc.sasc.biopet.pipelines.bammetrics.BamMetrics,
nl.lumc.sasc.biopet.pipelines.yamsvp.Yamsvp,
nl.lumc.sasc.biopet.pipelines.sage.Sage,
nl.lumc.sasc.biopet.pipelines.bamtobigwig.BamToBigWig
nl.lumc.sasc.biopet.pipelines.bamtobigwig.Bam2Wig
)
def tools: List[MainCommand] = List(
......
......@@ -33,7 +33,7 @@
<module>mapping</module>
<module>sage</module>
<module>yamsvp</module>
<module>bamtobigwig</module>
<module>bam2wig</module>
</modules>
<properties>
......
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