Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend sbml #120

Merged
merged 5 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Create_PEtab_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function PEtabModel(path_yaml::String;
model_dict, _ = SBML_to_ModellingToolkit(path_SBML, path_model_jl_file, model_name, write_to_file=false,
only_extract_model_dict=true, ifelse_to_event=ifelse_to_event)
end
b_build = @elapsed callback_str, tstops_str = create_callbacks_for_piecewise(ode_system, parameter_map,
b_build = @elapsed callback_str, tstops_str = create_callbacks_SBML(ode_system, parameter_map,
state_map, model_dict, model_name, path_yaml, dir_julia, custom_parameter_values=custom_parameter_values,
write_to_file=write_to_file)
verbose == true && @printf(" done. Time = %.1es\n", b_build)
Expand Down Expand Up @@ -315,7 +315,7 @@ function add_parameter_condition_initial_values(model_str::String,
line_no_whitespace = replace(function_line_by_line[i], r"\s+" => "")

# Check which lines new initial value parameters should be added to the parametersMap
if length(line_no_whitespace) ≥ 19 && line_no_whitespace[1:19] == true_parameter_values_name
if length(line_no_whitespace) ≥ 13 && line_no_whitespace[1:13] == true_parameter_values_name
lines_add = (i+1):(i+length(new_parameter_names))
end

Expand All @@ -325,7 +325,7 @@ function add_parameter_condition_initial_values(model_str::String,
end

# Add new parameters in parameterArray
if length(line_no_whitespace) ≥ 14 && line_no_whitespace[1:14] == parameter_array_name
if length(line_no_whitespace) ≥ 10 && line_no_whitespace[1:10] == parameter_array_name
function_line_by_line[i] = function_line_by_line[i][1:end-1] * ", " * (" "*prod([str * ", " for str in new_parameter_names]))[1:end-2] * "]"
end

Expand Down
8 changes: 6 additions & 2 deletions src/PEtab.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,17 @@ include("Create_PEtab_model.jl")
include(joinpath("Process_PEtab_files", "Julia_tables_provided", "Create_PEtab_model.jl"))

# Importing SBML models
include(joinpath("SBML", "Structs.jl"))
include(joinpath("SBML", "SBML_to_ModellingToolkit.jl"))
include(joinpath("SBML", "SBML_parameters.jl"))
include(joinpath("SBML", "SBML_species.jl"))
include(joinpath("SBML", "SBML_functions.jl"))
include(joinpath("SBML", "SBML_rules.jl"))
include(joinpath("SBML", "Common.jl"))
include(joinpath("SBML", "Piecewise.jl"))
include(joinpath("SBML", "Events.jl"))
include(joinpath("SBML", "SBML_math.jl"))
include(joinpath("SBML", "Initial_assignments.jl"))
include(joinpath("SBML", "SBML_functions.jl"))
include(joinpath("SBML", "SBML_rules.jl"))
include(joinpath("SBML", "Reactions.jl"))
include(joinpath("SBML", "Solve_SBML_model.jl"))

Expand Down
344 changes: 172 additions & 172 deletions src/Process_PEtab_files/Process_callbacks.jl

Large diffs are not rendered by default.

Loading
Loading