Mercurial > repos > iuc > macs2
changeset 4:56e104999978 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/macs2 commit 9df9b52baf62b70fbcfc3fbe965d7197d4e8738e
author | iuc |
---|---|
date | Mon, 06 Feb 2017 02:30:37 -0500 |
parents | 6d4babad010f |
children | beb902da6e5f |
files | dir2html.py macs2_bdgdiff.xml macs2_callpeak.xml test-data/output_extra_files.html tool_dependencies.xml |
diffstat | 5 files changed, 69 insertions(+), 51 deletions(-) [+] |
line wrap: on
line diff
--- a/dir2html.py Wed Jan 27 15:23:25 2016 -0500 +++ b/dir2html.py Mon Feb 06 02:30:37 2017 -0500 @@ -1,38 +1,43 @@ -#!/usr/bin/env python -import os -import sys -from xml.sax.saxutils import escape - -def make_table( directory ): - ret = ['<table class="fileList">\n'] - for file in os.listdir( directory ): - ret.append('<tr><td class="file"><a href="%s">%s</a></td></tr>\n' % ( file, escape(file).replace( 'MACS2_', '' ) )) - ret.append('</table>') - return ''.join(ret) - -def make_html( directory, stderr ): - return '\n'.join(['<html>' - '<head>', - ' <title>Additional output created by MACS2</title>', - ' <style type="text/css">', - ' table.fileList { text-align: left; }', - ' td.directory { font-weight: bold; }', - ' td.file { padding-left: 4em; }', - ' </style>', - '</head>', - '<body>', - '<h1>Additional Files:</h1>', - make_table( directory ), - '<h3>Messages from MACS2:</h3>', - stderr.read().replace('\n', '<br>'), - '</body>', - '</html>']) - -if __name__ == '__main__': - if len(sys.argv) == 3: - directory_path = sys.argv[1] - stderr = open( sys.argv[2] ) - print make_html( directory_path, stderr ) - else: - sys.exit( 'Two parameter expected: directory path and stderr path' ) - +#!/usr/bin/env python + +from __future__ import print_function + +import os +import sys +from xml.sax.saxutils import escape + + +def make_table(directory): + ret = ['<table class="fileList">\n'] + for filename in os.listdir(directory): + ret.append('<tr><td class="file"><a href="%s">%s</a></td></tr>\n' % (filename, escape(filename).replace('MACS2_', ''))) + ret.append('</table>') + return ''.join(ret) + + +def make_html(directory, stderr): + return '\n'.join(['<html>' + '<head>', + ' <title>Additional output created by MACS2</title>', + ' <style type="text/css">', + ' table.fileList { text-align: left; }', + ' td.directory { font-weight: bold; }', + ' td.file { padding-left: 4em; }', + ' </style>', + '</head>', + '<body>', + '<h1>Additional Files:</h1>', + make_table(directory), + '<h3>Messages from MACS2:</h3>', + stderr.read().replace('\n', '<br>'), + '</body>', + '</html>']) + + +if __name__ == '__main__': + if len(sys.argv) == 3: + directory_path = sys.argv[1] + stderr = open(sys.argv[2]) + print(make_html(directory_path, stderr)) + else: + sys.exit('Two parameter expected: directory path and stderr path')
--- a/macs2_bdgdiff.xml Wed Jan 27 15:23:25 2016 -0500 +++ b/macs2_bdgdiff.xml Mon Feb 06 02:30:37 2017 -0500 @@ -33,11 +33,10 @@ <param name="depth2" type="integer" value="1" label="Sequence depth of condition 2 in million reads" help="default: 1 (--depth2)" /> <param name="maxgap" type="integer" value="100" label="Maximum gap to merge nearby differential regions" help="Consider a wider gap for broad marks. Maximum gap should be smaller than minimum length. Default: 100 (-g)." /> - <param name="outputs" type="select" display="checkboxes" multiple="True" label="Outputs"> + <param name="outputs" type="select" display="checkboxes" multiple="True" optional="false" label="Outputs"> <option value="--ofile-cond1">Unique regions in condition 1</option> <option value="--ofile-cond2">Unique regions in condition 2</option> <option value="--ofile-both-conditions" selected="true">Common regions in both conditions</option> - <validator type="no_options" message="Please select at least one output file." /> </param> </inputs> <outputs>
--- a/macs2_callpeak.xml Wed Jan 27 15:23:25 2016 -0500 +++ b/macs2_callpeak.xml Mon Feb 06 02:30:37 2017 -0500 @@ -66,8 +66,6 @@ #if str($cutoff_options.pvalue).strip() != '': --pvalue "${ cutoff_options.pvalue }" #end if - #else: - --foldenrichment "${ cutoff_options.foldenrichment }" #end if ## model options @@ -121,7 +119,6 @@ <param name="cutoff_options_selector" type="select" label="Peak detection based on" help="default uses q-value"> <option value="qvalue" selected="true">q-value</option> <option value="pvalue">p-value</option> - <option value="foldenrichment">foldenrichment</option> </param> <when value="pvalue"> <param name="pvalue" type="float" value="" label="p-value cutoff for peak detection" @@ -131,10 +128,6 @@ <param name="qvalue" type="float" value="0.05" label="Minimum FDR (q-value) cutoff for peak detection" help="default: 0.05 (--qvalue)"/> </when> - <when value="foldenrichment"> - <param name="foldenrichment" value="" type="integer" label="Foldenrichment cutoff for peak detection" - help="(--foldenrichment)"/> - </when> </conditional> <conditional name="nomodel_type"> @@ -150,14 +143,13 @@ </when> </conditional> - <param name="outputs" type="select" display="checkboxes" multiple="True" label="Outputs" help="PDF only created when model is build"> + <param name="outputs" type="select" display="checkboxes" multiple="True" optional="false" label="Outputs" help="PDF only created when model is build"> <option value="peaks_tabular" selected="True">Peaks as tabular file</option> <!--<option value="narrow">narrow Peaks</option>--> <option value="summits" selected="true">summits</option> <option value="bdg" selected="true">Scores in bedGraph files (--bdg)</option> <option value="html">Summary page (html)</option> <option value="pdf">Plot in PDF</option> - <validator type="no_options" message="Please select at least one output file." /> </param> <conditional name="advanced_options">
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/output_extra_files.html Mon Feb 06 02:30:37 2017 -0500 @@ -0,0 +1,22 @@ +<html><head> + <title>Additional output created by MACS2</title> + <style type="text/css"> + table.fileList { text-align: left; } + td.directory { font-weight: bold; } + td.file { padding-left: 4em; } + </style> +</head> +<body> +<h1>Additional Files:</h1> +<table class="fileList"> +<tr><td class="file"><a href="MACS2_model.pdf">model.pdf</a></td></tr> +<tr><td class="file"><a href="MACS2_summits.bed">summits.bed</a></td></tr> +<tr><td class="file"><a href="MACS2_model.r">model.r</a></td></tr> +<tr><td class="file"><a href="MACS2_peaks.narrowPeak">peaks.narrowPeak</a></td></tr> +<tr><td class="file"><a href="MACS2_model.r.log">model.r.log</a></td></tr> +<tr><td class="file"><a href="MACS2_peaks.xls">peaks.xls</a></td></tr> +</table> +<h3>Messages from MACS2:</h3> +INFO @ Tue, 24 Jan 2017 12:19:10: <br># Command line: callpeak --name MACS2 -t /tmp/tmp1QIUtc/files/000/dataset_1.dat -c /tmp/tmp1QIUtc/files/000/dataset_2.dat --format=BED --gsize 3300000000 --bw=300 --qvalue 0.05<br># ARGUMENTS LIST:<br># name = MACS2<br># format = BED<br># ChIP-seq file = ['/tmp/tmp1QIUtc/files/000/dataset_1.dat']<br># control file = ['/tmp/tmp1QIUtc/files/000/dataset_2.dat']<br># effective genome size = 3.30e+09<br># band width = 300<br># model fold = [5, 50]<br># qvalue cutoff = 5.00e-02<br># Larger dataset will be scaled towards smaller dataset.<br># Range for calculating regional lambda is: 1000 bps and 10000 bps<br># Broad region calling is off<br># Paired-End mode is off<br> <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 read tag files... <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 read treatment tags... <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1.2 read input tags... <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 tag size is determined as 100 bps <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 tag size = 100 <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 total tags in treatment: 199977 <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 user defined the maximum tags... <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 filter out redundant tags at the same location and the same strand by allowing at most 1 tag(s) <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 tags after filtering in treatment: 199583 <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 Redundant rate of treatment: 0.00 <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 total tags in control: 199978 <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 user defined the maximum tags... <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 filter out redundant tags at the same location and the same strand by allowing at most 1 tag(s) <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 tags after filtering in control: 199867 <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 Redundant rate of control: 0.00 <br>INFO @ Tue, 24 Jan 2017 12:19:10: #1 finished! <br>INFO @ Tue, 24 Jan 2017 12:19:10: #2 Build Peak Model... <br>INFO @ Tue, 24 Jan 2017 12:19:10: #2 looking for paired plus/minus strand peaks... <br>INFO @ Tue, 24 Jan 2017 12:19:11: #2 number of paired peaks: 4488 <br>INFO @ Tue, 24 Jan 2017 12:19:11: start model_add_line... <br>INFO @ Tue, 24 Jan 2017 12:19:11: start X-correlation... <br>INFO @ Tue, 24 Jan 2017 12:19:11: end of X-cor <br>INFO @ Tue, 24 Jan 2017 12:19:11: #2 finished! <br>INFO @ Tue, 24 Jan 2017 12:19:11: #2 predicted fragment length is 254 bps <br>INFO @ Tue, 24 Jan 2017 12:19:11: #2 alternative fragment length(s) may be 254 bps <br>INFO @ Tue, 24 Jan 2017 12:19:11: #2.2 Generate R script for model : MACS2_model.r <br>INFO @ Tue, 24 Jan 2017 12:19:11: #3 Call peaks... <br>INFO @ Tue, 24 Jan 2017 12:19:11: #3 Pre-compute pvalue-qvalue table... <br>INFO @ Tue, 24 Jan 2017 12:19:12: #3 Call peaks for each chromosome... <br>INFO @ Tue, 24 Jan 2017 12:19:13: #4 Write output xls file... MACS2_peaks.xls <br>INFO @ Tue, 24 Jan 2017 12:19:13: #4 Write peak in narrowPeak format file... MACS2_peaks.narrowPeak <br>INFO @ Tue, 24 Jan 2017 12:19:13: #4 Write summits bed file... MACS2_summits.bed <br>INFO @ Tue, 24 Jan 2017 12:19:13: Done! <br> +</body> +</html>
--- a/tool_dependencies.xml Wed Jan 27 15:23:25 2016 -0500 +++ b/tool_dependencies.xml Mon Feb 06 02:30:37 2017 -0500 @@ -7,13 +7,13 @@ <repository changeset_revision="cfbbe183f8a7" name="package_scipy_0_12" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" /> </package> <package name="R" version="3.1.2"> - <repository changeset_revision="c987143177d4" name="package_r_3_1_2" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" /> + <repository changeset_revision="4d2fd1413b56" name="package_r_3_1_2" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" /> </package> <package name="gnu_awk" version="4.1.0"> <repository changeset_revision="f145f856ec57" name="package_gnu_awk_4_1_0" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" /> </package> <package name="macs2" version="2.1.0.20151222"> - <repository changeset_revision="ae3cfa214a33" name="package_macs2_2_1_0_20151222" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" /> + <repository changeset_revision="e1370f7d5e2f" name="package_macs2_2_1_0_20151222" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" /> </package> <set_environment version="1.0"> <environment_variable action="set_to" name="MACS2_SCRIPT_PATH">$REPOSITORY_INSTALL_DIR</environment_variable>