Title: | Easy MTT Assay Tidying and Plotting |
---|---|
Description: | This package automates the analysis and plotting of standard MTT workflows. |
Authors: | Kai Aragaki [aut, cre] |
Maintainer: | Kai Aragaki <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.0 |
Built: | 2025-02-02 05:42:40 UTC |
Source: | https://github.com/KaiAragaki/ezmtt |
Plot MTT data
GeomMtt geom_mtt( mapping = NULL, data = NULL, stat = "identity", position = "identity", n = 1000, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ... )
GeomMtt geom_mtt( mapping = NULL, data = NULL, stat = "identity", position = "identity", n = 1000, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ... )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
n |
How many line segments should be used to draw an MTT curve? |
na.rm |
Remove NA values? |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
Additional arguments passed to ggplot2::layer params |
An object of class GeomMtt
(inherits from Geom
, ggproto
, gg
) of length 5.
A dataset including absorbance data at 562nm and 660nm
mtt
mtt
A spectramax
object
a gp
object containing absorbance values
There are four conditions on this plate. The plate is divided into quadrants. Concentrations of drug increase from left to right (0, 1nM, 10nM, 100nM, 1uM, 10uM).
It can be useful to calculate normalized ODs without fitting, particularly if
you would like to use geom_mtt
, or need to manipulate your data downstream.
mtt_calc( data, signal = "nm562", background = "nm660", dose = "dose", out = "div", .by = NULL )
mtt_calc( data, signal = "nm562", background = "nm660", dose = "dose", out = "div", .by = NULL )
data |
A |
signal |
The name of the column that contains the signal absorbances |
background |
The name of the column that contains the background absorbances. If NULL, will just use signal. |
dose |
The name of the column containing the concentrations of the drug. Will use the lowest concentration as the baseline. |
out |
The name of the output column |
.by |
Character vector of columns to summarize by. Other columns will be dropped |
Fit an curve through MTT data
mtt_fit(x, model, ...) ## Default S3 method: mtt_fit(x, model = NULL, ...) ## S3 method for class 'gp' mtt_fit(x, model = NULL, ...) ## S3 method for class 'data.frame' mtt_fit(x, model = NULL, ...) ## S3 method for class 'spectramax' mtt_fit(x, conditions, model = NULL, ...)
mtt_fit(x, model, ...) ## Default S3 method: mtt_fit(x, model = NULL, ...) ## S3 method for class 'gp' mtt_fit(x, model = NULL, ...) ## S3 method for class 'data.frame' mtt_fit(x, model = NULL, ...) ## S3 method for class 'spectramax' mtt_fit(x, conditions, model = NULL, ...)
x |
An object of class |
model |
A character vector of models that should be used to fit the data. If NULL, will start with a 4-parameter log-logistic model and fall back using a linear model. Options for supplying a vector include NA, "lm", and "ll". See details. |
... |
Unused |
conditions |
A named list of numerics of length 4. Contains doses per quadrant. Names are the drug. If quadrant should be omitted, supply NA. Quadrants go from left to right, top to bottom. Identical names are allowed. |
If a data.frame
or gplate::gp
is supplied, it should have
columns condition
, dose
, nm562
and nm660
This function will first attempt to fit the data using a 4-parameter log-logistic model, then use a linear model as a fallback if fitting fails.
The model
argument can be used to specify a model manually by supplying a
character vector with length equal to the number of unique conditions.
Valid values for the character vector include:
NA: Fitting will start with log-logistic, fallback on linear
"ll": Only (try to) fit with log-logistic
"lm": Only fit with lm
Plot MTT fits
mtt_plot(fits, ic_pct = NULL, ...)
mtt_plot(fits, ic_pct = NULL, ...)
fits |
a list of fits, usually the output from |
ic_pct |
Numeric. If NULL, no IC will be plotted. Otherwise, will plot
|
... |
Arguments passed to |
a ggplot
A convenience function for tidying mtt data. For data that do not follow the
standard format of 'one condition per quadrant', consider tidying the data
using gplate
. See the "Using ezmtt" vignette for more information.
mtt_tidy(x, ...)
mtt_tidy(x, ...)
x |
Object to be tidied |
... |
Additional arguments passed to appropriate methods |
conditions |
A named list of length 4, where the name is the name of the condition, and the values are the doses. If a quadrant of the plate was not used, use NA. |
Plot MTT data
stat_ic_mtt( mapping = NULL, data = NULL, geom = "point", position = "identity", ..., ic = 50, show.legend = NA, inherit.aes = TRUE )
stat_ic_mtt( mapping = NULL, data = NULL, geom = "point", position = "identity", ..., ic = 50, show.legend = NA, inherit.aes = TRUE )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
geom |
The geometric object to use to display the data for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
Additional arguments passed to ggplot2::layer params |
ic |
The IC percentage that should be calculated |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |