Movatterモバイル変換


[0]ホーム

URL:


Title:Read, Tidy, and Display Data from Microtiter Plates
Version:1.0.5
Description:Tools for interacting with data from experiments done in microtiter plates. Easily read in plate-shaped data and convert it to tidy format, combine plate-shaped data with tidy data, and view tidy data in plate shape.
Depends:R (≥ 3.1.0)
Imports:utils, dplyr (> 0.4.3), rlang
Suggests:testthat, knitr, rmarkdown
License:GPL-3
URL:https://docs.ropensci.org/plater/,https://github.com/ropensci/plater
BugReports:https://github.com/ropensci/plater/issues
VignetteBuilder:knitr
RoxygenNote:7.3.2
Encoding:UTF-8
NeedsCompilation:no
Packaged:2024-10-25 18:59:18 UTC; smhughes
Author:Sean HughesORCID iD [aut, cre]
Maintainer:Sean Hughes <smhughes@uw.edu>
Repository:CRAN
Date/Publication:2024-10-25 20:10:01 UTC

plater: Read, Tidy, and Display Data from Microtiter Plates

Description

Tools for interacting with data from experiments done in microtiter plates. Easily read in plate-shaped data and convert it to tidy format, combine plate-shaped data with tidy data, and view tidy data in plate shape.

plater defines a simple, plate-shaped file format for data storage, so it's easy to remember the experimental design. The package provides functions to seamlessly convert between that format and a tidy data frame that's optimal for analysis.check_plater_format is provided to help you manage plate-shaped files.

You can work with purely plate-shaped data (read_plate andread_plates), as well as with a combination of plate-shaped data and tidy data (add_plate). It furtherallows easy plate-shaped visualization of tidy data (view_plate).

Author(s)

Maintainer: Sean Hughessmhughes@uw.edu (ORCID)

See Also

Useful links:

Useful links:


Read a plater-formatted file and combine it with an existing data frame.

Description

Converts data fromplater format to a data frame with one well per row and merges it into an existing data frame by well name.

Usage

add_plate(data, file, well_ids_column, sep = ",")

Arguments

data

The data frame to merge the file into. Must contain a column withwell names.

file

The path of a .csv file formatted as described inread_plate.

well_ids_column

The name of the column indata containing the well IDs.

sep

The character used to separate columns in the file (e.g. "," or ";") Defaults to ",".

Details

If data contains more wells than infile, NA will be added to the merged column(s) for those wells. If the file contains more wells thandata, those wells will be added to the bottom of the result with NAfor the columns indata.

Value

Returns data as a tibble with as many new columns as plates infile. Empty wells are indicated with NA.

Examples

# Part of the data is tidyfile <- system.file("extdata", "example-2-part-A.csv", package = "plater")data <- read.csv(file)# Part of the data is plate-shapedplate_shaped <- system.file("extdata", "example-2-part-B.csv", package = "plater")# Combine the twodata <- add_plate(   data = data,    file = plate_shaped,   well_ids_column = "Wells")# Now data are tidyhead(data)

Check whether a file is in plater format.

Description

Runs the provided file through a number of diagnostics to determine whetherit is a valid plater format file and displays information about any deficiencies found.

Usage

check_plater_format(file, sep = ",")

Arguments

file

The path of the file to check.

sep

The character used to separate columns in the file (e.g. "," or ";"). Defaults to ",".

Value

Displays a number of messages as it checks the file. Will stop witha descriptive error message if the file is not formatted correctly.

Examples

file_path <- system.file("extdata", "example-1.csv", package = "plater")data <- check_plater_format(file_path)

Read a plater-formatted file and turn it into a tidy data frame.

Description

Converts data fromplater format to a data frame with one well per row identified by well name.

Usage

read_plate(file, well_ids_column = "Wells", sep = ",")

Arguments

file

The path of a .csv file formatted as described below.

well_ids_column

