Skip to content

Commit

Permalink
cleanup for successful build
Browse files Browse the repository at this point in the history
oneilsh committed Jun 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9f78bd6 commit 7c24199
Showing 17 changed files with 79 additions and 119 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -12,3 +12,5 @@
node_modules$
package-lock\.json$
package\.json$
^doc$
^Meta$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -4,3 +4,5 @@
.Rdata
.httr-oauth
.DS_Store
/doc/
/Meta/
7 changes: 3 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
# Generated by roxygen2: do not edit by hand

S3method(edges,tbl_kgx)
S3method(explode,tbl_kgx)
S3method(select_nodes,monarch_kg)
S3method(nodes,tbl_kgx)
export(cypher_query)
export(cypher_query_df)
export(edges)
export(explode)
export(fetch_edges)
export(monarch_search)
export(nodes)
export(query_ids)
export(select_nodes)
export(summarize_neighborhood)
export(summarize_neighborhood_edges)
export(summarize_neighborhood_nodes)
export(tbl_kgx)
import(dplyr)
import(tidygraph)
importFrom(assertthat,assert_that)
importFrom(dplyr,mutate)
importFrom(neo2R,cypher)
importFrom(tibble,tibble)
importFrom(tidygraph,activate)
importFrom(tidygraph,as_tibble)
importFrom(tidygraph,tbl_graph)
4 changes: 0 additions & 4 deletions R/cypher_query.R
Original file line number Diff line number Diff line change
@@ -6,10 +6,6 @@
#' @param cats_list A list of vectors of categories.
#' @param cats_prefs An ordered preference list over categories.
#' @return A vector of normalized categories.
#' @examples
#' categories_list <- list(c("A", "B", "C"), c("D", "E", "F"))
#' categories_prefs <- c("B", "E", "A", "D", "C", "F")
#' normalize_categories(categories_list, categories_prefs)
normalize_categories <- function(cats_list, cats_prefs) {
normed <- unlist(lapply(cats_list, function(categories) {
positions <- match(categories, cats_prefs)
7 changes: 4 additions & 3 deletions R/fetch.R
Original file line number Diff line number Diff line change
@@ -11,11 +11,11 @@
#' @export
#' @examples
#' g <- monarch_search("fanconi anemia", limit = 1)
#' phenos <- g %>%
#' phenos <- g |>
#' fetch_edges(predicates = "biolink:has_phenotype", result_categories = "biolink:PhenotypicFeature")
#'
#' ancestors <- g %>%
#' fetch_edges(predicates = "biolink:subclass_of", transitive = TRUE)
#' ancestors <- g |>
#' fetch_edges(predicates = "biolink:subclass_of", transitive = TRUE, direction = "out")
#'
#' @import tidygraph
#' @import dplyr
@@ -110,6 +110,7 @@ fetch_edges <- function(g,
predicates = predicates,
result_categories = result_categories))


result <- result %>%
tidygraph::activate(nodes) %>%
mutate(pcategory = normalize_categories(category, options("kg_prefs")$kg_prefs$monarch_kg$category_priority))
44 changes: 0 additions & 44 deletions R/select_nodes.R

This file was deleted.

24 changes: 21 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#' Get tbl_kgx graph nodes table.
#'
#' @importFrom tidygraph as_tibble
#' @param x Input graph
#' @param ... Other options (unused)
#' @export
#' @examples
#' g <- monarch_search("fanconi anemia", limit = 1)
#' print(nodes(g))
@@ -11,6 +14,9 @@ nodes.tbl_kgx <- function(x, ...) {
#' Get tbl_kgx graph edges table.
#'
#' @importFrom tidygraph as_tibble
#' @param x Input graph
#' @param ... Other options (unused)
#' @export
#' @examples
#' g <- monarch_search("fanconi anemia", limit = 1)
#' print(edges(g))
@@ -21,7 +27,8 @@ edges.tbl_kgx <- function(x, ...) {

#' Get graph nodes table.
#'
#' @param x A graph object
#' @param x Input graph
#' @param ... Other options (unused)
#' @return A tibble with the nodes of the graph
#' @importFrom tidygraph as_tibble
#' @export
@@ -37,6 +44,8 @@ nodes <- function(x, ...) {
#'
#' @return A tibble with the edges of the graph
#' @importFrom tidygraph as_tibble
#' @param x Input graph
#' @param ... Other options (unused)
#' @export
#' @examples
#' g <- monarch_search("fanconi anemia", limit = 1)
@@ -46,14 +55,23 @@ edges <- function(x, ...) {
UseMethod("edges")
}


#' Explode a graph into a list of single-node graphs.
#'
#' @param x Input graph
#' @param ... Other options (unused)
#' @return A list of single-node graphs
#' @export
#' @examples
#' g <- monarch_search("fanconi anemia", limit = 5)
#' print(explode(g))
explode <- function(x, ...) {
UseMethod("explode")
}

#' Explode a graph into a list of single-node graphs.
#'
#' @param x A graph object
#' @param x Input graph
#' @param ... Other options (unused)
#' @return A list of single-node graphs
#' @importFrom tidygraph as_tibble
#' @export
5 changes: 5 additions & 0 deletions man/edges.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/edges.tbl_kgx.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions man/explode.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/explode.tbl_kgx.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/fetch_edges.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/nodes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/nodes.tbl_kgx.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions man/normalize_categories.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 0 additions & 24 deletions man/select_nodes.Rd

This file was deleted.

27 changes: 0 additions & 27 deletions man/select_nodes.monarch_kg.Rd

This file was deleted.

0 comments on commit 7c24199

Please sign in to comment.