I think this is possible now, but with knowledge of some internal bits. Maybe this comes out-of-the-box-ready later. But here’s how you can do this using our Charts protocol (skip the docs, just do the below for now):
- Create a file called, for example,
concentration_in_vial.yaml
in the folder/home/pioreactor/.pioreactor/plugins/ui/contrib/charts/
. Add the following to the file:
---
chart_key: concentration_in_vial
data_source: alt_media_fractions
title: "Concentration of X in vial"
data_source_column: alt_media_fraction
mqtt_topic: dosing_automation/alt_media_fraction
source: app
y_axis_label: concentration
interpolation: stepAfter
y_axis_domain: [0.00, 0.05]
lookback: 100000
fixed_decimals: 3
y_transformation: "(y) => 0.001 * y" # change 0.001 to your alt media's known concentration of substrate
Save and exit.
- In your config.ini, adding the following under
ui.overview.charts
:
[ui.overview.charts]
...
concentration_in_vial=1
Hit [Save].
- Refresh the overview page. There may be a cache, so wait like 20 to 30s.
What we are doing is converting the fraction of alt-media to concentration of substrate via a y-axis transformation. (I may be an idiot, but I believe it’s linear transformation from fraction to concentration, like I have above in y_transformation
).
You could even make the concentration a config parameter:
y_transformation: "(y) => parseFloat(config['dosing_automation.pid_morbidostat']['concentration']) * y"
Just add a concentration
parameter under dosing_automation.pid_morbidostat
in your config.ini. I think that would work…