75
75
# ################# Configuration Functions ##################
76
76
77
77
function loadConfiguration (M:: AbstractMonad )
78
- path_to_xml = joinpath (data_dir, " inputs" , " configs" , M. folder_names . config_folder , " config_variations" , " config_variation_$(M. variation_ids. config) .xml" )
78
+ path_to_xml = joinpath (data_dir, " inputs" , " configs" , M. inputs . config . folder , " config_variations" , " config_variation_$(M. variation_ids. config) .xml" )
79
79
if isfile (path_to_xml)
80
80
return
81
81
end
82
82
mkpath (dirname (path_to_xml))
83
- path_to_xml_src = joinpath (data_dir, " inputs" , " configs" , M. folder_names . config_folder , " PhysiCell_settings.xml" )
83
+ path_to_xml_src = joinpath (data_dir, " inputs" , " configs" , M. inputs . config . folder , " PhysiCell_settings.xml" )
84
84
cp (path_to_xml_src, path_to_xml, force= true )
85
85
86
86
xml_doc = openXML (path_to_xml)
87
87
query = constructSelectQuery (" config_variations" , " WHERE config_variation_id=$(M. variation_ids. config) ;" )
88
- variation_row = queryToDataFrame (query; db= configDB (M. folder_names . config_folder ), is_row= true )
88
+ variation_row = queryToDataFrame (query; db= configDB (M. inputs . config . folder ), is_row= true )
89
89
for column_name in names (variation_row)
90
90
if column_name == " config_variation_id"
91
91
continue
@@ -106,12 +106,12 @@ function loadConfiguration(sampling::Sampling)
106
106
end
107
107
108
108
function loadRulesets (M:: AbstractMonad )
109
- if M. variation_ids. rulesets == - 1 # no rules being used
109
+ if M. variation_ids. rulesets_collection == - 1 # no rules being used
110
110
return
111
111
end
112
- path_to_rulesets_collections_folder = joinpath (data_dir, " inputs" , " rulesets_collections" , M. folder_names . rulesets_collection_folder )
113
- path_to_rulesets_xml = joinpath (path_to_rulesets_collections_folder, " rulesets_collections_variations" , " rulesets_variation_$(M. variation_ids. rulesets ) .xml" )
114
- if isfile (path_to_rulesets_xml) # already have the rulesets variation created
112
+ path_to_rulesets_collections_folder = joinpath (data_dir, " inputs" , " rulesets_collections" , M. inputs . rulesets_collection . folder )
113
+ path_to_rulesets_xml = joinpath (path_to_rulesets_collections_folder, " rulesets_collections_variations" , " rulesets_variation_$(M. variation_ids. rulesets_collection ) .xml" )
114
+ if isfile (path_to_rulesets_xml) # already have the rulesets_collection variation created
115
115
return
116
116
end
117
117
mkpath (dirname (path_to_rulesets_xml)) # ensure the directory exists
@@ -124,11 +124,11 @@ function loadRulesets(M::AbstractMonad)
124
124
end
125
125
126
126
xml_doc = parse_file (path_to_base_xml)
127
- if M. variation_ids. rulesets != 0 # only update if not using the base variation for the ruleset
128
- query = constructSelectQuery (" rulesets_variations " , " WHERE rulesets_variation_id =$(M. variation_ids. rulesets ) ;" )
127
+ if M. variation_ids. rulesets_collection != 0 # only update if not using the base variation for the ruleset
128
+ query = constructSelectQuery (" rulesets_collection_variations " , " WHERE rulesets_collection_variation_id =$(M. variation_ids. rulesets_collection ) ;" )
129
129
variation_row = queryToDataFrame (query; db= rulesetsCollectionDB (M), is_row= true )
130
130
for column_name in names (variation_row)
131
- if column_name == " rulesets_variation_id "
131
+ if column_name == " rulesets_collection_variation_id "
132
132
continue
133
133
end
134
134
xml_path = columnNameToXMLPath (column_name)
@@ -141,10 +141,10 @@ function loadRulesets(M::AbstractMonad)
141
141
end
142
142
143
143
function loadICCells (M:: AbstractMonad )
144
- if M. folder_ids . ic_cell_id == - 1 # no ic cells being used
144
+ if M. inputs . ic_cell . id == - 1 # no ic cells being used
145
145
return
146
146
end
147
- path_to_ic_cells_folder = joinpath (data_dir, " inputs" , " ics" , " cells" , M. folder_names . ic_cell_folder )
147
+ path_to_ic_cells_folder = joinpath (data_dir, " inputs" , " ics" , " cells" , M. inputs . ic_cell . folder )
148
148
if isfile (joinpath (path_to_ic_cells_folder, " cells.csv" )) # ic already given by cells.csv
149
149
return
150
150
end
@@ -158,7 +158,7 @@ function loadICCells(M::AbstractMonad)
158
158
xml_doc = parse_file (path_to_base_xml)
159
159
if M. variation_ids. ic_cell != 0 # only update if not using the base variation for the ic cells
160
160
query = constructSelectQuery (" ic_cell_variations" , " WHERE ic_cell_variation_id=$(M. variation_ids. ic_cell) ;" )
161
- variation_row = queryToDataFrame (query; db= icCellDB (M. folder_names . ic_cell_folder ), is_row= true )
161
+ variation_row = queryToDataFrame (query; db= icCellDB (M. inputs . ic_cell . folder ), is_row= true )
162
162
for column_name in names (variation_row)
163
163
if column_name == " ic_cell_variation_id"
164
164
continue
@@ -173,8 +173,8 @@ function loadICCells(M::AbstractMonad)
173
173
end
174
174
175
175
function pathToICCell (simulation:: Simulation )
176
- @assert simulation. folder_ids . ic_cell_id != - 1 " No IC cell variation being used" # we should have already checked this before calling this function
177
- path_to_ic_cell_folder = joinpath (data_dir, " inputs" , " ics" , " cells" , simulation. folder_names . ic_cell_folder )
176
+ @assert simulation. inputs . ic_cell . id != - 1 " No IC cell variation being used" # we should have already checked this before calling this function
177
+ path_to_ic_cell_folder = joinpath (data_dir, " inputs" , " ics" , " cells" , simulation. inputs . ic_cell . folder )
178
178
if isfile (joinpath (path_to_ic_cell_folder, " cells.csv" )) # ic already given by cells.csv
179
179
return joinpath (path_to_ic_cell_folder, " cells.csv" )
180
180
end
@@ -291,7 +291,7 @@ function simpleConfigVariationNames(name::String)
291
291
end
292
292
293
293
function simpleRulesetsVariationNames (name:: String )
294
- if name == " rulesets_variation_id "
294
+ if name == " rulesets_collection_variation_id "
295
295
return " RulesVarID"
296
296
elseif startswith (name, " hypothesis_ruleset" )
297
297
return getRuleParameterName (name)
0 commit comments