construct_metadata: Constructs metadata list to be used in functions

Description Usage Arguments Value Examples

Description

Creates a list containing all necessary metadata to subset a dataframe. Used within other functions as a useful container and stops repeated input of dataframe information.

Usage

1
construct_metadata(df, compound_col, conc_col, feature_cols, negative_control)

Arguments

df

Dataframe

compound_col

index or name of dataframe column for compound names

conc_col

index or name of dataframe column for concentration data

feature_cols

Vector of indices that match numeric feature columns. a feature column is one that contains numerical information of a cellular measurement such as area, or cell_count. Metadata such as image_number or object_number_ID is not feature data.

negative_control

string, name of negative control in compound_col. e.g 'DMSO'

Value

metadata List containing all metadata.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# construct example dataframe
concentration <- rep(c(100, 10, 1, 0.1), 10)
compounds <- sort(rep(letters[1:10], 4))
cell_area <- rnorm(40)
no_speckles <- rnorm(40, 100, 100)
df <- data.frame(compounds, concentration, cell_area, no_speckles)

construct_metadata(
    df,
    compound_col = "compounds",
    conc_col = "concentration",
    feature_cols = 3:4,
    negative_control = "a")

Swarchal/TISS documentation built on May 9, 2019, 3:24 p.m.