get_sigcell_simple: get_sigcell_simple

View source: R/get_sigcell_simple.R

get_sigcell_simpleR Documentation

get_sigcell_simple

Description

a function to determine statistically trait-enriched cell by permutation test

Usage

get_sigcell_simple(
  knn_sparse_mat = mutualknn30,
  seed_idx = seed_p0.05,
  topseed_npscore = topseed_npscore,
  permutation_times = 1000,
  true_cell_significance = 0.05,
  rda_output = F,
  out_rda = "true_cell_df.rda",
  mycores = 4,
  rw_gamma = 0.05
)

Arguments

knn_sparse_mat

a sparse matrix used for network propagation, which indicates the adjacent matrix (m x m, where m is the cell number) of cell-to-cell network (M-kNN graph)

seed_idx

a logical vector indicating seed cells (TRUE) and non-seed cells (FALSE) with length of m, where m is the cell number. The length and position are corresponding to knn_sparse_mat

topseed_npscore

a numeric vector of real network propagation score

permutation_times

an integer describe times of permutation test for each cell

true_cell_significance

a numeric value between 0-1 indicating the significant threshold used to determine statistically trait-enriched cell

rda_output

if output details of each permutation as a rda

out_rda

if rda_output=T, an rda will be outputed with path and name specified

mycores

how many cores used for permutation test

rw_gamma

gamma from randomWalk_sparse function. Keep the same with what you used in the real setting

Value

a dataframe with two columns, the first one is seed index (the same with input), the second one is significance from permutation test. In addition, an R data is generated, which contains this dataframe and another dataframe depicting the network propagation score for each cell at each permuation

Examples

## Not run: 
get_sigcell_simple(knn_sparse_mat=mutualknn30,
seed_idx=seed_p0.05,
permutation_times=1000,
true_cell_significance=0.05,
rda_output=F,
out_rda="true_cell_df.rda",
 mycores=4, rw_gamma=0.05)
## End(Not run)


fl-yu/SCAVENGE documentation built on April 2, 2022, 10:56 a.m.