Skip to content

Commit

Permalink
prepare for release, fixes laplacian issues with igraph 2.0.0, issue #18
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Church authored and Samuel Church committed Feb 1, 2024
1 parent 212391c commit 7a65044
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions countland-R/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: countland
Title: Analysis of Biological Count Data, Especially from Single-Cell RNA-Seq
Version: 0.1.1
Version: 0.1.2
Authors@R:
person("Church", "Samuel H.", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-8451-103X"))
Expand All @@ -26,7 +26,7 @@ Description: A set of functions for applying a
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
RoxygenNote: 7.3.0
URL: https://github.com/shchurch/countland
BugReports: https://github.com/shchurch/countland/issues
Imports:
Expand Down
8 changes: 8 additions & 0 deletions countland-R/NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# countland 0.1.2

* `ScikitManifoldSpectralEmbedding()`, the spectral embedding utility function, now works with behavior of `igraph` v. 2.0.0, by removing self-loops in the adjacency matrix (setting `diag = F`). In addition the function was changed from the deprecated `igraph::graph.adjacency()` to `igraph::graph_from_adjacency_matrix()` (#18).

# countland 0.1.1

* Added a `NEWS.md` file to track changes to the package.

2 changes: 1 addition & 1 deletion countland-R/R/countland_embed.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @return matrix of eigenvectors
ScikitManifoldSpectralEmbedding <- function(A,n_components){
# calculate normalized graph laplacian using igraph
Ai <- igraph::as.undirected(igraph::graph.adjacency(A,weighted=T))
Ai <- igraph::graph_from_adjacency_matrix(A,mode="undirected",weighted=T,diag=F)
L <- igraph::laplacian_matrix(Ai,normalized=T)
L <- L * -1 # flip sign to match scikit

Expand Down

0 comments on commit 7a65044

Please sign in to comment.