load_cell_data: Load cellID data

View source: R/load_cell_data.R

load_cell_dataR Documentation

Load cellID data

Description

load_cell_data searches a specified directory (the working directory by default) for folders that match a customizable pattern, usually PositionXXX where XXX is the position number. This folders should contain the Cell-ID output files output_all and the output_bf_fl_mapping for each position. The function loads this files and generates a data structure suitable for filtering and plotting. The function returns a cell.data object that contains all the required information for the analysis. All the functions included in the package operate over this object, and its components should not be modified directly, but through the provided functions. Remember to assign the returned value to a variable (e.g. cell_data <- load_cell_data() )

Usage

load_cell_data(
  path = getwd(),
  pattern = ".*Position(\\d+)$",
  basename = "out",
  select = NULL,
  exclude = NULL,
  load.vars = "all",
  split.image = FALSE,
  ...
)

Arguments

path

string, path to folder containing PositionXXX folders.

pattern

string, Regex specifying 'PositionXXX' name format.

basename

string, cellID output extension.

select

character vector, defines which variables to include in the cell.data object

exclude

character vector, defines which variables to exclude in the cell.data object.

load.vars

string, character specifying which variables or group of variables of the Cell-ID out_all file should be loaded.

split.image

boolean, indicates if the images are split and upper cells should be matched to lower cells. Set to TRUE if analyzing a FRET split image experiment.

...

Arguments passed on to load_cell_data_checkid

cdata

The "data" item of the list produced by load_cell_data or get_cell_data.

id_cols

Character vector with the column names of cdata that must identify rows uniquely. Defaults to the usual ucid-t.frame combination.

Details

Reads Cell ID output files (basename)_all in folders that match pattern in path and loads them into a cell.data object.

This function is no longer maintained, and will be deprecated in favor of get_cell_data provided by the rcell2.cellid package. Consider switching from load_cell_data to the newer function.

It searches for the output_all files in folders of the form specified by pattern (regular expression). If the folder has a numeric value in its name that number is taken as the position index (for example pos01 is given the index 1) If no numeric value is found in the folder name, then a ordinal index is assign.

Possible values for load.vars are 'all', 'fl' or 'fluorescence', 'bg' or 'background', 'calc', 'morph' or 'morphological', 'vac' or 'vacuole', 'nucl' or 'nuclear', 'disc'. The group of variables can be specified in either a positive form (i.e. '+fl+bg+morph') or in a negative form (i.e. '-nucl-vac'). Combination of positive and negative form is not allowed. A character vector containing the variables names of the out_all file is also allowed. The selection of variables is done before restructuring, so the variable names should correspond to those of the out_all files. Using this argument can be useful if memory issues arise.

Alternatively select and exclude can be used to subset the dataset. This arguments are applied after the reshaping, so variables names as returned by summary.cell.data are used. Wildcard patterns (e.g. 'f.*.y') and keywords (e.g. 'all', 'id.vars', 'YFP', etc.) can be used as components of these arguments.

Value

a cell.data object


darksideoftheshmoo/rcell2 documentation built on Oct. 23, 2024, 12:59 p.m.