bullseye_scores: Calculates bullseye statistics for ALL gene pairs. Counts the...

View source: R/CrossExpression.R

bullseye_scoresR Documentation

Calculates bullseye statistics for ALL gene pairs. Counts the number of cells with gene B in those with gene A And in their neighbors Neighbor scores are cumulative and normalized by window size.

Description

Calculates bullseye statistics for ALL gene pairs. Counts the number of cells with gene B in those with gene A And in their neighbors Neighbor scores are cumulative and normalized by window size.

Usage

bullseye_scores(
  data,
  locations,
  window_sizes = 1:5,
  ratio_to_co = FALSE,
  log_2 = FALSE,
  output_matrix = FALSE
)

Arguments

data

A cells by genes expression matrix.

locations

A cells by coordinates (x-y or higher dimensions) matrix.

window_sizes

Vector of window sizes.

ratio_to_co

If TRUE, results are normalized by co-expressing cells.

log_2

If TRUE, results are transformed by log2.

output_matrix

If TRUE, results are provided in matrix form.

Value

Returns a dataframe with each row representing a gene pair and each column representing the bullseye score for that pair in each window size. output_matrix = TRUE presents a matrix for each window size.

Examples

data("locations")
data("expression")
locations  = as.matrix(locations)
expression = as.matrix(expression)
expression = expression[,1:5]
results    = bullseye_scores(data = expression, locations = locations)


CrossExpression documentation built on Aug. 8, 2025, 7:25 p.m.