co_agg: 3D co-aggregation

View source: R/co_agg.R

co_aggR Documentation

3D co-aggregation

Description

Function to calculate the pairwise 3D co-aggregation between two channels

Usage

co_agg(
  imgs,
  channels,
  size,
  npixel,
  R = 10,
  dstep = 1,
  pwidth,
  zstep,
  cores = 1,
  kern.smooth = NULL,
  layers = NULL,
  naming = NULL
)

co_agg.default(
  imgs,
  channels,
  size,
  npixel,
  dstep = 1,
  pwidth,
  zstep,
  cores = 1,
  kern.smooth = NULL,
  layers = NULL,
  naming = NULL
)

Arguments

imgs

The paths of array files; i.e. output from loadIMG or findIMG functions.

channels

Character vector with names of the two channels to calculate co-aggregation for. Should be in the names of the array files

size

The maximum distance (microns) to examine. Has to be a multiple of both pwidth and zstep. Beware, increasing size will increase runtime exponetially!

npixel

Number of random pixels to examine. Increasing this will increase precision (and runtime in a linear fashion)

R

Number of times to run the co-aggregation analysis

dstep

The interval between examined distances (microns). Increasing this decreases resolution but speeds up function linearly. Defaults to 1

pwidth

Width of pixels in microns

zstep

z-step in microns

cores

The number of cores to use. Defaults to 1

kern.smooth

Optional. Numeric vector indicating range of median smoothing in the x,y,z directions. Has to be odd intergers. c(1,1,1) means no smoothing.

layers

Optional. Should the function only look in a subset of layers. A list with lists of layers to use for each image. Can also be the output from extract_layers

naming

Optional. Add metadata to the output dataframe by looking through names of array files. Should be a list of character vectors, each list element will be added as a variable. Example: naming=list(Time=c("T0","T1","T2")). The function inserts a variable called Time, and then looks through the names of the array files and inserts characters mathcing either T0, T1 or T2

Value

A dataframe with the co-aggregation values for each distance


Russel88/RCon3D documentation built on Dec. 14, 2022, 11:06 p.m.