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

[WIP] Helper function to deal with timepoint-specific parameters #128

Merged
merged 50 commits into from
Oct 13, 2019
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e07857c
Merge pull request #107 from ICB-DCM/develop
dweindl May 2, 2019
8b3913f
Add test case and function stub for flatten_timepoint_specific_output…
dweindl Aug 20, 2019
e1ee5a0
observable changes in sbml model are still missing
Aug 20, 2019
f4e4ed4
changes implemented now also in sbml
Aug 21, 2019
34a6d06
Merge branch 'develop' into feature_125_flatten_timepoint_specific_ov…
dweindl Sep 7, 2019
367a0d1
Merge pull request #126 from ICB-DCM/develop
erikadudki Sep 11, 2019
c7db917
Merge branch 'develop' into feature_125_flatten_timepoint_specific_ov…
dweindl Sep 26, 2019
e871f9d
Merge branch 'develop' into feature_125_flatten_timepoint_specific_ov…
dweindl Oct 4, 2019
fecc292
updated function doc
Oct 4, 2019
5b03d15
remove creation of sbml file in test_flatten_timepoint_specific_outpu…
Oct 4, 2019
2fc3b2f
remove return statement from flatten_timepoint_specific_output_overri…
Oct 4, 2019
232581f
warning A value is trying to be set on a copy of a slice from a DataF…
Oct 4, 2019
5924f63
changed values[n] to string-based indexing
Oct 4, 2019
c1d7f9d
add line break - PEP
Oct 4, 2019
28c0098
fix call to generate exp id (#110)
yannikschaelte May 9, 2019
fe2ceaa
Fix deploy (#115)
yannikschaelte May 16, 2019
52beaf4
Visualization (#109)
erikadudki Aug 8, 2019
fe2d5fd
Feature visualization (#120)
paulstapor Aug 16, 2019
f180f34
Fix, test and deprecate petab.sbml.constant_species_to_parameters (#122)
dweindl Aug 18, 2019
24bdb5d
Add test case and function stub for flatten_timepoint_specific_output…
dweindl Aug 20, 2019
529441c
observable changes in sbml model are still missing
Aug 20, 2019
f6cceae
changes implemented now also in sbml
Aug 21, 2019
0e6c0f9
Feature prior (#130)
paulstapor Aug 26, 2019
f4b6d44
Add logo
dweindl Aug 27, 2019
bdcacaf
Add github social logo (#134)
dweindl Sep 6, 2019
1721791
Add PEtab problem illustration to format description
dweindl Sep 7, 2019
20b5790
Fix logo (#139)
yannikschaelte Sep 10, 2019
9cd3d8a
updated function doc
Oct 4, 2019
8377108
remove creation of sbml file in test_flatten_timepoint_specific_outpu…
Oct 4, 2019
15325d3
remove return statement from flatten_timepoint_specific_output_overri…
Oct 4, 2019
a85ffa8
warning A value is trying to be set on a copy of a slice from a DataF…
Oct 4, 2019
7025f12
changed values[n] to string-based indexing
Oct 4, 2019
7f9ca49
add line break - PEP
Oct 4, 2019
a111d67
Merge branch 'feature_125_flatten_timepoint_specific_overrides' of gi…
Oct 4, 2019
93f18db
Merge branch 'master' into feature_125_flatten_timepoint_specific_ove…
Oct 4, 2019
c1eb551
added blank line at end of file
Oct 4, 2019
6d1adca
added blank line at end of file
Oct 4, 2019
1604601
fix flake8
Oct 4, 2019
58ce147
started docummenting function
Oct 4, 2019
19fb05b
remove df_observable_parameters variable
Oct 4, 2019
a962041
loop over petab_problem.measurement_df.observableId when defining new…
Oct 4, 2019
f56d2e5
loop over petab_problem.measurement_df.observableId unique obs
Oct 4, 2019
3b8b59a
remove del statement
Oct 7, 2019
6699ee0
rename loop variable
Oct 7, 2019
b3f6173
flake8 formatting
Oct 7, 2019
8818169
docummentation
Oct 7, 2019
6d7394f
address review - change variable name in iterator
Oct 8, 2019
2b41f95
check whether the newly created observable ids happen to be inside th…
Oct 13, 2019
01ae26e
bug fix
Oct 13, 2019
9c19ccf
fix flake8
Oct 13, 2019
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
Prev Previous commit
Next Next commit
loop over petab_problem.measurement_df.observableId unique obs
  • Loading branch information
elba.raimundez committed Oct 4, 2019
commit f56d2e5ffe26c9d893c7b868b107bdc4b2dc6ddc
14 changes: 7 additions & 7 deletions petab/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ def flatten_timepoint_specific_output_overrides(
df_unique_values = df.drop_duplicates()
del df # remove variable
elbaraim marked this conversation as resolved.
Show resolved Hide resolved

# Create empty df
# Create empty df -> to be filled with replicate-specific observables
df_new = pd.DataFrame()

for nrow in range(len(df_unique_values.index)):
Expand All @@ -937,9 +937,9 @@ def flatten_timepoint_specific_output_overrides(
df_unique_values.loc[nrow, "simulationConditionId"])
]

# get unique observable parameters
# get list of unique observable parameters
unique_sc = df["observableParameters"].unique()
# get unique noise parameters
# get list of unique noise parameters
unique_noise = df["noiseParameters"].unique()

for n_noise in range(len(unique_noise)):
elbaraim marked this conversation as resolved.
Show resolved Hide resolved
elbaraim marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -955,10 +955,10 @@ def flatten_timepoint_specific_output_overrides(
df_new = df_new.append(df.loc[idxs == 0])
df.loc[idxs == 0, "observableId"] = tmp
elbaraim marked this conversation as resolved.
Show resolved Hide resolved

elbaraim marked this conversation as resolved.
Show resolved Hide resolved
# Redefine measurement df with replicate-specific observables
# Update/Redefine measurement df with replicate-specific observables
petab_problem.measurement_df = df_new

# get unique observable names
# Get list of already existing unique observable names
unique_observables = df["observableId"].unique()

# Remove already existing observables from the sbml model
Expand All @@ -968,8 +968,8 @@ def flatten_timepoint_specific_output_overrides(
petab_problem.sbml_model.removeParameter(
'observable_' + obs)

# Redefine replicate-specific observables in the sbml model
for n_obs in petab_problem.measurement_df.observableId[:-1]:
# Redefine with replicate-specific observables in the sbml model
for n_obs in petab_problem.measurement_df["observableId"].unique():
elbaraim marked this conversation as resolved.
Show resolved Hide resolved
sbml.add_global_parameter(
sbml_model=petab_problem.sbml_model,
parameter_id='observableParameter1_' + n_obs)
Expand Down