find_most_active: Find most active brain areas

Description Usage Arguments Examples

View source: R/find_most_active.R

Description

Wrapper around dplyr functions to find most active brain areas by looking at the frequency of the top 5 per cent (or other probability specified by the user) of the var distribution. The function returns a dataframe with a summary per group of which brain areas were in the top distribution in how many batches.

Usage

1
find_most_active(region_df, high_prob = 0.95)

Arguments

region_df

region_based dataframe. Each row is a brain area ("my_grouping") per sample ("sample_id"), where corrected cell count ("cells_perthousand") has been summarized. It contains a variable "batch" that identifies the unit where to perform the calculation. If from a block design, "batch" identifies a unique set control and experimental groups (var "group"), with 1 sample each. It can be output from summarize_per_region() or preprocess_per_region().

high_prob

number between 0 and 1 indication the threshold for being a highly active region. 0.95 corresponds to the top 5 per cent.

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_ave = sample(10000, 20, replace = TRUE),
cells_perthousand = abs(rnorm(20))
)

find_most_active(x)

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