kdist | R Documentation |
Calculated K-distance between query cells and reference cells based on their spatial coordinates
kdist( inp_df, ref = NULL, ref_type = "all", que = NULL, k = 10, new_name = "kdist", keep_nn = F )
inp_df |
inp_df must contain cell_names, 'coord_x', 'coord_y' columns |
ref |
Reference groups |
ref_type |
'all' or 'each' |
que |
Query groups |
k |
The number of nearest neighbors |
new_name |
New name for kdist |
keep_nn |
Keep Nearest Neighboor id matrix? |
A list of 1. kdist data frame and 2. a list of knn id matrix
kdist_out <- kdist(inp_df=test_df, ref=c('A', 'B', 'C'), ref_type='each', que=unique(test_df$cell_names), k=10, keep_nn=T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.