Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Karin Schork committed Mar 25, 2024
1 parent f592a8a commit b1c014f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions R/helpers-isomorphisms.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ isomorphic_bipartite <- function(graph1, graph2, ...) {
#iso <- igraph::isomorphic(graph1, graph2)

## direct graphs if they are not directed yet
if (!is.directed(graph1)) graph1 <- bppg::direct_bipartite_graph(graph1)
if (!is.directed(graph2)) graph2 <- bppg::direct_bipartite_graph(graph2)
if (!igraph::is_directed(graph1)) graph1 <- bppg::direct_bipartite_graph(graph1)
if (!igraph::is_directed(graph2)) graph2 <- bppg::direct_bipartite_graph(graph2)
#graph2 <- bppg::direct_bipartite_graph(graph2)


Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test_isomorphism.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ test_that("isomorphic_bipartite works as intended", {

# N shape graph
M <- matrix(c(1,1,0,1), nrow = 2, byrow = TRUE)
G <- igraph::graph_from_incidence_matrix(M)
G <- igraph::graph_from_biadjacency_matrix(M)

# W shape graph
M2 <- matrix(c(1,1,0,0,1,1), nrow = 2, byrow = TRUE)
G2 <- igraph::graph_from_incidence_matrix(M2)
G2 <- igraph::graph_from_biadjacency_matrix(M2)

# M shape graph
G3 <- G2
Expand All @@ -22,7 +22,7 @@ test_that("isomorphic_bipartite works as intended", {

# M + 1 graph
M4 <- matrix(c(1,1,0,0, 1, 0,0,1,1), nrow = 3, byrow = TRUE)
G4 <- igraph::graph_from_incidence_matrix(M4)
G4 <- igraph::graph_from_biadjacency_matrix(M4)

G5 <- G4
igraph::V(G5)$type <- !igraph::V(G4)$type
Expand All @@ -38,11 +38,11 @@ test_that("generation of a prototype list", {

# N shape graph
M <- matrix(c(1,1,0,1), nrow = 2, byrow = TRUE)
G <- igraph::graph_from_incidence_matrix(M)
G <- igraph::graph_from_biadjacency_matrix(M)

# W shape graph
M2 <- matrix(c(1,1,0,0,1,1), nrow = 2, byrow = TRUE)
G2 <- igraph::graph_from_incidence_matrix(M2)
G2 <- igraph::graph_from_biadjacency_matrix(M2)

# M shape graph
G3 <- G2
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/tests-attributes.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_that("test add_uniqueness_attributes", {

# W shaped graph
M <- matrix(c(1,1,0,0,1,1), nrow = 2, byrow = TRUE)
G <- igraph::graph_from_incidence_matrix(M)
G <- igraph::graph_from_biadjacency_matrix(M)
G_new <- bppg::add_uniqueness_attributes(G)

expect_equal(igraph::V(G_new)$nr_unique_peptides, c(NA, NA, 0, 0, 0))
Expand Down

0 comments on commit b1c014f

Please sign in to comment.