ecoli.analysis.multiseed.doubling_time_trajectories

Doubling time per generation across all seeds of one experiment and variant, to show whether doubling time drifts over generations.

Top panel: one line per seed, with a red x where a lineage ended in a cell that failed and a purple square where a cell reached max_duration. Run this after the workflow finishes, because a cell that is still running also has no success marker.

Middle panel: mean and standard deviation across seeds for each generation.

Bottom panel: histogram of doubling times after skipping initial generations. Failed cells are excluded, except cells that reached max_duration. Those are counted at their doubling time even if fail_at_max_duration marked them as failed, because they were still alive at the time limit.

All panels mark the target doubling time of the condition the cells ran in (the config condition if set, otherwise the variant’s sim_data condition).

Optional params:
skip_n_gens: leave this many initial generations out of the histogram and of

the printed and titled average. All generations are still shown in the first two panels. Default: 2.

max_doubling_time: largest doubling time shown in the first two panels, in

minutes. Cells above this are drawn as triangles at the top of the first panel. Default: fits the data, up to 3 x target.

ecoli.analysis.multiseed.doubling_time_trajectories.get_config_condition(conn, config_sql)[source]

Return the condition set in the sim config, if any.

Parameters:
  • conn (DuckDBPyConnection)

  • config_sql (str)

Return type:

str | None

ecoli.analysis.multiseed.doubling_time_trajectories.get_max_duration_minutes(conn, config_sql)[source]

Return the shortest doubling time in minutes that counts as reaching max_duration, allowing for the final time step not being emitted.

Parameters:
  • conn (DuckDBPyConnection)

  • config_sql (str)

Return type:

float | None

ecoli.analysis.multiseed.doubling_time_trajectories.get_target_doubling_time(sim_data_dict, condition)[source]

Return the target doubling time in minutes of the condition the cells ran in, if available. sim_data.doubling_time is always the basal doubling time, so the target is looked up by condition instead: the condition from the sim config if set, otherwise the condition of the variant’s sim_data.

Parameters:
Return type:

float | None

ecoli.analysis.multiseed.doubling_time_trajectories.load_doubling_times(conn, history_sql, success_sql)[source]

Return one row per cell with its doubling time in minutes and whether it has a success marker.

Parameters:
  • conn (DuckDBPyConnection)

  • history_sql (str)

  • success_sql (str)

Return type:

DataFrame

ecoli.analysis.multiseed.doubling_time_trajectories.plot(params, conn, history_sql, config_sql, success_sql, sim_data_dict, validation_data_paths, outdir, variant_metadata, variant_names)[source]

Plot doubling time trajectories for each seed and their mean and SD.

Parameters: