Skip to content
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Description: plot.data is an R package for creating client-ready data for variou
License: Apache License (= 2.0)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
RoxygenNote: 7.3.3
Suggests:
covr,
testthat (>= 2.1.0)
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,12 @@ exportMethods(pruneLinksByPredicate)
exportMethods(relativeRisk)
exportMethods(sensitivity)
exportMethods(specificity)
exportMethods(toJSON)
import(data.table)
import(veupathUtils)
importFrom(S4Vectors,SimpleList)
importFrom(grDevices,nclass.FD)
importFrom(grDevices,nclass.Sturges)
importFrom(jsonlite,prettify)
importFrom(jsonlite,toJSON)
importFrom(jsonlite,unbox)
importFrom(lubridate,as_date)
importFrom(lubridate,ceiling_date)
Expand Down
1 change: 0 additions & 1 deletion R/methods-CorrelationLinks.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ function(

toJSONGeneric <- getGeneric("toJSON", package = "veupathUtils")

#' @export
setMethod(toJSONGeneric, signature("CorrelationLinkList"), function(object, named = c(TRUE, FALSE)) {
named <- veupathUtils::matchArg(named)
tmp <- veupathUtils::S4SimpleListToJSON(object, FALSE)
Expand Down
3 changes: 1 addition & 2 deletions R/methods-CorrelationNetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ function(
toJSONGeneric <- getGeneric("toJSON", package = "veupathUtils")

#' Convert CorrelationNetwork object to JSON
#'
#'
#' Converts a CorrelationNetwork object to JSON
#' @param object A CorrelationNetwork object
#' @param named boolean that declares if names should be included
#' @export
setMethod(toJSONGeneric, "CorrelationNetwork", function(object, named = c(TRUE, FALSE)) {

named <- veupathUtils::matchArg(named)
Expand Down
6 changes: 2 additions & 4 deletions R/methods-KPartiteNetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ setMethod("getAllNodeIds", "Partitions", function(object) unlist(lapply(as.list(
toJSONGeneric <- getGeneric("toJSON", package = "veupathUtils")

#' Convert Partitions object to JSON
#'
#'
#' Converts a Partitions object to JSON
#' @param object A Partitions object
#' @param named boolean that declares if names should be included
#' @export
setMethod(toJSONGeneric, "Partitions", function(object, named = c(TRUE, FALSE)) {
named <- veupathUtils::matchArg(named)
tmp <- veupathUtils::S4SimpleListToJSON(object, TRUE)
Expand All @@ -28,11 +27,10 @@ setMethod(toJSONGeneric, "Partitions", function(object, named = c(TRUE, FALSE))
})

#' Convert KPartiteNetwork object to JSON
#'
#'
#' Converts a KPartiteNetwork object to JSON
#' @param object A KPartiteNetwork object
#' @param named boolean that declares if names should be included
#' @export
setMethod(toJSONGeneric, "KPartiteNetwork", function(object, named = c(TRUE, FALSE)) {
named <- veupathUtils::matchArg(named)
tmp <- character()
Expand Down
4 changes: 1 addition & 3 deletions R/methods-Links.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ setMethod("getColors", "LinkList", function(object) unlist(lapply(object, functi
toJSONGeneric <- getGeneric("toJSON", package = "veupathUtils")

#' Convert Link object to JSON
#'
#'
#' Converts a Link object to JSON
#' @param object A Link object
#' @param named boolean that declares if names should be included
#' @export
setMethod(toJSONGeneric, "Link", function(object, named = c(FALSE, TRUE)) {
named <- veupathUtils::matchArg(named)
tmp <- character()
Expand All @@ -63,7 +62,6 @@ setMethod(toJSONGeneric, "Link", function(object, named = c(FALSE, TRUE)) {
return(tmp)
})

#' @export
setMethod(toJSONGeneric, signature("LinkList"), function(object, named = c(TRUE, FALSE)) {
named <- veupathUtils::matchArg(named)
tmp <- veupathUtils::S4SimpleListToJSON(object, FALSE)
Expand Down
4 changes: 1 addition & 3 deletions R/methods-Network.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,10 @@ pruneLinksBelowWeight <- function(net, threshold, verbose = c(TRUE, FALSE)) {
toJSONGeneric <- getGeneric("toJSON", package = "veupathUtils")

#' Convert Network object to JSON
#'
#'
#' Converts a Network object to JSON
#' @param object A Network object
#' @param named boolean that declares if names should be included
#' @export
setMethod(toJSONGeneric, "BaseNetwork", function(object, named = c(TRUE, FALSE)) {

named <- veupathUtils::matchArg(named)
Expand All @@ -202,7 +201,6 @@ setMethod(toJSONGeneric, "BaseNetwork", function(object, named = c(TRUE, FALSE))
#' @param pattern optional tmp file prefix
#' @param verbose boolean that declares if logging is desired
#' @return character name of a tmp file w ext *.json
#' @importFrom jsonlite toJSON
#' @export
#' @rdname writeNetworkJSON
setGeneric("writeNetworkJSON", function(x, pattern = NULL, verbose = c(TRUE, FALSE)) standardGeneric("writeNetworkJSON"), signature = c("x"))
Expand Down
6 changes: 1 addition & 5 deletions R/methods-Nodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ setMethod("getNodeIds", "NodeIdList", function(object) unlist(lapply(as.list(obj
toJSONGeneric <- getGeneric("toJSON", package = "veupathUtils")

#' Convert Node object to JSON
#'
#'
#' Converts a Node object to JSON
#' @param object A Node object
#' @param named boolean that declares if names should be included
#' @export
setMethod(toJSONGeneric, "Node", function(object, named = c(FALSE, TRUE)) {
named <- veupathUtils::matchArg(named)
tmp <- character()
Expand All @@ -82,7 +81,6 @@ setMethod(toJSONGeneric, "Node", function(object, named = c(FALSE, TRUE)) {
return(tmp)
})

#' @export
setMethod(toJSONGeneric, signature("NodeList"), function(object, named = c(TRUE, FALSE)) {
named <- veupathUtils::matchArg(named)
tmp <- veupathUtils::S4SimpleListToJSON(object, FALSE)
Expand All @@ -92,7 +90,6 @@ setMethod(toJSONGeneric, signature("NodeList"), function(object, named = c(TRUE,
return(tmp)
})

#' @export
setMethod(toJSONGeneric, signature("NodeId"), function(object, named = c(FALSE, TRUE)) {
named <- veupathUtils::matchArg(named)
tmp <- character()
Expand All @@ -104,7 +101,6 @@ setMethod(toJSONGeneric, signature("NodeId"), function(object, named = c(FALSE,
return(tmp)
})

#' @export
setMethod(toJSONGeneric, signature("NodeIdList"), function(object, named = c(TRUE, FALSE)) {
named <- veupathUtils::matchArg(named)
tmp <- veupathUtils::S4SimpleListToJSON(object, FALSE)
Expand Down
1 change: 0 additions & 1 deletion R/utils-json.R
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ getJSON <- function(.pd, evilMode) {
#' @param .pd a data.table to convert to json and write to a tmp file
#' @param pattern optional tmp file prefix
#' @return character name of a tmp file w ext *.json
#' @importFrom jsonlite toJSON
#' @importFrom jsonlite prettify
#' @export
writeJSON <- function(.pd, evilMode, pattern = NULL, verbose = c(TRUE, FALSE)) {
Expand Down
Loading