| Title: | SummarizedExperiment Infrastructure for Microbial Growth Phenotyping |
|---|---|
| Description: | growkar provides Bioconductor-native infrastructure for high-throughput microbial growth phenotyping from plate-based assays such as optical density (OD) measurements. The package is built around SummarizedExperiment as its canonical data model, with OD measurements in assays, timepoint annotations in rowData, sample annotations in colData, and derived phenotypes in metadata. growkar supports data import, quality control, normalization, empirical growth-rate estimation, exponential-phase detection, and parametric modeling of growth dynamics. These workflows enable extraction of biologically meaningful phenotypes including lag time, growth rate, doubling time, and carrying capacity, and allow growth-derived phenotypes to be integrated with other Bioconductor analyses in microbial systems biology and multi-omics studies. The data-structure and analysis layers depend only on core Bioconductor infrastructure; graphing is optional and provided by 'plot_*' functions that are enabled when the suggested graphics package is installed. |
| Authors: | Pooja Sethiya [aut, cre] (ORCID: <https://orcid.org/0000-0001-6584-3912>) |
| Maintainer: | Pooja Sethiya <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.99.4 |
| Built: | 2026-10-07 13:22:00 UTC |
| Source: | https://github.com/bioc/growkar |
Import adapter that converts vendor plate-reader exports and user tables
into the canonical sample/time/od columns expected by
GrowthExperiment().
as_tidy_growth_data( data, sample_col = "sample", time_col = "time", od_col = "od", sample_sep = "_" )as_tidy_growth_data( data, sample_col = "sample", time_col = "time", od_col = "od", sample_sep = "_" )
data |
A data frame, tibble, |
sample_col |
Name of the sample column for long-form input. |
time_col |
Name of the time column. |
od_col |
Name of the optical density column. |
sample_sep |
Separator used to infer metadata columns from sample names
in wide data or in long data when |
This function is an import layer, not an analysis container. Within
growkar the canonical container is
SummarizedExperiment::SummarizedExperiment. Once data are in a
SummarizedExperiment, tidy manipulation and display are better handled by
the tidyomics stack: install tidySummarizedExperiment and use
dplyr/tidyr/ggplot2 verbs directly on the object rather than round
tripping through this function. See
vignette("growkar-introduction", package = "growkar") for worked
interoperability examples.
Wide input is expected to contain time in the first column and sample names
in the remaining column names. Tidy input is expected to contain at least
sample, time, and od. When replicate identifiers are encoded in sample
names, use a consistent suffix such as _R1 or _1 so replicate metadata
can be inferred reliably. Common machine-exported column labels such as
Time [s], Time [h], Sample, Well, OD600, OD 600, and
Absorbance 600 are detected automatically where possible, which helps
when importing exports from Agilent microplate readers, BioTek Cytation
instruments, LogPhase 600, and similar OD600-based plate-reader workflows.
A tibble containing at least sample, time, and od. Additional
metadata columns are preserved where available.
data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) head(tidy_growth) se <- GrowthExperiment(yeast_growth_data) head(as_tidy_growth_data(se))data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) head(tidy_growth) se <- GrowthExperiment(yeast_growth_data) head(as_tidy_growth_data(se))
Return the observed data used for fitting together with the fitted values from a GrowthFit object.
augment_growth_fit(fit, ...) ## S4 method for signature 'GrowthFit' augment_growth_fit(fit, ...)augment_growth_fit(fit, ...) ## S4 method for signature 'GrowthFit' augment_growth_fit(fit, ...)
fit |
A GrowthFit object returned by |
... |
Arguments passed to methods. |
A tidy tibble containing the observed columns plus .fitted.
data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) head(augment_growth_fit(fit))data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) head(augment_growth_fit(fit))
Compute doubling time from a growth rate estimate.
compute_doubling_time(mu)compute_doubling_time(mu)
mu |
Numeric vector of specific growth-rate estimates. In |
This is a low-level helper for converting one or more growth-rate estimates
into doubling times. For a convenience summary across all samples, use
summarize_growth_metrics().
A numeric vector equal to log(2) / mu, with NA returned when
mu <= 0.
compute_doubling_time(c(0.4, 0.7, NA, -0.1))compute_doubling_time(c(0.4, 0.7, NA, -0.1))
Estimate per-sample growth rate from tidy growth data.
compute_growth_rate( data, method = c("rolling_window", "defined_interval", "rule_based"), interval = NULL, select_replicates = NULL, average_replicates = FALSE, window_size = 5, min_od = 0.02, first_timepoint = NULL )compute_growth_rate( data, method = c("rolling_window", "defined_interval", "rule_based"), interval = NULL, select_replicates = NULL, average_replicates = FALSE, window_size = 5, min_od = 0.02, first_timepoint = NULL )
data |
Growth curve data in tidy, wide, or |
method |
Estimation method. One of |
interval |
Interval definition for |
select_replicates |
Optional character vector of replicate IDs to retain
before estimation. When |
average_replicates |
Logical; if |
window_size |
Rolling window size for |
min_od |
Minimum OD retained when fitting log-linear models. |
first_timepoint |
Reference time used by the |
The returned mu column is the specific growth rate, estimated as the slope
of log(od) versus time over the selected interval or window.
Available methods:
rolling_window: scans rolling windows across the time series and
selects the window with the strongest positive log-linear slope.
defined_interval: fits the growth rate over a user-supplied start
and end time interval. Supply either one interval for all samples or a
per-sample interval table.
rule_based: starts from a reference OD, finds the nearest
successive OD doublings, and estimates growth from the interval between
those doubling anchors.
For the rule_based method, growkar first picks a reference OD at the
earliest time point, or at first_timepoint when supplied. It then finds the
observations nearest to approximately 2x and 4x that reference OD. The
growth rate is estimated from the log-linear slope between those two
doubling anchors. This provides a simple empirical approximation when users
want a heuristic interval rather than a rolling search or manually defined
bounds.
A tibble with sample, mu, start_time, end_time, r_squared,
and method. Here mu is the estimated specific growth rate. Additional
diagnostic columns describe the number of points used and whether the
estimate required degraded fallback behavior. Here degraded = TRUE
indicates that the preferred estimation path could not be used cleanly, so
the result comes from a reduced-window or fallback path and should be
interpreted with extra caution.
data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] compute_growth_rate( dplyr::filter(tidy_growth, sample == sample_id), method = "rolling_window" ) compute_growth_rate( tidy_growth, method = "defined_interval", interval = c(2, 6) )data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] compute_growth_rate( dplyr::filter(tidy_growth, sample == sample_id), method = "rolling_window" ) compute_growth_rate( tidy_growth, method = "defined_interval", interval = c(2, 6) )
Identify rolling windows with the strongest evidence for exponential growth.
For multi-sample input, detection is performed separately for each sample.
When average_replicates = TRUE, replicate trajectories are averaged first
and exponential-phase detection is then run on the averaged curves.
detect_exponential_phase( data, select_replicates = NULL, average_replicates = FALSE, window_size = 5, min_od = 0.02 )detect_exponential_phase( data, select_replicates = NULL, average_replicates = FALSE, window_size = 5, min_od = 0.02 )
data |
Growth data for one sample or multiple samples in tidy, wide, or
|
select_replicates |
Optional character vector of replicate IDs to retain
before detection. When |
average_replicates |
Logical; if |
window_size |
Number of observations in each rolling window. |
min_od |
Minimum OD retained for log-linear fitting. |
A tibble with sample, start_time, end_time, slope, and
r_squared, ranked by highest positive slope and then r_squared. The
returned tibble also includes rank, n_points, selection_reason, and
degraded metadata describing how the candidate windows were selected. For
multi-sample input, windows are returned for each sample. Here
degraded = TRUE indicates that detection required fallback behavior, such
as reducing the requested window size or returning a placeholder result
because too few usable observations were available.
data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] phase_tbl <- detect_exponential_phase(dplyr::filter(tidy_growth, sample == sample_id)) head(phase_tbl) averaged_phase_tbl <- detect_exponential_phase( tidy_growth, average_replicates = TRUE ) head(averaged_phase_tbl)data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] phase_tbl <- detect_exponential_phase(dplyr::filter(tidy_growth, sample == sample_id)) head(phase_tbl) averaged_phase_tbl <- detect_exponential_phase( tidy_growth, average_replicates = TRUE ) head(averaged_phase_tbl)
Extract fitted coefficients and model-derived quantities, such as the asymptote and the model-based doubling time, from a GrowthFit object.
extract_params(fit, ...) ## S4 method for signature 'GrowthFit' extract_params(fit, ...)extract_params(fit, ...) ## S4 method for signature 'GrowthFit' extract_params(fit, ...)
fit |
A GrowthFit object returned by |
... |
Arguments passed to methods. |
A tibble with one row containing sample, model, asymptote,
r, t0, and doubling_time_model.
data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) extract_params(fit)data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) extract_params(fit)
Fit a logistic or Gompertz growth model to a single sample.
fit_growth_curve(data, model = c("logistic", "gompertz"))fit_growth_curve(data, model = c("logistic", "gompertz"))
data |
Growth curve data for one sample in tidy, wide, or
|
model |
Model type: |
A GrowthFit object. Failed fits return the same class with
converged = FALSE and a status slot describing the failure, so that
plate-wide fitting is not aborted by a single problematic sample.
data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve( dplyr::filter(tidy_growth, sample == sample_id), model = "logistic" ) fitdata(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve( dplyr::filter(tidy_growth, sample == sample_id), model = "logistic" ) fit
Fit logistic or Gompertz growth models for tidy, wide, or
SummarizedExperiment input. When data is a SummarizedExperiment, fitted
model objects and extracted parameter summaries are stored in metadata(),
and the updated object is returned.
fit_growth_models( data, model = c("logistic", "gompertz"), store_metadata = TRUE )fit_growth_models( data, model = c("logistic", "gompertz"), store_metadata = TRUE )
data |
Growth curve data in tidy, wide, or |
model |
Model type: |
store_metadata |
Logical; when |
A tibble with fitted models for non-SummarizedExperiment input, or
an updated SummarizedExperiment when data is a SummarizedExperiment.
data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) se <- fit_growth_models(se, model = "logistic") S4Vectors::metadata(se)$growth_model_parametersdata(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) se <- fit_growth_models(se, model = "logistic") S4Vectors::metadata(se)$growth_model_parameters
Split tidy growth data by sample and fit a parametric model to each sample.
fit_growth_plate(data, model = c("logistic", "gompertz"))fit_growth_plate(data, model = c("logistic", "gompertz"))
data |
Growth curve data in tidy, wide, or |
model |
Model type: |
A tibble with sample and a list-column of GrowthFit
objects.
data(yeast_growth_data) fits <- fit_growth_plate(yeast_growth_data, model = "logistic") fitsdata(yeast_growth_data) fits <- fit_growth_plate(yeast_growth_data, model = "logistic") fits
Access the canonical OD assay from a SummarizedExperiment.
growth_assay(x)growth_assay(x)
x |
A |
A numeric matrix with time points in rows and samples in columns.
data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) growth_assay(se)data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) growth_assay(se)
Compute growth metrics for tidy, wide, or SummarizedExperiment input. When
data is a SummarizedExperiment, the resulting metrics table is stored in
metadata(data)$growth_metrics, and the updated object is returned.
growth_metrics( data, method = c("rolling_window", "defined_interval", "rule_based"), average_replicates = FALSE, select_replicates = NULL, comparison_col = NULL, compare_to = NULL, error = c("se", "sd"), pvalue_method = c("t_test", "wilcox"), store_metadata = TRUE, ... )growth_metrics( data, method = c("rolling_window", "defined_interval", "rule_based"), average_replicates = FALSE, select_replicates = NULL, comparison_col = NULL, compare_to = NULL, error = c("se", "sd"), pvalue_method = c("t_test", "wilcox"), store_metadata = TRUE, ... )
data |
Growth curve data in tidy, wide, or |
method |
Estimation method passed to |
average_replicates |
Logical; if |
select_replicates |
Optional character vector of replicate IDs to retain
before summarizing. When |
comparison_col |
Optional column used to summarize replicate-level
doubling times and compute group-wise statistics. Typical values are
|
compare_to |
Optional reference group in |
error |
Statistic used for doubling-time error bars and summary output.
One of |
pvalue_method |
Statistical test used when |
store_metadata |
Logical; when |
... |
Additional arguments passed to |
A tidy tibble for non-SummarizedExperiment input, or an updated
SummarizedExperiment when data is a SummarizedExperiment.
data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) se <- growth_metrics(se, method = "rolling_window", average_replicates = TRUE) S4Vectors::metadata(se)$growth_metricsdata(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) se <- growth_metrics(se, method = "rolling_window", average_replicates = TRUE) S4Vectors::metadata(se)$growth_metrics
Retrieve fitted growth model objects stored in metadata().
growth_model_fits(x)growth_model_fits(x)
x |
A |
A tibble of stored model fits, or NULL if no fits have been stored.
data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) se <- fit_growth_models(se, model = "logistic") growth_model_fits(se)data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) se <- fit_growth_models(se, model = "logistic") growth_model_fits(se)
GrowthExperiment
Build a GrowthExperiment object, the canonical growkar container,
from tidy or wide growth curve data. GrowthExperiment extends
SummarizedExperiment::SummarizedExperiment, so the result can be used
directly by any Bioconductor package.
GrowthExperiment( data, metrics = NULL, sample_col = "sample", time_col = "time", od_col = "od", sample_sep = "_" )GrowthExperiment( data, metrics = NULL, sample_col = "sample", time_col = "time", od_col = "od", sample_sep = "_" )
data |
Growth curve data in tidy or wide format, or a
|
metrics |
Optional data frame of precomputed sample-level metrics to
store in |
sample_col |
Name of the sample column for long-form input. |
time_col |
Name of the time column. |
od_col |
Name of the optical density column. |
sample_sep |
Separator used to infer metadata columns from sample names. |
The resulting object stores time points in rowData(x)$time, sample-level
metadata in colData(x), optical density measurements in
assay(x, "od"), and derived results in metadata(x).
Coercion methods are also provided, so as(x, "GrowthExperiment") works for
a data.frame, tibble, matrix, or existing SummarizedExperiment, and
as(x, "SummarizedExperiment") is available in the other direction. Use the
constructor when you need to control column-name resolution; use as() for
the default behaviour.
A GrowthExperiment object with one assay named od.
data(yeast_growth_data) ge <- GrowthExperiment(yeast_growth_data) ge # Equivalent, using standard coercion. as(yeast_growth_data, "GrowthExperiment")data(yeast_growth_data) ge <- GrowthExperiment(yeast_growth_data) ge # Equivalent, using standard coercion. as(yeast_growth_data, "GrowthExperiment")
GrowthExperiment is the data container used throughout growkar. It is an
S4 class that directly extends
SummarizedExperiment::SummarizedExperiment, adding a validity method that
enforces the canonical growth-assay layout:
an assay named od holding optical density measurements, with timepoints
in rows and samples in columns;
a numeric time column in rowData();
sample annotations in colData();
derived results (growth metrics, exponential-phase windows, model fits) in
metadata().
Because the class extends SummarizedExperiment, every method written for
SummarizedExperiment — including subsetting, assay(), rowData(),
colData(), metadata(), and the tidyomics verbs provided by
tidySummarizedExperiment — applies unchanged, and
as(x, "SummarizedExperiment") is always available for handing objects to
other Bioconductor packages.
Construct objects with GrowthExperiment(), or coerce with
as(x, "GrowthExperiment") from a data.frame, tibble, matrix, or
existing SummarizedExperiment.
A GrowthExperiment object.
GrowthExperiment(), validate_growth_experiment()
data(yeast_growth_data) ge <- GrowthExperiment(yeast_growth_data) ge # Standard coercion in both directions. se <- as(ge, "SummarizedExperiment") identical(ge, as(se, "GrowthExperiment")) # Inherited SummarizedExperiment methods apply unchanged. SummarizedExperiment::assayNames(ge) dim(ge[, 1:3])data(yeast_growth_data) ge <- GrowthExperiment(yeast_growth_data) ge # Standard coercion in both directions. se <- as(ge, "SummarizedExperiment") identical(ge, as(se, "GrowthExperiment")) # Inherited SummarizedExperiment methods apply unchanged. SummarizedExperiment::assayNames(ge) dim(ge[, 1:3])
GrowthExperiment
Standard S4 coercion methods for GrowthExperiment. Coercion in the
opposite direction, as(x, "SummarizedExperiment"), is inherited from the
class hierarchy and always available.
from |
A |
A GrowthExperiment object.
data(yeast_growth_data) ge <- as(yeast_growth_data, "GrowthExperiment") ge se <- as(ge, "SummarizedExperiment") as(se, "GrowthExperiment")data(yeast_growth_data) ge <- as(yeast_growth_data, "GrowthExperiment") ge se <- as(ge, "SummarizedExperiment") as(se, "GrowthExperiment")
GrowthFit ObjectsExtract individual components of a GrowthFit object. These
accessors are the supported interface; slots should not be accessed
directly with @.
fit_sample(x, ...) fit_model(x, ...) fit_status(x, ...) fit_converged(x, ...) fit_data(x, ...) ## S4 method for signature 'GrowthFit' fit_sample(x, ...) ## S4 method for signature 'GrowthFit' fit_model(x, ...) ## S4 method for signature 'GrowthFit' fit_status(x, ...) ## S4 method for signature 'GrowthFit' fit_converged(x, ...) ## S4 method for signature 'GrowthFit' fit_data(x, ...)fit_sample(x, ...) fit_model(x, ...) fit_status(x, ...) fit_converged(x, ...) fit_data(x, ...) ## S4 method for signature 'GrowthFit' fit_sample(x, ...) ## S4 method for signature 'GrowthFit' fit_model(x, ...) ## S4 method for signature 'GrowthFit' fit_status(x, ...) ## S4 method for signature 'GrowthFit' fit_converged(x, ...) ## S4 method for signature 'GrowthFit' fit_data(x, ...)
x |
A GrowthFit object. |
... |
Arguments passed to methods. |
fit_sample(): a character scalar naming the fitted sample.
fit_model(): a character scalar naming the fitted model.
fit_status(): a character scalar describing the fit outcome.
fit_converged(): a logical scalar.
fit_data(): a tibble of the observed data used for fitting.
data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) fit_sample(fit) fit_model(fit) fit_status(fit) fit_converged(fit) head(fit_data(fit))data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) fit_sample(fit) fit_model(fit) fit_status(fit) fit_converged(fit) head(fit_data(fit))
GrowthFit ObjectMethods for the standard modelling generics stats::coef(),
stats::fitted(), stats::residuals(), and stats::nobs().
## S4 method for signature 'GrowthFit' coef(object, ...) ## S4 method for signature 'GrowthFit' fitted(object, ...) ## S4 method for signature 'GrowthFit' residuals(object, ...) ## S4 method for signature 'GrowthFit' nobs(object, ...)## S4 method for signature 'GrowthFit' coef(object, ...) ## S4 method for signature 'GrowthFit' fitted(object, ...) ## S4 method for signature 'GrowthFit' residuals(object, ...) ## S4 method for signature 'GrowthFit' nobs(object, ...)
object |
A GrowthFit object. |
... |
Unused, present for generic compatibility. |
coef(): a named numeric vector of fitted coefficients.
fitted(): a numeric vector of fitted optical densities.
residuals(): a numeric vector of observed minus fitted values.
nobs(): an integer count of observations used for fitting.
data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) coef(fit) head(fitted(fit)) head(residuals(fit)) nobs(fit)data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) coef(fit) head(fitted(fit)) head(residuals(fit)) nobs(fit)
Detect exponential-phase windows for tidy, wide, or SummarizedExperiment
input. When data is a SummarizedExperiment, the detected windows are
stored in metadata(data)$exponential_phase_windows, and the updated object
is returned.
phase_windows( data, window_size = 4L, min_od = 0.02, average_replicates = FALSE, select_replicates = NULL, store_metadata = TRUE )phase_windows( data, window_size = 4L, min_od = 0.02, average_replicates = FALSE, select_replicates = NULL, store_metadata = TRUE )
data |
Growth data for one sample or multiple samples in tidy, wide, or
|
window_size |
Number of observations in each rolling window. |
min_od |
Minimum OD retained for log-linear fitting. |
average_replicates |
Logical; if |
select_replicates |
Optional character vector of replicate IDs to retain
before detection. When |
store_metadata |
Logical; when |
A tibble for non-SummarizedExperiment input, or an updated
SummarizedExperiment when data is a SummarizedExperiment.
data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) se <- phase_windows(se, average_replicates = TRUE) S4Vectors::metadata(se)$exponential_phase_windowsdata(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) se <- phase_windows(se, average_replicates = TRUE) S4Vectors::metadata(se)$exponential_phase_windows
Plot replicate-based doubling-time summaries as a bar chart with error bars and optional bracketed p-value annotations.
plot_doubling_time( data, comparison_col = NULL, compare_to = NULL, exclude_groups = NULL, select_replicates = NULL, average_replicates = FALSE, method = c("rolling_window", "defined_interval", "rule_based"), error = c("se", "sd"), pvalue_method = c("t_test", "wilcox"), palette_name = "all_colors", custom_colors = NULL, ... )plot_doubling_time( data, comparison_col = NULL, compare_to = NULL, exclude_groups = NULL, select_replicates = NULL, average_replicates = FALSE, method = c("rolling_window", "defined_interval", "rule_based"), error = c("se", "sd"), pvalue_method = c("t_test", "wilcox"), palette_name = "all_colors", custom_colors = NULL, ... )
data |
Growth curve data in tidy, wide, or |
comparison_col |
Column used to group replicate-level doubling times.
Typical values are |
compare_to |
Optional reference group used for p-value comparisons. |
exclude_groups |
Optional character vector of groups in |
select_replicates |
Optional character vector of replicate IDs to retain before computing doubling times. |
average_replicates |
Logical; if |
method |
Estimation method passed to |
error |
Statistic used for error bars. One of |
pvalue_method |
Statistical test used when |
palette_name |
Name of the qualitative palette used by
|
custom_colors |
Optional character vector of colours. When supplied, these user-defined colours are used instead of the selected palette. |
... |
Additional arguments passed to |
A ggplot2 object. Requires the suggested package ggplot2.
data(yeast_growth_data) plot_doubling_time( yeast_growth_data, comparison_col = "condition", compare_to = "Cg", palette_name = "Dark2" )data(yeast_growth_data) plot_doubling_time( yeast_growth_data, comparison_col = "condition", compare_to = "Cg", palette_name = "Dark2" )
Overlay observed points and fitted values from a parametric growth model.
plot_fitted_curve( fit, model = c("logistic", "gompertz"), select_replicates = NULL, average_replicates = FALSE, colour_col = "sample", facet_col = NULL, palette_name = "all_colors", custom_colors = NULL )plot_fitted_curve( fit, model = c("logistic", "gompertz"), select_replicates = NULL, average_replicates = FALSE, colour_col = "sample", facet_col = NULL, palette_name = "all_colors", custom_colors = NULL )
fit |
A GrowthFit object, or growth curve data in tidy or wide format. |
model |
Model type used when |
select_replicates |
Optional character vector of replicate IDs to retain
before fitting. When |
average_replicates |
Logical; if |
colour_col |
Name of the column mapped to colour when plotting from raw data. |
facet_col |
Optional name of a column used for faceting when plotting from raw data. |
palette_name |
Name of the qualitative palette used by
|
custom_colors |
Optional character vector of colours. When supplied, these user-defined colours are used instead of the selected palette. |
A ggplot2 object. Requires the suggested package ggplot2.
data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) plot_fitted_curve(fit)data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) plot_fitted_curve(fit)
Plot observed growth curves from growth data standardized internally to a
canonical SummarizedExperiment.
plot_growth_curve( data, average_replicates = FALSE, colour_col = "sample", facet_col = NULL, palette_name = "all_colors", custom_colors = NULL )plot_growth_curve( data, average_replicates = FALSE, colour_col = "sample", facet_col = NULL, palette_name = "all_colors", custom_colors = NULL )
data |
Growth curve data in tidy, wide, or |
average_replicates |
Logical; if |
colour_col |
Name of the column mapped to colour. |
facet_col |
Optional name of a column used for faceting. |
palette_name |
Name of the qualitative palette used by
|
custom_colors |
Optional character vector of colours. When supplied, these user-defined colours are used instead of the selected palette. |
A ggplot2 object. Requires the suggested package ggplot2.
data(yeast_growth_data) plot_growth_curve( yeast_growth_data, average_replicates = TRUE, colour_col = "condition", palette_name = "Dark2" )data(yeast_growth_data) plot_growth_curve( yeast_growth_data, average_replicates = TRUE, colour_col = "condition", palette_name = "Dark2" )
Plot observed growth curves with replicates averaged and grouped into
separate sample-family facets. For condition labels such as KN99(100) and
CM2448(50), this produces one facet for KN99, one for CM2448, and so
on, with the different conditions shown within each facet. By default, when
labels include parenthesized dose values such as (0) or (100), those
shared values are used for colour mapping across facets.
plot_growth_curve_facets( data, colour_col = NULL, palette_name = "all_colors", custom_colors = NULL )plot_growth_curve_facets( data, colour_col = NULL, palette_name = "all_colors", custom_colors = NULL )
data |
Growth curve data in tidy, wide, or |
colour_col |
Name of the column mapped to colour. When |
palette_name |
Name of the qualitative palette used by
|
custom_colors |
Optional character vector of colours. When supplied, these user-defined colours are used instead of the selected palette. |
A ggplot2 object. Requires the suggested package ggplot2.
data(yeast_growth_data) plot_growth_curve_facets( yeast_growth_data, palette_name = "Dark2" )data(yeast_growth_data) plot_growth_curve_facets( yeast_growth_data, palette_name = "Dark2" )
Access sample-level metadata from a SummarizedExperiment.
sample_data(x)sample_data(x)
x |
A |
A tibble containing colData(x).
data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) sample_data(se)data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) sample_data(se)
GrowthFit ObjectCompact one-line summary of a fitted growth model.
## S4 method for signature 'GrowthFit' show(object)## S4 method for signature 'GrowthFit' show(object)
object |
A GrowthFit object. |
object, invisibly. Called for its side effect of printing.
data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) fitdata(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) fit
Compute growth rate and doubling time per sample.
summarize_growth_metrics( data, method = c("rolling_window", "defined_interval", "rule_based"), average_replicates = FALSE, select_replicates = NULL, comparison_col = NULL, compare_to = NULL, error = c("se", "sd"), pvalue_method = c("t_test", "wilcox"), ... )summarize_growth_metrics( data, method = c("rolling_window", "defined_interval", "rule_based"), average_replicates = FALSE, select_replicates = NULL, comparison_col = NULL, compare_to = NULL, error = c("se", "sd"), pvalue_method = c("t_test", "wilcox"), ... )
data |
Growth curve data in tidy, wide, or |
method |
Estimation method passed to |
average_replicates |
Logical; if |
select_replicates |
Optional character vector of replicate IDs to retain
before summarizing. When |
comparison_col |
Optional column used to summarize replicate-level
doubling times and compute group-wise statistics. Typical values are
|
compare_to |
Optional reference group in |
error |
Statistic used for doubling-time error bars and summary output.
One of |
pvalue_method |
Statistical test used when |
... |
Additional arguments passed to |
This is the convenience wrapper for obtaining both metrics across multiple
samples in one tidy table. Internally, doubling time is derived from the
estimated growth rate using compute_doubling_time(). Inputs are
standardized internally to the canonical SummarizedExperiment
representation before summary tables are derived.
A tidy tibble with one row per sample by default. When
comparison_col is supplied, returns one row per comparison group with
replicate-level doubling-time summary statistics and optional p-values.
data(yeast_growth_data) metrics <- summarize_growth_metrics( yeast_growth_data, method = "rolling_window", average_replicates = TRUE ) head(metrics)data(yeast_growth_data) metrics <- summarize_growth_metrics( yeast_growth_data, method = "rolling_window", average_replicates = TRUE ) head(metrics)
GrowthFit ObjectTabular summary of fit status and goodness-of-fit statistics.
## S4 method for signature 'GrowthFit' summary(object, ...)## S4 method for signature 'GrowthFit' summary(object, ...)
object |
A GrowthFit object. |
... |
Unused, present for generic compatibility. |
A one-row tibble with sample, model, converged, status,
message, n_points, rss, aic, and bic.
data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) summary(fit)data(yeast_growth_data) tidy_growth <- as_tidy_growth_data(yeast_growth_data) sample_id <- unique(tidy_growth$sample)[1] fit <- fit_growth_curve(dplyr::filter(tidy_growth, sample == sample_id)) summary(fit)
Access timepoint metadata from a SummarizedExperiment.
timepoints(x)timepoints(x)
x |
A |
A tibble containing rowData(x).
data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) timepoints(se)data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) timepoints(se)
Validate tidy growth data before downstream analysis.
validate_growth_data( data, allow_negative_od = FALSE, require_increasing_time = TRUE, min_points_per_sample = 2L, warn_zero_od = FALSE, require_finite = TRUE )validate_growth_data( data, allow_negative_od = FALSE, require_increasing_time = TRUE, min_points_per_sample = 2L, warn_zero_od = FALSE, require_finite = TRUE )
data |
A data frame containing at least |
allow_negative_od |
Logical; if |
require_increasing_time |
Logical; if |
min_points_per_sample |
Minimum number of rows required within each sample. |
warn_zero_od |
Logical; if |
require_finite |
Logical; if |
The validated tibble after coercion to tibble.
data(yeast_growth_data) tidy_data <- as_tidy_growth_data(yeast_growth_data) validate_growth_data(tidy_data)data(yeast_growth_data) tidy_data <- as_tidy_growth_data(yeast_growth_data) validate_growth_data(tidy_data)
SummarizedExperiment
Check that a SummarizedExperiment follows the canonical growkar layout.
validate_growth_experiment(x, require_finite = TRUE)validate_growth_experiment(x, require_finite = TRUE)
x |
A |
require_finite |
Logical; if |
The layout itself (an od assay, a numeric rowData(x)$time of matching
length) is enforced by the GrowthExperiment validity method, which
this function calls rather than re-checking. Only the finiteness
requirement, which the class deliberately does not impose, is checked here.
The validated SummarizedExperiment.
data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) validate_growth_experiment(se)data(yeast_growth_data) se <- GrowthExperiment(yeast_growth_data) validate_growth_experiment(se)
A dataset containing the time-interval and OD600 of growing yeast cells recorded upto 24 hours.
A data frame with 49 rows and 6 variables:
Time, time-interval at which OD600 was recorded
Optical Density (OD600) of yeast cells, at each time-interval
Optical Density (OD600) of yeast cells treated with fluconazole, at each time-interval
Optical Density (OD600) of medium without cells as control, at each time-interval
...