RbaModel¶
Create a resource balance constraint model, RBA or TRBA, by extending a XbaModel instance.
- class f2xba.RbaModel(xba_model)[source]¶
Create a resource balance constraint model (RBA or TRBA) by extending a XbaModel instance.
RBA mplementation is based on the Python package RbaPy (Bulović et al., 2019).
Ref: Bulović, A., Fischer, S., Dinh, M., Golib, F., Liebermeister, W., Poirier, C., Tournier, L., Klipp, E., Fromion, V., & Goelzer, A. (2019). Automated generation of bacterial resource allocation models. Metabolic Engineering, 55, 12-22. https://doi.org/https://doi.org/10.1016/j.ymben.2019.06.001
Example: Create a RBA model by extending an existing genome scale metabolic model. The spreadsheet files xba_parameters.xlsx and rba_parameters.xlsx contain configuration data. See tutorials.
xba_model = XbaModel('iML1515.xml') xba_model.configure('xba_parameters.xlsx') rba_model = RbaModel(xba_model) rba_model.configure('rba_parameters.xlsx') if rba_model.validate(): rba_model.export('iML1515_RBA.xml')
- model¶
Reference to the XbaModel instance.
- dna¶
Reference to DNA macromolecule configuration.
- rnas¶
Reference to RNA macromolecule configurations.
- proteins¶
Reference to protein macromolecule configurations.
- metabolism¶
Reference to RBA compartment, species and reaction configurations.
- parameters¶
Reference to RBA function configurations.
- processes¶
Reference to RBA processes configurations.
- densities¶
Reference to RBA compartment density configurations.
- targets¶
Reference to RBA targets configurations.
- enzymes¶
Reference to RBA enzyme configurations.
- medium¶
Reference to RBA medium configuration.
- cid_mappings¶
Map compartment identifiers to compartment specific roles.
- mmid2mm¶
Map macromolecules to configuration data.
- initial_assignments¶
Reference to initial assignments used in the SBML model.
- parameter_values¶
Parameter values configured in the model.
- configure(fname)[source]¶
Configure the RbaModel instance with information provided in the RBA configuration file.
The RBA configuration spreadsheet must contain following sheets: ‘general’, ‘trna2locus’, ‘compartments’, ‘targets’, ‘functions’, ‘processing_maps’, ‘processes’ and ‘machineries’. The sheet ‘coenzymes’ is optional.
Example: Create a RBA model by extending an existing genome scale metabolic model. The spreadsheet files xba_parameters.xlsx and rba_parameters.xlsx contain configuration data. See tutorials.
xba_model = XbaModel('iML1515.xml') xba_model.configure('xba_parameters.xlsx') rba_model = RbaModel(xba_model) rba_model.configure('rba_parameters.xlsx')
- Parameters:
fname (str) – filename of RBA configuration file (.xlsx)
- Returns:
success status
- Return type:
bool
- validate(validate_sbml=True)[source]¶
Validate compliance with SBML standards and completeness wrt RBA.
The validation with SBML standards can be suppressed using the optional parameter validate_sbml.
Validation against SBML standards is an optional task taking time. Validation could be skipped once model configuration is stable.
Information on non-compliance is printed. Details are written to tmp/tmp.txt. In case of an unsuccessful validation, it is recommended to review tmp/tmp.txt and improve on the model configuration.
Example: Ensure completeness of RbaModel and ensure compliance with SBML standards prior to export.
if rba_model.validate(): rba_model.export('iML1515_RBA.xml')
- Parameters:
validate_sbml (bool) – validate SBML compliance (default: True)
- Returns:
success status
- Return type:
bool
- export(fname, export_format='SBML')[source]¶
Export RbaModel instance to SBML encoded file, RBApy encoded format (directory) or spreadsheet (.xlsx).
Setting the optional parameter export_format to RBApy and providing a directory name in fname exports the file in proprietary RBApy 1.0 format. The SBML encoded model may include additional features and functionality.
The spreadsheet (.xlsx) is helpful to inspect model configuration for of SBML and RBApy formats.
Example: Export RbaModel instance to SBML encoded file and to spreadsheet.
xba_model = XbaModel('iML1515.xml') xba_model.configure('xba_parameters.xlsx') rba_model = RbaModel(xba_model) rba_model.configure('rba_parameters.xlsx') if rba_model.validate(): rba_model.export('iML1515_RBA.xml') rba_model.export('iML1515_RBA.xlsx')
- Parameters:
fname (str) – filename with extension ‘.xml’ or ‘.xlsx’, or a directory name for RBApy format
export_format (str) – export format: ‘SBML’ or ‘RBApy’ (default: ‘SBML’)
- Returns:
success status
- Return type:
bool