@@ -58,16 +58,16 @@ def process_mdlr(self, mdlrPath):
58
58
59
59
# append extended bng-xml to the bng-xml definition (the one that
60
60
# doesn't include seed information)
61
- bngxmlestr = writeBXe .mergeBXBXe (
61
+ bngxmlestr = writeBXe .merge_bxbxe (
62
62
namespace .input + '_total.xml' , namespace .input + '_extended.xml' )
63
63
with open (mdlrPath + '_total.xml' , 'w' ) as f :
64
64
f .write (bngxmlestr )
65
65
66
66
xmlspec = read_bngxml .parseFullXML (namespace .input + '.xml' )
67
67
# write out the equivalent plain mdl stuffs
68
- mdlDict = write_mdl .construct_mcell (
68
+ mdl_dict = write_mdl .construct_mcell (
69
69
xmlspec , namespace .input , finalName .split (os .sep )[- 1 ], nauty_dict )
70
- write_mdl .write_mdl (mdlDict , finalName )
70
+ write_mdl .write_mdl (mdl_dict , finalName )
71
71
72
72
def tokenize_seed_elements (self , seed ):
73
73
# extract species names
@@ -83,10 +83,10 @@ def tokenize_seed_elements(self, seed):
83
83
84
84
seedList = ['<Model><ListOfSpecies>{0}</ListOfSpecies></Model>' .format (x ) for x in seedList ]
85
85
86
- # seedDict = {x:y for x, y in zip(seedKeys, seedList)}
87
- seedDict = {x .split (';' )[0 ]: y for x , y in zip (seedKeys , seedList ) if x .split (';' )[1 ] != '0' }
88
- # print '---', seedDict .keys()
89
- return seedDict
86
+ # seed_dict = {x:y for x, y in zip(seedKeys, seedList)}
87
+ seed_dict = {x .split (';' )[0 ]: y for x , y in zip (seedKeys , seedList ) if x .split (';' )[1 ] != '0' }
88
+ # print '---', seed_dict .keys()
89
+ return seed_dict
90
90
91
91
def get_names_from_definition_string (self , defStr ):
92
92
speciesNames = re .findall ('[0-9a-zA-Z_]+\(' , defStr )
@@ -122,15 +122,15 @@ def xml2hnauty_species_definitions(self, inputMDLRFile):
122
122
# remove encapsulating tags
123
123
seed = seed [30 :- 30 ]
124
124
# get the seed species definitions as a list
125
- seedDict = self .tokenize_seed_elements (seed )
125
+ seed_dict = self .tokenize_seed_elements (seed )
126
126
127
127
nauty_dict = {}
128
- for seed in seedDict :
128
+ for seed in seed_dict :
129
129
# initialize nfsim with each species definition and get back a
130
130
# dirty list where one of the entries is the one we want
131
131
#
132
132
# XXX: i think i've solved it on the nfsim side, double check
133
- tmpList = self .get_nauty_string (seedDict [seed ])
133
+ tmpList = self .get_nauty_string (seed_dict [seed ])
134
134
# and now filter it out...
135
135
# get species names from species definition string
136
136
speciesNames = self .get_names_from_definition_string (seed )
@@ -152,10 +152,10 @@ def get_nauty_string(self, xmlSpeciesDefinition):
152
152
finalName = namespace .output if namespace .output else namespace .input
153
153
154
154
# mdl to bngl
155
- resultDict = read_mdl .constructBNGFromMDLR (namespace .input , namespace .nfsim )
155
+ resultDict = read_mdl .construct_bng_from_mdlr (namespace .input , namespace .nfsim )
156
156
outputDir = os .sep .join (namespace .output .split (os .sep )[:- 1 ])
157
157
# create bngl file
158
- read_mdl .outputBNGL (resultDict ['bnglstr' ], bnglPath )
158
+ read_mdl .output_bngl (resultDict ['bnglstr' ], bnglPath )
159
159
160
160
# temporaryly store bng-xml information in a separate file for display
161
161
# purposes
@@ -169,10 +169,10 @@ def get_nauty_string(self, xmlSpeciesDefinition):
169
169
170
170
read_mdl .bngl2json (namespace .input + '.bngl' )
171
171
# json 2 plain mdl
172
- mdlDict = write_mdl .constructMDL (
172
+ mdl_dict = write_mdl .constructMDL (
173
173
namespace .input + '_sbml.xml.json' , namespace .input , finalName )
174
174
# create an mdl with nfsim-species and nfsim-reactions
175
- write_mdl .write_mdl (mdlDict , finalName )
175
+ write_mdl .write_mdl (mdl_dict , finalName )
176
176
else :
177
177
try :
178
178
mdlr2mdl = MDLR2MDL (os .path .join (get_script_path (), 'mcellr.yaml' ))
0 commit comments