# HG changeset patch # User fubar # Date 1691114428 0 # Node ID 51a0c2e0fbdf4e0f40c98580c447d354c8424f01 # Parent 08cc7a481af87d520afc7c04120f15b92db392dc Updated with latest ToolFactory with change_format for outputs so can make a png or html and it has an informative label since on $foo can be used. diff -r 08cc7a481af8 -r 51a0c2e0fbdf plotly_tabular_tool/README.md --- a/plotly_tabular_tool/README.md Fri Jul 28 06:01:53 2023 +0000 +++ b/plotly_tabular_tool/README.md Fri Aug 04 02:00:28 2023 +0000 @@ -1,14 +1,29 @@ -# plotly_tabular_tool +# plotly_tabular_tool - plotly.express wrapped as a Galaxy tool. + +## Install to your Galaxy server from the toolshed - search for plotly_tabular_tool owned by fubar2 + +### Example interactive plots and more at https://lazarus.name/demo/ -Galaxy tool to create plotly plots from user selected columns of any Galaxy tabular data. -Example interactive plots at https://lazarus.name/demo/ +#### Non interactive screen grab of the tool output +![Plotly blast html output screengrab](plotly_tabular_iris_sample.png) + +Galaxy tool to create plotly interactive hover detail HTML plots from user selected columns of any Galaxy tabular data. +## Recommended only for low dimensional data - a few thousand rows +Otherwise file sizes get huge and hover is useless to the viewer, so use non-interactive pdf for bigger data please. + +![Plotly tabular Galaxy tool form to generate the example](plotlytabular_toolform_sample.png) Plotly.express makes a lot of clever design decisions. -Unfortunately, it gets totally confused with evalue columns because it thinks scientific notation like 5.00e-204 is a string or something. -Strange and probably uninformative axes and plots will probably result if you try a blast evalue column without transformation. +Unfortunately, it gets totally confused with very small floats in scientific notation. Treats columns with 5.00e-204 as strings or something, so +strange and probably uninformative axes and plots will probably result if you try a blast evalue column without transformation. Note that all columns used for colour (legend) and the x/y axis tickmarks are truncated because they can squish up the plot. -.. is added at the end to show truncation. +*..* is appended at the truncation. A specialised version for 25 column Galaxy blastn search outputs is also available. It uses this code mostly, but adds a default header and auto-transformation of the evalue column -log10(x) to make them more like the bitscore +## Tool made with the Galaxy ToolFactory: https://github.com/fubar2/galaxy_tf_overlay +The current release includes this and a generic tabular version, and a java .jar wrapper in a history where the generating +ToolFactory form can be recreated using the redo button. Editing the tool id will make a new tool, so all other edits to parameters can be +made and the new tool generated without destroying the original sample. + diff -r 08cc7a481af8 -r 51a0c2e0fbdf plotly_tabular_tool/iris_interactive_10k.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plotly_tabular_tool/iris_interactive_10k.html Fri Aug 04 02:00:28 2023 +0000 @@ -0,0 +1,2 @@ +
+
diff -r 08cc7a481af8 -r 51a0c2e0fbdf plotly_tabular_tool/plotly_tabular_iris.html --- a/plotly_tabular_tool/plotly_tabular_iris.html Fri Jul 28 06:01:53 2023 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - -
-
- - \ No newline at end of file diff -r 08cc7a481af8 -r 51a0c2e0fbdf plotly_tabular_tool/plotly_tabular_iris_sample.png Binary file plotly_tabular_tool/plotly_tabular_iris_sample.png has changed diff -r 08cc7a481af8 -r 51a0c2e0fbdf plotly_tabular_tool/plotlytabular.xml --- a/plotly_tabular_tool/plotlytabular.xml Fri Jul 28 06:01:53 2023 +0000 +++ b/plotly_tabular_tool/plotlytabular.xml Fri Aug 04 02:00:28 2023 +0000 @@ -1,10 +1,11 @@ - - Plotly plot generator for any small-ish Galaxy tabular data. + + Plotly plot generator for Galaxy tabular data. pandas plotly + python-kaleido @@ -27,11 +28,14 @@ --title "$title" --header -"$header"]]> +"$header" +--image_type +"$outputimagetype"]]> MAXLEN: scatter['legendgroup'] = sl[:MAXLEN] -fig.write_html(args.htmlout) +if args.image_type == "short_html": + fig.write_html(args.htmlout, full_html=False, include_plotlyjs='cdn') +elif args.image_type == "long_html": + fig.write_html(args.htmlout) +elif args.image_type == "small_png": + ht = 768 + wdth = 1024 + fig.write_image('plotly.png', height=ht, width=wdth) + shutil.copyfile('plotly.png', args.htmlout) +else: + ht = 1200 + wdth = 1920 + fig.write_image('plotly.png', height=ht, width=wdth) + shutil.copyfile('plotly.png', args.htmlout) #end raw]]> @@ -101,12 +119,23 @@ - + - + + + + + + + - @@ -115,26 +144,37 @@ - + + MAXLEN: scatter['legendgroup'] = sl[:MAXLEN] - fig.write_html(args.htmlout) + if args.image_type == "short_html": + fig.write_html(args.htmlout, full_html=False, include_plotlyjs='cdn') + elif args.image_type == "long_html": + fig.write_html(args.htmlout) + elif args.image_type == "small_png": + ht = 768 + wdth = 1024 + fig.write_image('plotly.png', height=ht, width=wdth) + shutil.copyfile('plotly.png', args.htmlout) + else: + ht = 1200 + wdth = 1920 + fig.write_image('plotly.png', height=ht, width=wdth) + shutil.copyfile('plotly.png', args.htmlout) ]]> diff -r 08cc7a481af8 -r 51a0c2e0fbdf plotly_tabular_tool/plotlytabular_toolform_sample.png Binary file plotly_tabular_tool/plotlytabular_toolform_sample.png has changed diff -r 08cc7a481af8 -r 51a0c2e0fbdf plotly_tabular_tool/test-data/htmlout_sample --- a/plotly_tabular_tool/test-data/htmlout_sample Fri Jul 28 06:01:53 2023 +0000 +++ b/plotly_tabular_tool/test-data/htmlout_sample Fri Aug 04 02:00:28 2023 +0000 @@ -1,71 +1,2 @@ - - - -
-
- - \ No newline at end of file +
+
\ No newline at end of file