Mercurial > repos > jetbrains > zinbra
changeset 7:617b5857ce96
Snapshot 61f45be of dev repo
author | oleg@oleg-desktop.times.labs.intellij.net |
---|---|
date | Thu, 29 Oct 2015 11:57:02 +0300 |
parents | 7d532e820976 |
children | af8fe077c27b |
files | integration_jar.xml tool_dependencies.xml zinbra.py zinbra.xml zinbra_wrapper.py |
diffstat | 5 files changed, 65 insertions(+), 65 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/integration_jar.xml Thu Oct 29 11:57:02 2015 +0300 @@ -0,0 +1,23 @@ +<!-- +Package for downloading latest successful development tools. +Tags information is here: +https://wiki.galaxyproject.org/ToolDependenciesTagSets +--> +<package name="integration_jar" version="0.0.1" prior_installation_required="True"> + <install version="1.0"> + <actions> + <action type="download_by_url">http://teamcity.jetbrains.com/guestAuth/repository/download/Epigenome_Tools_Integration/lastSuccessful/integration-Dev-all.jar</action> + <action type="move_directory_files"> + <source_directory>.</source_directory> + <destination_directory>$INSTALL_DIR/</destination_directory> + </action> + <!-- Set environment variable $INTEGRATION_JAR so Python script knows where to look --> + <action type="set_environment"> + <environment_variable name="$INTEGRATION_JAR" action="set_to">$INSTALL_DIR/integration-Dev-all.jar</environment_variable> + </action> + </actions> + </install> + <readme> + Downloads epigenome integration JAR. + </readme> +</package>
--- a/tool_dependencies.xml Wed Oct 28 20:08:20 2015 +0300 +++ b/tool_dependencies.xml Thu Oct 29 11:57:02 2015 +0300 @@ -1,26 +1,6 @@ <?xml version="1.0"?> -<!-- -Tags information is here: -https://wiki.galaxyproject.org/ToolDependenciesTagSets ---> -<tool_dependency> - <package name="epigenome" version="0.0.1" prior_installation_required="True"> - <install version="1.0"> - <actions> - <action type="download_by_url">http://teamcity.jetbrains.com/guestAuth/repository/download/Epigenome_Tools_Integration/lastSuccessful/integration-Dev-all.jar</action> - <action type="move_directory_files"> - <source_directory>.</source_directory> - <destination_directory>$INSTALL_DIR/</destination_directory> - </action> - <!-- Set environment variable $INTEGRATION_JAR so Python script knows where to look --> - <action type="set_environment"> - <environment_variable name="$INTEGRATION_JAR" action="set_to">$INSTALL_DIR/integration-Dev-all.jar</environment_variable> - </action> - </actions> - </install> - <readme> - Downloads epigenome integration JAR. - </readme> - </package> +<tool_dependency xmlns:xi="http://www.w3.org/1999/XSL/Transform"> + <xi:include href="../integration_jar.xml" parse="xml" xpointer=""/> + <!-- For galaxy repo layout --> + <xi:include href="integration_jar.xml" parse="xml" xpointer=""/> </tool_dependency> -
--- a/zinbra.py Wed Oct 28 20:08:20 2015 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -#!/usr/bin/env python -""" -Python wrapper for zinbra.xml -""" - -import os -import sys -import subprocess - -argv = sys.argv[1:] -print 'Arguments {0}'.format(argv) - -# Check command -if len(argv) == 5: - genome, bin, fdr, action, bed = argv - assert action == "analyze" -else: - genome, bin, fdr, action, bed1, bed2 = argv - assert action == "compare" - -# Configure main jar path -jar = os.environ.get("INTEGRATION_JAR") -print 'Using JAR distributive file {0}'.format(jar) - -cmd = 'java -cp {0} org.jetbrains.bio.genestack.FastaToTwoBitCLA {1} reference.2bit'.format(jar, genome) -print 'Converting reference genome fasta to 2bit: {0}'.format(cmd) -subprocess.check_call(cmd, cwd=None, shell=True) - -# See https://github.com/JetBrains-Research/zinbra for command line options -if action == "analyze": - cmd = 'java -cp {0} org.jetbrains.bio.zinbra.ZinbraCLA ' \ - 'analyze -i {1} -bed result.bed -r reference.2bit -b {3} -fdr {4}'.format(jar, bed, bin, fdr) -else: - cmd = 'java -cp {0} org.jetbrains.bio.zinbra.ZinbraCLA ' \ - 'compare -1 {1} -2 {2} -bed result.bed -r reference.2bit -b {3} -fdr {4}'.format(jar, bed1, bed2, bin, fdr) -print 'Launching zinbra: {0}'.format(cmd) -subprocess.check_call(cmd, cwd=None, shell=True)
--- a/zinbra.xml Wed Oct 28 20:08:20 2015 +0300 +++ b/zinbra.xml Thu Oct 29 11:57:02 2015 +0300 @@ -1,7 +1,7 @@ <tool id="zinbra" name="Zinbra" version="0.0.1"> - <description>ChIP-Seq enrichment</description> + <description>ChIP-Seq analysis</description> <requirements> - <requirement type="package" version="0.0.1">epigenome</requirement> + <requirement type="package" version="0.0.1">integration_jar</requirement> </requirements> <stdio> <!-- Wrapper ensures anything other than zero is an error --> @@ -10,9 +10,9 @@ </stdio> <command interpreter="python"> #if $action.selection == "analyze" - zinbra.py "${genome}" "${bin}" "${fdr}" analyze "${bed}" + zinbra_wrapper.py "${genome}" "${bin}" "${fdr}" analyze "${bed}" #else - zinbra.py "${genome}" "${bin}" "${fdr}" compare "${bed1}" "${bed2}" + zinbra_wrapper.py "${genome}" "${bin}" "${fdr}" compare "${bed1}" "${bed2}" #end if </command> <inputs>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zinbra_wrapper.py Thu Oct 29 11:57:02 2015 +0300 @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +import os +import sys +import subprocess + +argv = sys.argv[1:] +print 'Arguments {0}'.format(argv) + +# Check command +if len(argv) == 5: + genome, bin, fdr, action, bed = argv + assert action == "analyze" +else: + genome, bin, fdr, action, bed1, bed2 = argv + assert action == "compare" + +# Configure main jar path +jar = os.environ.get("INTEGRATION_JAR") +print 'Using JAR distributive file {0}'.format(jar) + +cmd = 'java -cp {0} org.jetbrains.bio.genestack.FastaToTwoBitCLA {1} reference.2bit'.format(jar, genome) +print 'Converting reference genome fasta to 2bit: {0}'.format(cmd) +subprocess.check_call(cmd, cwd=None, shell=True) + +# See https://github.com/JetBrains-Research/zinbra for command line options +if action == "analyze": + cmd = 'java -cp {0} org.jetbrains.bio.zinbra.ZinbraCLA ' \ + 'analyze -i {1} -bed result.bed -r reference.2bit -b {3} -fdr {4}'.format(jar, bed, bin, fdr) +else: + cmd = 'java -cp {0} org.jetbrains.bio.zinbra.ZinbraCLA ' \ + 'compare -1 {1} -2 {2} -bed result.bed -r reference.2bit -b {3} -fdr {4}'.format(jar, bed1, bed2, bin, fdr) +print 'Launching zinbra: {0}'.format(cmd) +subprocess.check_call(cmd, cwd=None, shell=True)