preprocess_per_region: Normalize and scale for region-based analyses

Description Usage Arguments Examples

View source: R/summarize_to_region.R

Description

Wrapper around dplyr functions to normalize and standardize the count and intensity variables. It expects the output of summarize_per_region.

Usage

1

Arguments

region_df

region_based dataframe. Each row is a brain area ("my_grouping") per sample ("sample_id"), where corrected cell count ("cells_perthousand") and average maximum intensity of the protein of interest ("intensity") have been summarized. It can be output from summarize_per_region(). The data will be normalized according to "batch", and it will be scaled per unit ("cells_perthousand_box_scaled", "intensity_box_scaled"), as well as per brain area per unit ("cells_perthousand_box_scaled_ba", "intensity_box_scaled_ba")

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x <- data.frame(
batch = rep(c(1,1,2,2), each = 5),
group = rep(c("control", "exp", "exp", "control"), each = 5),
sample_id = rep(c("a", "b", "c", "d"), each = 5),
my_grouping = rep(c("CA1", "CA2", "CA3", "DG", "BLA"), 4),
intensity = sample(10000, 20, replace = TRUE),
cells_perthousand = abs(rnorm(20))
)

preprocess_per_region(x)

valeriabonapersona/abc4d documentation built on Dec. 23, 2021, 2:09 p.m.