SD2E / opil

The Open Protocol Interface Language (OPIL) is intended as a standard language for protocol interfaces
5 stars 1 forks source link

opil.MeasureValue with no unit #159

Closed tramyn closed 3 years ago

tramyn commented 3 years ago

I am using generate opil from strateos converter for these 4 strateos protocols: CellFreeRiboswitches, GrowthCurve, ObstacleCourse, and TimeSeriesHTP. During conversion, Intent Parser is identifying opil.MeasureValue objects without units provided. I expect units to appear because the opil specification indicates an opil.MeasureValue object referencing a opil.Measure object must have a unit.

Here are all the parameter fields that Intent Parser have logged with a parameter value but no unit:

CellFreeRiboswitches: 'rxn_info.rxn_group.sample_info.rxn_conc' = 20.0 'plate_reader_info.gain' = 0.16

GrowthCurve: 'plate_reader_info.list_of_gains.gain_1' = 0.1 'plate_reader_info.list_of_gains.gain_2' = 0.2 'plate_reader_info.list_of_gains.gain_3' = 0.3

ObstacleCourse: 'reagent_info.kill_switch.|.true.kill_switch_final_conc.magnitude' = 0.5 'reagent_info.inducer_info.|.1.inducer_1_final_conc.magnitude' = 0.5 'reagent_info.inducer_info.|.2.inducer_1_final_conc.magnitude' = 0.5 'reagent_info.inducer_info.|.2.inducer_2_final_conc.magnitude' = 0.5 'measurement_info.plate_reader_info.read_choice.|.fluorescence.gain' = 0.16

TimeSeriesHTP: 'induction_info.induction_reagents.inducer_layout.|.full_plate.inducer_conc' = 10.0 'induction_info.induction_reagents.inducer_layout.|.select_cols.col_and_conc.conc' = 15.0 'plate_reader_info.gain' = 0.274

bbartley commented 3 years ago

Isn't this issue caused by the fact that the author of the original ER document has not provided units for these Parameters in their document? (The StrateosOpilGenerator cannot tell in advance which units the experimental author intends.)

tramyn commented 3 years ago

I will need to go over these protocols again to see if these parameter fields are missing units. Last time I checked, I did see some of the protocols units provided but the converter separated these units into different parameter value objects. If you look at the ObstacleCourse protocol, there are units provided for 'reagent_info.kill_switch.|.true.kill_switch_final_conc.magnitude'. The unit comes in the form of a opil.EnumeratedParameter whereas the parameter value is represented as opil.MeasureParameter. The StrateosOpilGenerator converter will need to merge these parameter value and units into one opil object.

bbartley commented 3 years ago

That's a good point. Unfortunately, I don't think this information can currently be captured by a single OPIL object.

@jakebeal do you have any guidance about how the following information (example taken from the Obstacle Course schema) should be represented in OPIL?

"inputs": {
    "magnitude": {
        "type": "decimal", 
        "label": "Concentration", 
        "default": 0.5, 
        "description": "Concentration magnitude"
    }, 
    "unit": {
        "type": "choice", 
        "label": "Concentration Unit", 
        "description": "Specify concentration unit", 
        "default": "mM", 
        "options": [
            {
                "value": "millimolar", 
                "name": "millimolar"
            }, 
            {
                "value": "micromolar", 
                "name": "micromolar"
            }, 
            {
                "value": "nanomolar", 
                "name": "nanomolar"
            }
        ]
    }
}
tramyn commented 3 years ago

@bbartley I was thinking the converter can enumerate each parameter values with different possible units. Will it make sense to do something like this?

parameter_value1 = opil.Measure(0.5, tyto.OM. millimolar)
parameter_value2 = opil.Measure(0.5, tyto.OM. micromolar)
parameter_value3 = opil.Measure(0.5, tyto.OM. nanomolar)
jakebeal commented 3 years ago

I'm going to recommend a different approach. There's no actual reason that OPIL needs to say 50 micromolar instead of 0.05 millimolar. The human can use any of the options that they want in the cells, and we can turn them all into the actual base unit (molar) and convert it to the default (millimolar) and ignore the fact that the others are even possible.

bbartley commented 3 years ago

This is resolved in #175

Note that concentrations which were previously represented by two separate Parameters for magnitude and unit, e.g., reagent_info.kill_switch.|.true.kill_switch_final_conc.magnitude and reagent_info.kill_switch.|.true.kill_switch_final_conc.unit are now collapsed into a single Parameter called reagent_info.kill_switch.|.true.kill_switch_final_conc.

The units on gain Parameters are represented by opil:pureNumber