Skip to content

Commit

Permalink
Expression adjacency Update
Browse files Browse the repository at this point in the history
  • Loading branch information
reyvnth committed Sep 15, 2023
1 parent ced7e17 commit c1ae137
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/expression_adjacency_matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
#'
#'@import loe
#'Matrix
expression_adjacency_matrix <- function(obj, nk = 200, symm = FALSE, weight = TRUE, mode = "undirected", weighted = TRUE) {
expression_adjacency_matrix <- function(obj, nk = 200, symm = FALSE, weight = TRUE, mode = "undirected", weighted = FALSE) {
# Calculate the Euclidean distance between each pair of cells using the gene expression matrix
mat <- t(obj$count_exp)
distance <- dist(mat, method = "euclidean")
distance <- as.matrix(distance)

# Make a K-NN graph based on the Euclidean distance
knn_matrix <- make.kNNG(distance, k = nk, symm = symm, weight = FALSE)
knn_matrix <- make.kNNG(distance, k = nk, symm = symm, weight = TRUE)

# Convert K-NN neighbor relation matrix to adjacency matrix
n <- dim(knn_matrix)[1]
Expand Down
2 changes: 1 addition & 1 deletion man/expression_adjacency_matrix.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c1ae137

Please sign in to comment.