import_blockdesigns {gcplyr}R Documentation

Import blockdesigns

Description

Function to import block-shaped designs from files and return tidy designs. This function acts as a wrapper that calls read_blocks, paste_blocks, trans_block_to_wide, trans_wide_to_tidy, and separate_tidys

Usage

import_blockdesigns(
  files,
  block_names = NULL,
  block_name_header = "block_name",
  join_designs = TRUE,
  sep = NULL,
  values_colname = "Designs",
  keep_blocknames = !join_designs,
  ...
)

Arguments

files

A vector of filepaths relative to the current working directory where each filepath is a single plate read to be read by read_blocks.

block_names

Vector of names corresponding to each design element (each block). Inferred from filenames, if not specified.

When keep_blocknames = TRUE, a column with the column name specified by block_name_header will contain these names.

When join_designs = TRUE, the block_names are also used as the output column names for each separated design column.

block_name_header

When keep_blocknames = TRUE, the column name of the column containing the block_names.

join_designs

logical indicating whether blocks (if there are multiple) should be treated as describing the same plate (and so joined as columns in the tidy output). If FALSE, will be treated as describing different plates (and so joined as rows in the tidy output).

sep

If designs have been pasted together, this specifies the string they should be split apart by via separate_tidy.

values_colname

When join_designs = FALSE, the column name of the column that will contain all the design values.

keep_blocknames

logical indicating whether the column containing block_names (or those inferred from file names) should be retained in the output. By default, blocknames are retained only if join_designs = FALSE.

...

Other arguments to pass to read_blocks, paste_blocks, trans_block_to_wide, trans_wide_to_tidy, or separate_tidy.

See Details for more information

Details

Common arguments that you may want to provide via ... include:

startrow, endrow, startcol, endcol, sheet - specifying the location of design information inside files to read_blocks.

wellnames_sep - specifying what character (or "" for none) should be used when pasting together the rownames and column names. Note that this should be chosen to match the well names in your measures.

Note that import_blockdesigns cannot currently handle metadata specified via the metadata argument of read_blocks.

If you find yourself needing more control, you can run the steps manually, first reading with read_blocks, pasting as needed with paste_blocks, transforming to tidy with trans_block_to_wide and trans_wide_to_tidy, and separating as needed with separate_tidys.

Value

A tidy-shaped data.frame containing the design information from files. This always includes a "Well" column.

If keep_blocknames = TRUE, this includes a column with the column name specified by block_name_header and containing block_names (or those inferred from file names).

If join_designs = TRUE, each block has been joined as a column, with the columns named according to block_names (or inferred from file names) and containing the contents of each corresponding block. If join_designs = FALSE, each block has been joined as rows, with a single column with the name specified by values_colnames containing the contents of all the blocks.


[Package gcplyr version 1.9.0 Index]