recommend_k: function of iSpatial

View source: R/iSpatial.R

recommend_kR Documentation

function of iSpatial

Description

recommand optimized K value for KNN

Usage

recommend_k(
  spRNA,
  scRNA,
  dims = 1:30,
  k.neighbor = c(5, seq(10, 80, by = 10)),
  infered.assay = "enhanced",
  n.core = 8,
  correct.spRNA = FALSE,
  correct.scRNA = FALSE,
  correct.weight.NN = 0.2,
  correct.neighbor = 5
)

Arguments

spRNA

seurat object of spatial transcriptome data

scRNA

seurat object of single cell RNA-seq data

dims

which dimensions to use when find the nearest neighbors

k.neighbor

a list of K to test

infered.assay

names of output assay in seurat object

n.core

number of CPU cores used to parallel.

correct.spRNA

Whether to stabilize expression in spRNA.

correct.scRNA

Whether to stabilize expression in scRNA.

correct.neighbor

number of nearest neighbors used to correct expr.

weighted.KNN

we use a dynamics weight to assign scRNA values to spRNA. The dynamics weight based on the correlation between scRNA cell and spRNA cell.

RNA.weight

the weight of scRNA-seq expression when genes detected both in spRNA and scRNA. RNA.weight should be 0 to 1. The inferred expression = (1 - RNA.weight) * spRNA + RNA.weight * scRNA.

Value

returns a ggplot2 object.


Czh3/iSpatial documentation built on Sept. 15, 2022, 10:32 p.m.