Skip to contents

Used when an informal analysis with sample groupings is specified to pairwiseAdjacency. Aggregates counts of each type of interaction across all Regions in a sample. Can also permute the cell type labels as needed for the "permutation" method of pairwiseAdjacency.

Usage

.aggregated_interaction_counts(
  cm,
  match_feature,
  feature_char,
  all_nns,
  nn,
  drop.self,
  permute_labels = FALSE
)

Arguments

cm

An object's cellMetadata

match_feature

A column in cm

feature_char

as.character(cm[match_feature]) passed in from pairwiseAdjacency

all_nns

A list of all the NN objects associated with a grouped analysis

nn

The name of a nearestNeighborGraph from object (character).

drop.self

If TRUE, ensures that the index cell is not counted as its own interaction, even if such self-interactions are present in the network-graph (NN object). This is recommended to be TRUE in almost all cases.

permute_labels

Whether to sample cell type labels before counting pairwise adjacencies.

Value

A table in the same format returned by count_pairwise_interactions

Scroll to top