The name to give the column that will contain the wellidentifiers. Default "Wells".

sep

The character used to separate columns in the file (e.g. "," or ";"). Defaults to ",".

Value

Returns a data frame with each well as a row. One column will be named withwell_ids_column and contain the well names (A01, A02..). There will be as many additional columns as layouts infile. Empty wells are omitted.

plater format

The .csv file should be formatted as a microtiter plate. The top-left most cell contains the name to use for the column representing that plate. For example, for a 96-well plate, the subsequent wells in the top row should be labeled 1-12. The subsequent cells in the first column should be labeled A-H. That is:

ColName123...
A A01 A02 A03 ...
B B01 B02 B03 ...
... ... ... ... ...

In this example, the cells within the plate contain the well IDs ("A01", "A02"), but they may contain arbitrary characters: numbers, letters, or punctuation. Any cell may also be blank.

Note that Microsoft Excel will sometimes include cells that appear to be blank in the .csv files it produces, so the files may have spurious columnsor rows outside of the plate, causing errors. To solve this problem, copy andpaste just the cells within the plate to a fresh worksheet and save it.

Multiple columns

Multiple columns of information about a plate can be included in a single file. After the first plate, leave one row blank, and then add another plateformatted as described above. (The "blank" row should appear as blank in a spreadsheet editor, but as a row of commas when viewed as plain text.) As many plates as necessary can be included in a single file (e.g. data measured, subject, treatment, replicate, etc.).

Examples

file_path <- system.file("extdata", "example-1.csv", package = "plater")# Data are stored in plate-shaped formdata <- read_plate(   file = file_path,   well_ids_column = "Wells")# Now data are tidyhead(data)

Read multiple plater-formatted files and combine result into one data frame.

Description

A wrapper aroundread_plate that handles multiple plates and combinesthem all into a single data frame.

Usage

read_plates(files, plate_names = NULL, well_ids_column = "Wells", sep = ",")

Arguments

files

A character vector with the paths of one or more plater-formatted.csv files.

plate_names

A character vector the same length asfiles with thenames to give the individual plates in the resulting data frame. Defaults tothe file names (stripped of path and .csv).

well_ids_column

The name to give the column that will contain the wellidentifiers. Default "Wells".

sep

The character used to separate columns in the file (e.g. "," or ";"). Defaults to ",".

Value

Returns a data frame like that returned byread_plate, containing the data from all of the plates. The plates will be identified with a column called "Plate" containing the names given inplate_names.

Examples

# Combine multiple files into one tidy data framefile1 <- system.file("extdata", "example-1.csv", package = "plater")file2 <- system.file("extdata", "more-bacteria.csv", package = "plater")# Data are stored in plate-shaped formdata <- read_plates(   files = c(file1, file2),   plate_names = c("Experiment 1", "Experiment 2"),   well_ids_column = "Wells")# Data from both plates are tidy and in the same data framehead(data)

Displays the data in the form of a microtiter plate.

Description

Displays the data in the form of a microtiter plate.

Usage

view_plate(data, well_ids_column, columns_to_display, plate_size = 96)

Arguments

data

A data frame containing the data

well_ids_column

The name of the column indata containing the well IDs.

columns_to_display

A vector of the names of one or more columns you'dlike to display.

plate_size

The number of wells in the plate. Must be 6, 12, 24, 48, 96384, or 1536. Default 96.

Value

A depiction of the data incolumns_to_display as though laid out on a microtiter plate withplate_size wells.

Examples

# Generate some tidy datadata <- data.frame(Wells = paste0(LETTERS[1:3], 0, rep(1:4, each = 3)), Species = rep(c("Alien", "Human", "Cat"), 4), OxygenProduction = round(rnorm(12), 3))head(data)# See which wells had cells from which species and the amount of oxygen # produced for each wellview_plate(data, "Wells", c("Species", "OxygenProduction"), 12)

[8]ページ先頭

©2009-2025 Movatter.jp