knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

wellr

CRAN status R-CMD-check Codecov test coverage R-CMD-check

A set of tidy utilities for working with plate based data. Wet-lab experiments are often carried out in microplates of varying sizes. {wellr} aims to provide a cleaner interface to working with data from plate readers that works well within the {tidyverse} design principles.

Installation

From R-Universe:

This is the recommended way to install the package - as it requires no additional dependencies. It is currently not available on CRAN.

install.packages("wellr", repos = "bradyajohnston.r-universe.dev")

From GitHub

# install.packages("remotes")
remotes::install_github("bradyajohnston/wellr")

Basic Examples

library(wellr)

well_format("G8")
well_to_col_num("G8")
well_to_row_num("G8")
well_to_index("H1")
well_to_index("H1", colwise = TRUE)
well_from_index(37)
well_from_index(37, colwise = TRUE)
well_join(3, 8)
well_join("E", 10)

Reading Biotek

Get the file paths of the demo files.

file_data <- system.file("extdata",
  "20220929_1steptimer20.csv",
  package = "wellr"
)

file_meta <- system.file("extdata",
  "20220929_1steptimer20_metainfo.csv",
  package = "wellr"
)

Read in an example plate from a Biotek plate reader.

plate <- plate_read_biotek(file_data)
plate
plate |>
  plate_add_meta(file_meta)

Read Biotek Wavelength Data

If the biotek .csv file includes spectral readings from different wavelengths, these won't be included in the regular plate_read_biotek() function's output - as they don't have associated time information.

The plate_read_biotek_wl() function extracts these readings, and the resulting data frame includes a id column, specifying which wavelength reading they come from.

file_including_wavelength <- system.file(
  "extdata", "2024-02-29_vio_GFP_main.csv",
  package = "wellr"
)

plate_read_biotek(file_including_wavelength)

If reading in fluorescent data, there will sometimes be two wavelengths reported in the .csv. By default just the first wavelength will be used for the column names, but you can ensure that both wavelengths are included by useing second_wl = TRUE. The gfp column now includes the second wavelength that the fluorescence was measured at.

plate_read_biotek(file_including_wavelength, second_wl = TRUE)

When reading the spectral data from the file, the readings do not include time data.

The resulting data frame will however include a id column with id = 1 being the first reading, id = 2 being the second reading etc.

plate_read_biotek_wl(file_including_wavelength)

Creating Dummy Plates

Create a data frame for plate-based data.

well_plate(8, 12)

Helpful Plotting Functions

set.seed(3)
plate <- well_plate(8, 12)[, "well"]
plate$value <- rnorm(96, sd = 10)

well_plot(plate, well, value)


rforbiochemists/wellr documentation built on March 28, 2024, 4:26 a.m.