KarrLab / wc_lang

Language for describing whole-cell models as reaction networks
MIT License
9 stars 3 forks source link

Problem with wc_lang_io.Reader unit checking #142

Open artgoldberg opened 3 years ago

artgoldberg commented 3 years ago

Model dfba_test_model_RateLaw_Units_cannot_be_defined.xlsx has good rate units, '1 / second' or 's^-1'. But wc_lang.io.Reader().run('dfba_test_model_RateLaw_Units_cannot_be_defined.xlsx', validate=True) reports a validation error:

E      ValueError: The model cannot be loaded because it fails to validate:
E        RateLaw:
E          r1-backward:
E            'units':
E              Units must be defined
E          r1-forward:
E            'units':
E              Units must be defined
E          r2-backward:
E            'units':
E              Units must be defined
E          r2-forward:
E            'units':
E              Units must be defined
E          r3-forward:
E            'units':
E              Units must be defined
E          r4-forward:
E            'units':
E              Units must be defined

Using current version of wc_lang.

Cannot find a way to satisfy the validation. Possible, but unlikely, hint: Excel tip says "Rate units", not "Units". dfba_test_model_RateLaw_Units_cannot_be_defined.xlsx

artgoldberg commented 3 years ago

Using this wc_lang.cfg:

[wc_lang]
    EXTRACELLULAR_COMPARTMENT_ID = 'e'

    [[io]]
        strict = False
        validate = True

    [[dfba]]
        exchange_reaction_id_template = '__dfba_ex_{}_{}_{}'
        exchange_reaction_name_template = 'dFBA exchange ({}, {}, {})'

        [[[flux_bounds]]]
            min_reversible = -1000
            min_irreversible = 0
            max = 1000
            ex_carbon = 1.000e-6 # M s^-1
            ex_no_carbon = 1.667e-6 # M s^-1

    [[validation]]
        validate_element_charge_balance = False