Skip to content

Commit 94f7c02

Browse files
committed
add protection from models with invalid gpr expressions
1 parent 5a3e288 commit 94f7c02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/CBXML.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
2020
Author: Brett G. Olivier
2121
Contact email: [email protected]
22-
Last edit: $Author: bgoli $ ($Id: CBXML.py 640 2017-12-18 18:13:40Z bgoli $)
22+
Last edit: $Author: bgoli $ ($Id: CBXML.py 643 2018-03-08 23:17:53Z bgoli $)
2323
2424
"""
2525
## gets rid of "invalid variable name" info
@@ -3746,7 +3746,7 @@ def sbml_readSBML3FBC(fname, work_dir=None, return_sbml_model=False, xoptions={}
37463746
# note we may want to add branches here for using indexes etc etc
37473747
non_gpr_genes = []
37483748
for g_ in GPR_D:
3749-
if GPR_D[g_]['gpr_tree'] is not None and len(GPR_D[g_]['gpr_tree']) > 0:
3749+
if 'gpr_tree' in GPR_D[g_] and GPR_D[g_]['gpr_tree'] is not None and len(GPR_D[g_]['gpr_tree']) > 0:
37503750
#print(GPR_D[g_]['gpr_tree'])
37513751
#fm.createGeneProteinAssociation(GPR_D[g_]['reaction'], GPR_D[g_]['gpr_by_id'], gid=g_, update_idx=False, altlabels=gene_labels)
37523752

0 commit comments

Comments
 (0)