diff --git a/DESCRIPTION b/DESCRIPTION index a36d60f..1934814 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: monocle3 Title: Clustering, Differential Expression, and Trajectory Analysis for Single-Cell RNA-Seq -Version: 1.4.13 +Version: 1.4.14 Authors@R: c( person(given = "Hannah", family = "Pliner", diff --git a/R/cluster_cells.R b/R/cluster_cells.R index 69455dd..232115f 100644 --- a/R/cluster_cells.R +++ b/R/cluster_cells.R @@ -599,6 +599,8 @@ compute_partitions <- function(g, optim_res, qval_thresh=0.05, verbose = FALSE){ + # The cells membership may have information about the + # clusters to which cells' nearest neighbors belong. cell_membership <- as.factor(igraph::membership(optim_res)) membership_matrix <- Matrix::sparse.model.matrix( ~ cell_membership + 0) num_links <- Matrix::t(membership_matrix) %*% @@ -617,6 +619,9 @@ compute_partitions <- function(g, num_links <- num_links_ij / total_edges + # Deal with zero total edges. + num_links[is.nan(num_links)] <- 0 + cluster_mat <- matrix(stats::p.adjust(cluster_mat), nrow=length(louvain_modules), ncol=length(louvain_modules))