# HG changeset patch # User jetbrains # Date 1542297889 18000 # Node ID 1f0c4f0a9c3b1e7c604f8a29a67f981449ea372a Initial version of SPAN for ToolShed diff -r 000000000000 -r 1f0c4f0a9c3b README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Thu Nov 15 11:04:49 2018 -0500 @@ -0,0 +1,3 @@ +Release version +=============== +Release is just a `span` snapshot from [https://github.com/JetBrains-Research/galaxy-applications](https://github.com/JetBrains-Research/galaxy-applications) \ No newline at end of file diff -r 000000000000 -r 1f0c4f0a9c3b span.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/span.xml Thu Nov 15 11:04:49 2018 -0500 @@ -0,0 +1,69 @@ + + ChIP-Seq analysis + + package_span_jar + + + + + + + + +#if str($action.action_selector) == "model" + #if $control.control_selector + span_wrapper.py model with_control "${genome}" "${treatment_file}" "${bin}" "${action.model_file}" "${control.control_file}" + #else + span_wrapper.py model without_control "${genome}" "${treatment_file}" "${bin}" "${action.model_file}" + #end if +#else + #if $control.control_selector + span_wrapper.py peaks with_control "${genome}" "${treatment_file}" "${bin}" "${action.model_file}" "${control.control_file}" "${fdr}" "${gap}" "${action.peaks_file}" + #else + span_wrapper.py peaks without_control "${genome}" "${treatment_file}" "${bin}" "${action.model_file}" "${fdr}" "${gap}" "${action.peaks_file}" + #end if +#end if + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + action['action_selector'] == "peaks" + + + + SPAN Semi-supervised Peak Analyzer is a tool for analyzing ChIP-seq data. + Details: http://artyomovlab.wustl.edu/aging/span.html + + diff -r 000000000000 -r 1f0c4f0a9c3b span_wrapper.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/span_wrapper.py Thu Nov 15 11:04:49 2018 -0500 @@ -0,0 +1,67 @@ +#!/usr/bin/env python + +import os +import sys +import subprocess +argv = sys.argv[1:] +print 'Arguments {0}'.format(argv) + +SPAN_JAR = os.environ.get("SPAN_JAR") +# span.jar from Docker container +# SPAN_JAR = "/root/span.jar" +print 'Using SPAN Peak Analyzer distributive file {0}'.format(SPAN_JAR) + +# #if $action.action_selector +# #if str($control.control_selector) == "with_control" +# span_wrapper.py model with_control "${genome}" "${treatment_file}" "${bin}" "${action.model_file}" "${control.control_file}" +# #else +# span_wrapper.py model without_control "${genome}" "${treatment_file}" "${bin}" "${action.model_file}" +# #end if +# #else +# #if $control.control_selector +# span_wrapper.py peaks with_control "${genome}" "${treatment_file}" "${bin}" "${action.model_file}" "${control.control_file}" "${fdr}" "${gap}" "${action.peaks_file}" +# #else +# span_wrapper.py peaks without_control "${genome}" "${treatment_file}" "${bin}" "${action.model_file}" "${fdr}" "${gap}" "${action.peaks_file}" +# #end if +# #end if + +# See http://artyomovlab.wustl.edu/aging/span.html for command line options +action = argv[0] +control = argv[1] +if action == 'model': + if control == 'with_control': + (chrom_sizes, treatment_file, bin, model_file, control_file) = argv[2:] + cmd = 'java -jar {} analyze --chrom.sizes {} --treatment {} --control {} --bin {}'.format( + SPAN_JAR, chrom_sizes, treatment_file, control_file, bin + ) + print "MODEL FILE" + model_file + elif control == 'without_control': + (chrom_sizes, treatment_file, bin, model_file) = argv[2:] + cmd = 'java -jar {} analyze --chrom.sizes {} --treatment {} --bin {}'.format( + SPAN_JAR, argv[2], argv[3], argv[4] + ) + print "MODEL FILE" + model_file + else: + raise Exception("Unknown control option {}".format(control)) + +elif action == "peaks": + if control == 'with_control': + (chrom_sizes, treatment_file, bin, model_file, control_file, fdr, gap, peaks_file) = argv[2:] + cmd = 'java -jar {} analyze --chrom.sizes {} --treatment {} --control {} --bin {} --fdr {} --gap {} --peaks {}'.format( + SPAN_JAR, chrom_sizes, treatment_file, control_file, bin, fdr, gap, peaks_file + ) + print "MODEL FILE" + model_file + elif control == 'without_control': + (chrom_sizes, treatment_file, bin, model_file, fdr, gap, peaks_file) = argv[2:] + cmd = 'java -jar {} analyze --chrom.sizes {} --treatment {} --bin {} --fdr {} --gap {} --peaks {}'.format( + SPAN_JAR, chrom_sizes, treatment_file, bin, fdr, gap, peaks_file + ) + print "MODEL FILE" + model_file + else: + raise Exception("Unknown control option {}".format(control)) +else: + raise Exception("Unknown action command {}".format(action)) + + +print 'Launching SPAN: {0}'.format(cmd) +subprocess.check_call(cmd, cwd=None, shell=True) diff -r 000000000000 -r 1f0c4f0a9c3b tool_dependencies.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_dependencies.xml Thu Nov 15 11:04:49 2018 -0500 @@ -0,0 +1,25 @@ + + + + + + + https://download.jetbrains.com/biolabs/span/span-0.7.1.4272.jar + + . + $INSTALL_DIR/ + + + + $INSTALL_DIR/span-0.7.1.4272.jar + + + + + Downloads SPAN Semi-supervised Peak Analyzer jar distribution file. + + +