Mercurial > repos > devteam > scatterplot
changeset 3:1dacc8aeb452 draft
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/scatterplot commit 93df3895fbf2fa44ff279303093fb89b79081687
author | devteam |
---|---|
date | Thu, 15 Sep 2016 05:36:51 -0400 |
parents | 53eb2c412783 |
children | 113045fca1aa |
files | scatterplot.py scatterplot.xml tool_dependencies.xml |
diffstat | 3 files changed, 19 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/scatterplot.py Fri Dec 18 19:14:12 2015 -0500 +++ b/scatterplot.py Thu Sep 15 05:36:51 2016 -0400 @@ -4,7 +4,12 @@ import sys from numpy import array -from rpy import r +import rpy2.rpy_classic as rpy +from rpy2.robjects.numpy2ri import numpy2ri + + +rpy.set_default_mode(rpy.NO_CONVERSION) +r = rpy.r def stop_err(msg): @@ -65,8 +70,9 @@ if skipped_lines < i: try: + a = numpy2ri(array( matrix )) r.pdf( out_fname, 8, 8 ) - r.plot( array( matrix ), type="p", main=title, xlab=xlab, ylab=ylab, col="blue", pch=19 ) + r.plot( a, type="p", main=title, xlab=xlab, ylab=ylab, col="blue", pch=19 ) r.dev_off() except Exception, exc: stop_err( "%s" % str( exc ) ) @@ -77,7 +83,5 @@ if skipped_lines > 0: print "Skipped %d lines starting with line #%d, value '%s' in column %d is not numeric." % ( skipped_lines, first_invalid_line, invalid_value, invalid_column ) - r.quit( save="no" ) - if __name__ == "__main__": main()
--- a/scatterplot.xml Fri Dec 18 19:14:12 2015 -0500 +++ b/scatterplot.xml Thu Sep 15 05:36:51 2016 -0400 @@ -1,8 +1,10 @@ -<tool id="scatterplot_rpy" name="Scatterplot" version="1.0.1"> +<tool id="scatterplot_rpy" name="Scatterplot" version="1.0.2"> <description>of two numeric columns</description> <requirements> <requirement type="package" version="1.9">numpy</requirement> - <requirement type="package" version="1.0.3">rpy</requirement> + <!-- explicit R requirement is necessary for toolshed package, conda rpy2 comes with R --> + <requirement type="package" version="3.2.1">R</requirement> + <requirement type="package" version="2.7.8">rpy2</requirement> </requirements> <command interpreter="python">scatterplot.py $input $out_file1 $col1 $col2 "$title" "$xlab" "$ylab"</command> <inputs> @@ -16,8 +18,6 @@ <outputs> <data format="pdf" name="out_file1" /> </outputs> - <!-- TODO: uncomment the following test when we have tools.update_state() working for - multiple dependents with the same dependency. <tests> <test> <param name="input" value="scatterplot_in1.tabular" ftype="tabular"/> @@ -26,10 +26,9 @@ <param name="title" value="Scatterplot"/> <param name="xlab" value="V1"/> <param name="ylab" value="V2"/> - <output name="out_file1" file="scatterplot_out1.pdf" /> + <output name="out_file1" file="scatterplot_out1.pdf" compare="sim_size" /> </test> </tests> - --> <help> .. class:: infomark
--- a/tool_dependencies.xml Fri Dec 18 19:14:12 2015 -0500 +++ b/tool_dependencies.xml Thu Sep 15 05:36:51 2016 -0400 @@ -1,9 +1,12 @@ <?xml version="1.0"?> <tool_dependency> <package name="numpy" version="1.9"> - <repository changeset_revision="f9289486f06d" name="package_numpy_1_9" owner="iuc" prior_installation_required="True" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + <repository changeset_revision="5f2b261ffc5b" name="package_python_2_7_numpy_1_9" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" /> </package> - <package name="rpy" version="1.0.3"> - <repository changeset_revision="3e11ba53f2a6" name="package_rpy_1_0_3" owner="devteam" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + <package name="R" version="3.2.1"> + <repository changeset_revision="77d439695328" name="package_r_3_2_1" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + </package> + <package name="rpy2" version="2.7.8"> + <repository changeset_revision="335987b7d119" name="package_rpy2_2_7_8" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" /> </package> </tool_dependency>