Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version v3.1.2 #114

Merged
merged 14 commits into from
Apr 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# codeface-extraction-r - Changelog
# codeface-extraction-r – Changelog


## 3.1.2

### Changed/Improved
- Vertex and edge types (attribute `"type"`) are now a character string (e.g., "Author" or "Unipartite") (#110, 3ca6ed99cf377200adb94a4b27ed1ea7d3a6981a)
- Default plotting layout is now `igraph::layout.kamada.kawai` (#109, 909965453c47c26c902612cb0c9aa16a5b56746a)
- Remove parameter 'color.attr' from 'motifs.search.in.network' (d33f6863aaf05ae1a8acf7f5667784713796b734)
- Fix and clean-up of both the plotting and the motif modules (3ca6ed99cf377200adb94a4b27ed1ea7d3a6981a, consequence of #110)
- Use vectors as vertex attributes instead of lists if there is only one value per vertex (#112, abc0dcbe2aa4ae6ff1c8387c3e961b95e57b2af2)
- Add a notice that the function `get.date.from.string` does ignore time-zone suffixes (9a51877f32a51850259b323c975182f2155b5302)

### Fixed
- Probably fixed segfaults during plotting by changing the default layout (see above and issue #109)
- Fix gray-scale plotting of networks (730cc544edbb30ea3aa89a91e123e74b18a942c6)


## 3.1.1
Expand Down
6 changes: 3 additions & 3 deletions showcase.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
## with this program; if not, write to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
##
## Copyright 2016-2017 by Claus Hunsen <[email protected]>
## Copyright 2016-2018 by Claus Hunsen <[email protected]>
## Copyright 2017 by Raphael Nömmer <[email protected]>
## Copyright 2017 by Christian Hechtl <[email protected]>
## Copyright 2017 by Felix Prasse <[email protected]>
Expand Down Expand Up @@ -302,8 +302,8 @@ y = NetworkBuilder$new(project.data = y.data, network.conf = net.conf)
# plot.print.network(g, labels = TRUE, grayscale = FALSE)

# ## set a layout and print directly
# lay = matrix(c( 20, 179, 552, 693, 956, 1091, 124, 317, 516, 615, 803, 1038,
# 245, 175, 185, 255, 253, 225, 73, 8, 75, 0, 96, 86),
# lay = matrix(c( 20, 179, 693, 552, 956, 1091, 124, 317, 516, 615, 803, 1038,
# 245, 175, 255, 185, 253, 225, 73, 8, 75, 0, 96, 86),
# nrow = 12, byrow = FALSE) # for sample graph
# g = igraph::set.graph.attribute(g, "layout", lay)
# plot.print.network(g, labels = TRUE, grayscale = FALSE)
Expand Down
5 changes: 5 additions & 0 deletions tests/test-misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ test_that("Parse date from a string.", {
date.posixct = as.POSIXct(strptime(date.string, format = "%Y-%m-%d"))
expect_equal(get.date.from.string(date.string), date.posixct, info = "Partial date (no time).")

## date string with time zone (which will be ignored as we treat it like UTC anyway)
date.string = "2018-02-22 10:02:03 CET"
date.posixct = as.POSIXct(strptime("2018-02-22 10:02:03", tz = "UTC", format = "%Y-%m-%d %H:%M:%S"))
expect_equal(get.date.from.string(date.string), date.posixct, info = "Date with (ignored) time-zone")

})

##
Expand Down
20 changes: 10 additions & 10 deletions tests/test-motifs.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,29 @@ test_that("Motifs are found in sample network (remove.duplicates = TRUE).", {
igraph::V(network)[ c("D3", "D4") ],
igraph::V(network)[ c("D4", "D5") ]
)
matchings = motifs.search.in.network(network, MOTIFS.LINE, color.attr = "type", remove.duplicates = TRUE)
matchings = motifs.search.in.network(network, MOTIFS.LINE, remove.duplicates = TRUE)
expect_equal(matchings, expected, info = "Line motif")

## Triangle motif (positive)
expected = list(
igraph::V(network)[ c("D1", "D2", "A1") ]
)
matchings = motifs.search.in.network(network, MOTIFS.TRIANGLE.POSITIVE, color.attr = "type", remove.duplicates = TRUE)
matchings = motifs.search.in.network(network, MOTIFS.TRIANGLE.POSITIVE, remove.duplicates = TRUE)
expect_equal(matchings, expected, info = "Triangle motif (positive)")

## Triangle motif (negative)
expected = list(
igraph::V(network)[ c("D1", "D2", "A1") ],
igraph::V(network)[ c("D5", "D6", "A6") ]
)
matchings = motifs.search.in.network(network, MOTIFS.TRIANGLE.NEGATIVE, color.attr = "type", remove.duplicates = TRUE)
matchings = motifs.search.in.network(network, MOTIFS.TRIANGLE.NEGATIVE, remove.duplicates = TRUE)
expect_equal(matchings, expected, info = "Triangle motif (negative)")

## Square motif (positive)
expected = list(
igraph::V(network)[ c("D4", "D5", "A5", "A6") ]
)
matchings = motifs.search.in.network(network, MOTIFS.SQUARE.POSITIVE, color.attr = "type", remove.duplicates = TRUE)
matchings = motifs.search.in.network(network, MOTIFS.SQUARE.POSITIVE, remove.duplicates = TRUE)
expect_equal(matchings, expected, info = "Square motif (positive)")

## Square motif (negative)
Expand All @@ -64,7 +64,7 @@ test_that("Motifs are found in sample network (remove.duplicates = TRUE).", {
igraph::V(network)[ c("D4", "D5", "A5", "A6") ],
igraph::V(network)[ c("D4", "D6", "A5", "A6") ]
)
matchings = motifs.search.in.network(network, MOTIFS.SQUARE.NEGATIVE, color.attr = "type", remove.duplicates = TRUE)
matchings = motifs.search.in.network(network, MOTIFS.SQUARE.NEGATIVE, remove.duplicates = TRUE)
expect_equal(matchings, expected, info = "Square motif (negative)")

})
Expand All @@ -86,15 +86,15 @@ test_that("Motifs are found in sample network (remove.duplicates = FALSE).", {
igraph::V(network)[ c("D3", "D4") ], # unordered: D4, D3
igraph::V(network)[ c("D4", "D5") ] # unordered: D5, D4
)
matchings = motifs.search.in.network(network, MOTIFS.LINE, color.attr = "type", remove.duplicates = FALSE)
matchings = motifs.search.in.network(network, MOTIFS.LINE, remove.duplicates = FALSE)
expect_equal(matchings, expected, info = "Line motif")

## Triangle motif (positive)
expected = list(
igraph::V(network)[ c("D1", "D2", "A1") ],
igraph::V(network)[ c("D1", "D2", "A1") ] # unordered: D2, D1, A1
)
matchings = motifs.search.in.network(network, MOTIFS.TRIANGLE.POSITIVE, color.attr = "type", remove.duplicates = FALSE)
matchings = motifs.search.in.network(network, MOTIFS.TRIANGLE.POSITIVE, remove.duplicates = FALSE)
expect_equal(matchings, expected, info = "Triangle motif (positive)")

## Triangle motif (negative)
Expand All @@ -104,15 +104,15 @@ test_that("Motifs are found in sample network (remove.duplicates = FALSE).", {
igraph::V(network)[ c("D5", "D6", "A6") ],
igraph::V(network)[ c("D5", "D6", "A6") ] # unordered: D6, D5, A1
)
matchings = motifs.search.in.network(network, MOTIFS.TRIANGLE.NEGATIVE, color.attr = "type", remove.duplicates = FALSE)
matchings = motifs.search.in.network(network, MOTIFS.TRIANGLE.NEGATIVE, remove.duplicates = FALSE)
expect_equal(matchings, expected, info = "Triangle motif (negative)")

## Square motif (positive)
expected = list(
igraph::V(network)[ c("D4", "D5", "A5", "A6") ],
igraph::V(network)[ c("D4", "D5", "A5", "A6") ] # unordered: D5, D4, A5, A6
)
matchings = motifs.search.in.network(network, MOTIFS.SQUARE.POSITIVE, color.attr = "type", remove.duplicates = FALSE)
matchings = motifs.search.in.network(network, MOTIFS.SQUARE.POSITIVE, remove.duplicates = FALSE)
expect_equal(matchings, expected, info = "Square motif (positive)")

## Square motif (negative)
Expand All @@ -126,7 +126,7 @@ test_that("Motifs are found in sample network (remove.duplicates = FALSE).", {
igraph::V(network)[ c("D4", "D5", "A5", "A6") ], # unordered: D5, D4, A5, A6
igraph::V(network)[ c("D4", "D6", "A5", "A6") ] # unordered: D6, D4, A5, A6
)
matchings = motifs.search.in.network(network, MOTIFS.SQUARE.NEGATIVE, color.attr = "type", remove.duplicates = FALSE)
matchings = motifs.search.in.network(network, MOTIFS.SQUARE.NEGATIVE, remove.duplicates = FALSE)
expect_equal(matchings, expected, info = "Square motif (negative)")

})
Expand Down
Loading