diff --git a/runs/heatmap-run/job.yml b/runs/heatmap-run/job.yml new file mode 100644 index 0000000000000000000000000000000000000000..0117e649dc596177720599ee50362be54d8e1b5f --- /dev/null +++ b/runs/heatmap-run/job.yml @@ -0,0 +1,4 @@ +MeasurementTableCSV: + class: File + path: ../../assays/SugarMeasurement/dataset/sugar_result.csv +FigureFileName: heatmap \ No newline at end of file diff --git a/workflows/heatmap/heatmap.py b/workflows/heatmap/heatmap.py new file mode 100644 index 0000000000000000000000000000000000000000..79efcbdc16dc06035f59dc970df3cee28fa32756 --- /dev/null +++ b/workflows/heatmap/heatmap.py @@ -0,0 +1,21 @@ +import pandas as pd +import plotly.express as px +import sys + +# Read command line arguments +MeasurementTableCSV=sys.argv[0] +FigureFileName=sys.argv[1] + +# Read the CSV file +data = pd.read_csv(MeasurementTableCSV, index_col=0) + +# Create a heatmap +fig = px.imshow(data, + labels=dict(x="Columns", y="Rows", color="Value"), + x=data.columns, + y=data.index) + +# Save heatmap to file +fig.write_image(FigureFileName + ".svg") + + diff --git a/workflows/heatmap/workflow.cwl b/workflows/heatmap/workflow.cwl new file mode 100644 index 0000000000000000000000000000000000000000..f0800704e16bc3834550043e5b42611b71810a2b --- /dev/null +++ b/workflows/heatmap/workflow.cwl @@ -0,0 +1,32 @@ +#!/usr/bin/env cwl-runner + +cwlVersion: v1.2 +class: CommandLineTool +# hints: +# DockerRequirement: +# dockerPull: +requirements: + - class: InitialWorkDirRequirement + listing: + - entryname: heatmap.py + entry: + $include: heatmap.py + - class: NetworkAccess + networkAccess: true +baseCommand: [python, heatmap.py] +inputs: + MeasurementTableCSV: + type: File + inputBinding: + position: 1 + FigureFileName: + type: string + inputBinding: + position: 2 + +outputs: + output: + type: File + outputBinding: + glob: "*.svg" +