Skip to content

Commit

Permalink
bug fix: precision not using max signal
Browse files Browse the repository at this point in the history
  • Loading branch information
olive004 committed Oct 24, 2024
1 parent dba887a commit 542ea5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def prepare_batch_params(circuits: List[Circuit]):

b_steady_states = np.zeros((len(circuits), len(circuits[0].model.species)))
b_og_states = np.array([c.result_collector.get_result(
'steady_states').analytics['steady_states'].flatten(
'steady_states').analytics['steady_states'].flatten( # type: ignore
) for i, c in enumerate(circuits)])
b_reverse_rates = np.zeros(
(len(circuits), *circuits[0].qreactions.reactions.reverse_rates.shape))
Expand Down Expand Up @@ -482,13 +482,13 @@ def prepare_batch_params(circuits: List[Circuit]):
b_new_copynumbers = np.swapaxes(b_new_copynumbers, 1, 2)

# Fix first entry for signal species -> Warning: deletes final element in simulated data
# We need to do this so that the precision and sensitivity calculations are correct
for i, c in enumerate(circuits):
if not c.use_prod_and_deg:
b_new_copynumbers[i, :, :] = np.concatenate([np.expand_dims(
b_og_states[i, :], axis=1), b_new_copynumbers[i, :, :-1]], axis=1)

# Get analytics batched too

ref_circuits = [s for s in circuits if s.subname == 'ref_circuit']
ref_idxs = [circuits.index(s) for s in ref_circuits]
b_analytics_l = []
Expand Down
2 changes: 1 addition & 1 deletion synbio_morpher/utils/results/analytics/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def generate_base_analytics(data: jnp.ndarray, t: jnp.ndarray, labels: List[str]
starting_states=analytics['initial_steady_states'],
steady_states=analytics['steady_states'],
signal_0=analytics['initial_steady_states'][s_idx],
signal_1=data[s_idx, np.argmax(t >= signal_time)]
signal_1=peaks[s_idx]
)

# t axis: 1
Expand Down

0 comments on commit 542ea5d

Please sign in to comment.