Skip to content

Commit 75bc9f5

Browse files
cran release updated
1 parent fac84d5 commit 75bc9f5

File tree

4 files changed

+2
-63
lines changed

4 files changed

+2
-63
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
^\.circleci$
1212
^codecov\.yml$
1313
^LICENSE\.md$
14+
^CITATION.cff$
1415
^cran-comments\.md$
1516
^.*\.pdf$
1617
^.*\.png$

inst/CITATION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ citHeader("To cite the leiden package in publications use:")
22

33
citEntry(entry = "Manual",
44
title = "leiden: R implementation of the Leiden algorithm",
5-
author = personList(as.person("S. Thomas Kelly")),
5+
author = c(as.person("S. Thomas Kelly")),
66
year = "2023",
77
note = "R package version 0.4.3.1",
88
url = "https://github.com/TomKellyGenetics/leiden",

tests/testthat/test_multiplex.R

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,7 @@ skip_if_no_python <- function() {
215215
testthat::skip("leidenalg not available for testing")
216216
}
217217

218-
<<<<<<< HEAD
219-
220-
=======
221218
set.seed(9000)
222-
>>>>>>> 7d904bd98ec75ea8cc9bda7b50896458b3c26522
223219
test_that("run with CPMVertexPartition multiplexed", {
224220
skip_if_no_python()
225221
partition <- leiden(multiplex_graph,
@@ -231,19 +227,12 @@ test_that("run with CPMVertexPartition multiplexed", {
231227
expect_equal(partition,
232228
c(8, 2, 7, 5, 2, 5, 1, 2, 6, 5, 5, 2, 2, 5, 5, 5, 3, 6, 1, 2,
233229
7, 10, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 4, 2,
234-
<<<<<<< HEAD
235-
2, 2, 6, 4, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 6, 7, 6, 4, 9, 4
236-
=======
237230
2, 2, 6, 4, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 3, 7, 6, 4, 9, 4
238-
>>>>>>> 7d904bd98ec75ea8cc9bda7b50896458b3c26522
239231
))
240232
multiplex_graph
241233
})
242234

243-
<<<<<<< HEAD
244-
=======
245235
set.seed(9000)
246-
>>>>>>> 7d904bd98ec75ea8cc9bda7b50896458b3c26522
247236
test_that("run with ModularityVertexPartition multiplexed", {
248237
skip_if_no_python()
249238
partition <- leiden(multiplex_graph,
@@ -253,14 +242,6 @@ test_that("run with ModularityVertexPartition multiplexed", {
253242
seed = 9001)
254243
expect_length(partition, length(V(multiplex_graph[[1]])))
255244
expect_equal(sort(unique(partition)), 1:6)
256-
<<<<<<< HEAD
257-
expect_equal(partition,
258-
c(3, 3, 1, 4, 3, 4, 4, 3, 1, 4, 4, 3, 3, 4, 4, 4, 1, 1, 2, 3,
259-
1, 3, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 5, 5, 3, 3,
260-
3, 1, 5, 3, 1, 1, 1, 1, 1, 1, 1, 5, 5, 5, 1, 1, 1, 5, 6, 5))
261-
})
262-
263-
=======
264245
expect_equal(table(partition),
265246
structure(c(`1` = 15L, `2` = 13L, `3` = 13L, `4` = 11L, `5` = 8L,
266247
`6` = 1L), .Dim = 6L, .Dimnames = list(partition = c("1", "2",
@@ -272,7 +253,6 @@ test_that("run with ModularityVertexPartition multiplexed", {
272253
})
273254

274255
set.seed(9000)
275-
>>>>>>> 7d904bd98ec75ea8cc9bda7b50896458b3c26522
276256
test_that("run with ModularityVertexPartition multiplexed and max_comm_size", {
277257
skip_if_no_python()
278258
partition <- leiden(multiplex_graph,
@@ -284,16 +264,9 @@ test_that("run with ModularityVertexPartition multiplexed and max_comm_size", {
284264
expect_length(partition, length(V(multiplex_graph[[1]])))
285265
expect_equal(sort(unique(partition)), 1:10)
286266
expect_equal(max(table(partition)), 8)
287-
<<<<<<< HEAD
288-
expect_equal(partition,
289-
c(4, 4, 2, 3, 8, 3, 3, 4, 2, 3, 3, 8, 8, 3, 3, 3, 6, 6, 5, 8,
290-
2, 8, 6, 7, 2, 5, 5, 5, 7, 5, 7, 7, 5, 5, 7, 5, 4, 1, 1, 4, 4,
291-
4, 2, 1, 4, 6, 6, 6, 6, 9, 2, 6, 1, 1, 1, 2, 2, 7, 1, 10, 1))
292-
=======
293267
expect_equal(table(partition),
294268
structure(c(`1` = 8L, `2` = 8L, `3` = 8L, `4` = 8L, `5` = 8L,
295269
`6` = 8L, `7` = 6L, `8` = 5L, `9` = 1L, `10` = 1L), .Dim = 10L, .Dimnames = list(
296270
partition = c("1", "2", "3", "4", "5", "6", "7", "8", "9",
297271
"10")), class = "table"))
298-
>>>>>>> 7d904bd98ec75ea8cc9bda7b50896458b3c26522
299272
})

tests/testthat/test_weighted.R

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,6 @@ graph <- igraph::graph_from_adjacency_matrix(mat, weighted = NULL)
2222
test_that("run with unweighted dense matrix", {
2323
skip_if_no_python()
2424
set.seed(9000)
25-
<<<<<<< HEAD
26-
mat <- round(matrix(runif(100, max = 1), 10, 10, ), 0)
27-
mat
28-
part_mat0 <- leiden::leiden(mat, seed = 9000)
29-
expect_equal(part_mat0, c(1, 2, 2, 2, 1, 2, 2, 1, 1, 1))
30-
})
31-
32-
test_that("run with unweighted sparse matrix", {
33-
skip_if_no_python()
34-
sp.mat <- as(mat, Class = "dgCMatrix")
35-
part_sp.mat0 <- leiden::leiden(sp.mat, seed = 9000)
36-
expect_equal(part_sp.mat0, c(1, 2, 2, 2, 1, 2, 2, 1, 1, 1))
37-
})
38-
39-
40-
test_that("run with unweighted graph object", {
41-
skip_if_no_python()
42-
=======
4325
mat <- round(matrix(runif(100, max = 1), 10, 10), 0)
4426
mat
4527
part_mat0 <- leiden::leiden(mat, seed = 9000, resolution_parameter = 0.8)
@@ -65,26 +47,10 @@ set.seed(9000)
6547
test_that("run with unweighted graph object", {
6648
skip_if_no_python()
6749
set.seed(9000)
68-
>>>>>>> 7d904bd98ec75ea8cc9bda7b50896458b3c26522
6950
graph <- igraph::graph_from_adjacency_matrix(mat, weighted = NULL)
7051
graph
7152
part_graph0 <- leiden::leiden(graph, seed = 9000)
7253
part_graph0
73-
<<<<<<< HEAD
74-
expect_equal(part_graph0, c(1, 2, 2, 2, 1, 2, 2, 1, 1, 1))
75-
})
76-
77-
test_that("same output with different input class", {
78-
skip_if_no_python()
79-
part_mat0 <- leiden::leiden(mat, seed = 9000)
80-
part_graph0 <- leiden::leiden(graph, seed = 9000)
81-
expect_equivalent(part_mat0, c(1, 2, 2, 2, 1, 2, 2, 1, 1, 1))
82-
expect_equivalent(part_graph0, c(1, 2, 2, 2, 1, 2, 2, 1, 1, 1))
83-
expect_equivalent(part_mat0, part_graph0)
84-
expect_equal(sum(diag(table(part_mat0, part_graph0))), length(part_mat0))
85-
expect_equal(sum(diag(table(part_mat0, part_graph0))), nrow(mat))
86-
expect_equal(sum(diag(table(part_mat0, part_graph0))), length(V(graph)))
87-
=======
8854
expect_equal(table(part_graph0), structure(c(`1` = 5L, `2` = 5L), .Dim = 2L, .Dimnames = list(
8955
part_graph0 = c("1", "2")), class = "table"))
9056
expect_length(object = unique(part_graph0[which(c(1, 2, 2, 2, 1, 2, 2, 1, 1, 1) == 1)]), n = 1)
@@ -104,7 +70,6 @@ test_that("same output with different input class", {
10470
expect_length(object = unique(part_graph0[which(c(1, 2, 2, 2, 1, 2, 2, 1, 1, 1) == 1)]), n = 1)
10571
expect_length(object = unique(part_graph0[which(c(1, 2, 2, 2, 1, 2, 2, 1, 1, 1) == 2)]), n = 1)
10672
expect_true(all(part_mat0 + part_graph0 == 3) || all(part_mat0 == part_graph0))
107-
>>>>>>> 7d904bd98ec75ea8cc9bda7b50896458b3c26522
10873
})
10974

11075
# # Test Seurat (development version)

0 commit comments

Comments
 (0)