get_neighs_all_stat: get_neighs.all_stat

View source: R/get_neighborhood_preservation_scores.R

get_neighs_all_statR Documentation

get_neighs.all_stat

Description

Calculates intermediate stats relevant for cell neighborhoud preservation score that can be recycled for different selection.

Usage

get_neighs_all_stat(
  sce,
  genes.all = rownames(sce),
  batch = NULL,
  n.neigh = 5,
  nPC.all = 50,
  option = "exact",
  ...
)

Arguments

sce

SingleCellExperiment object containing gene counts matrix.

genes.all

String specifying genes to be used for construction of True kNN-graph.

batch

Name of the field in colData(sce) to specify batch. Default batch=NULL if no batch is applied.

n.neigh

Positive integer > 1, specifying number of neighbors to use for kNN-graph. Default n.neigh=5.

nPC.all

Scalar specifying number of PCs to use for construction of True kNN-graph. Default nPC.all=50.

option

String specifying how average distance for each cell should be calculated. If = 'exact', all other cells are taken into account. If = 'approx', the random subset of 10000 cells will be used. 'exact' is default and 'approx' is recommended for big datasets.

...

Additional arguments.

Value

List containing fields 'counts' - PC coordinates for cells in True graph; 'neighs.all' - kNN-graph with assigned neighbors in True graph; 'mean_dist' - vector (for each cell) containing mean distance to other cells.


MarioniLab/geneBasisR documentation built on June 30, 2023, 2:04 p.m.