Skip to content

Commit

Permalink
clear the rcmdcheck notes
Browse files Browse the repository at this point in the history
  • Loading branch information
noriakis committed Apr 17, 2024
1 parent d3861a6 commit 944e160
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 43 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ importFrom(GetoptLong,qqcat)
importFrom(MASS,cov.trob)
importFrom(NLP,ngrams)
importFrom(NLP,words)
importFrom(RColorBrewer,brewer.pal)
importFrom(XML,xmlElementsByTagName)
importFrom(XML,xmlParse)
importFrom(XML,xmlTreeParse)
Expand Down
8 changes: 7 additions & 1 deletion R/alliance.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' alliance
#' @rdname generalf
#' @export
#' @importFrom RColorBrewer brewer.pal
#' @examples
#' geneList <- c("DDX41","PNKP","ERCC1","IRF3","XRCC1")
#' \dontrun{alliance(geneList)}
Expand Down Expand Up @@ -132,6 +132,12 @@ alliance <- function (geneList,
## If filter by GO terms
if (filterByGO) {
qqcat("`filterByGO` option enabled. Filtering by GO terms ...\n")
data_env <- new.env(parent = emptyenv())
load(system.file("extdata", "sysdata.rda", package = "biotextgraph"),
envir=data_env)
goWords <- data_env[["goWords"]]
goWords2gram <- data_env[["goWords2gram"]]

if (ngram==1) {
filtered_by_GO <- names(matSorted)[tolower(names(matSorted)) %in% goWords]
matSorted <- matSorted[filtered_by_GO]
Expand Down
4 changes: 0 additions & 4 deletions R/bugsigdb.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#' bugsigdb
#'
#' Visualize BugSigDB
#'
#' @rdname generalf
#' @import tm
#' @import bugsigdbr
Expand Down
1 change: 1 addition & 0 deletions R/exportWCNetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#' @param sizeMin minimum scale size for nodes
#' @param sizeMax maximum scale size for nodes
#' @param wcScale scaling size for wordcloud
#' @importFrom RColorBrewer brewer.pal
#' @return export the Cytoscape.js network
#' @export
exportWCNetwork <- function(g, geneList, dir="network", colors=NULL,
Expand Down
8 changes: 4 additions & 4 deletions R/getWordsOnDendro.R
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ getWordsOnDendro <- function(dhc, geneVec, geneNumLimit=1000,
filter(.data$yend==h1) %>%
filter(.data$xend <= max(labs1_x)) %>%
filter(.data$xend >= min(labs1_x)) %>%
dplyr::pull(x) %>% unique()
dplyr::pull(.data$x) %>% unique()
}

labs2_x <- labelPos %>%
Expand All @@ -368,7 +368,7 @@ getWordsOnDendro <- function(dhc, geneVec, geneNumLimit=1000,
filter(.data$yend==h2) %>%
filter(.data$xend <= max(labs2_x)) %>%
filter(.data$xend >= min(labs2_x)) %>%
dplyr::pull(x) %>% unique()
dplyr::pull(.data$x) %>% unique()
}
XMIN <- median(c(min1, min2))
} else {
Expand Down Expand Up @@ -399,7 +399,7 @@ getWordsOnDendro <- function(dhc, geneVec, geneNumLimit=1000,
filter(.data$yend==h1) %>%
filter(.data$xend <= max(labs1_x)) %>%
filter(.data$xend >= min(labs1_x)) %>%
dplyr::pull(x) %>% unique()
dplyr::pull(.data$x) %>% unique()
}

labs2_x <- labelPos %>%
Expand All @@ -411,7 +411,7 @@ getWordsOnDendro <- function(dhc, geneVec, geneNumLimit=1000,
filter(.data$yend==h2) %>%
filter(.data$xend <= max(labs2_x)) %>%
filter(.data$xend >= min(labs2_x)) %>%
dplyr::pull(x) %>% unique()
dplyr::pull(.data$x) %>% unique()
}

XMAX <- median(c(max1, max2))
Expand Down
11 changes: 6 additions & 5 deletions R/manual.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
#' manual
#'
#' Produce networks using manual input.
#'
#' @rdname generalf
#' @examples
#' ret <- refseq("DDX41", plotType="wc")
#' manual(getSlot(ret, "rawText")$Gene_summary, plotType="wc")
#' @export
#' @return list of data frame and ggplot2 object
#' @import tm
#' @import GeneSummary
#' @import wordcloud
Expand Down Expand Up @@ -160,6 +155,12 @@ manual <- function(df, madeUpper=NULL,
## If filter by GO terms
if (filterByGO) {
qqcat("`filterByGO` option enabled. Filtering by GO terms ...\n")
data_env <- new.env(parent = emptyenv())
load(system.file("extdata", "sysdata.rda", package = "biotextgraph"),
envir=data_env)
goWords <- data_env[["goWords"]]
goWords2gram <- data_env[["goWords2gram"]]

if (ngram==1) {
filtered_by_GO <- names(matSorted)[tolower(names(matSorted)) %in% goWords]
matSorted <- matSorted[filtered_by_GO]
Expand Down
25 changes: 13 additions & 12 deletions R/pubmed.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#' pubmed
#'
#' make word cloud or correlation network from PubMed
#'
#' @rdname generalf
#' @export
#' @examples \dontrun{pubmed("DDX41")}
#' @return object consisting of data frame and ggplot2 object
#' @import tm
#' @import GeneSummary
#' @import wordcloud
Expand Down Expand Up @@ -216,14 +211,20 @@ pubmed <- function(queries, useRawQuery=FALSE,

## If filter by GO terms
if (filterByGO) {
qqcat("`filterByGO` option enabled. Filtering by GO terms ...\n")
if (ngram==1) {
filtered_by_GO <- names(matSorted)[tolower(names(matSorted)) %in% goWords]
matSorted <- matSorted[filtered_by_GO]
} else if (ngram==2) {
qqcat("`filterByGO` option enabled. Filtering by GO terms ...\n")
data_env <- new.env(parent = emptyenv())
load(system.file("extdata", "sysdata.rda", package = "biotextgraph"),
envir=data_env)
goWords <- data_env[["goWords"]]
goWords2gram <- data_env[["goWords2gram"]]

if (ngram==1) {
filtered_by_GO <- names(matSorted)[tolower(names(matSorted)) %in% goWords]
matSorted <- matSorted[filtered_by_GO]
} else if (ngram==2) {
filtered_by_GO <- names(matSorted)[tolower(names(matSorted)) %in% goWords2gram]
matSorted <- matSorted[filtered_by_GO]
} else {# Do nothing
matSorted <- matSorted[filtered_by_GO]
} else {# Do nothing
}
}

Expand Down
10 changes: 8 additions & 2 deletions R/refseq.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#'
#' @description Text mining RefSeq description, PubMed, BugSigDB
#' and the other manually curated textual data.
#' @details The main functions of the {{biotextgraph}} package. The functions accepts
#' @details The main functions of the \pkg{biotextgraph} package. The functions accepts
#' a character vector of biological entities (such as gene identifiers)
#' and returns the summarized statistics and visualization
#' contained in {{biotext}} object.
#' contained in \code{biotext} object.
#'
#' @param geneList gene ID list
#' @param queries query ID list
Expand Down Expand Up @@ -354,6 +354,12 @@ refseq <- function (geneList, keyType="SYMBOL",
## If filter by GO terms
if (filterByGO) {
qqcat("`filterByGO` option enabled. Filtering by GO terms ...\n")
data_env <- new.env(parent = emptyenv())
load(system.file("extdata", "sysdata.rda", package = "biotextgraph"),
envir=data_env)
goWords <- data_env[["goWords"]]
goWords2gram <- data_env[["goWords2gram"]]

if (ngram==1) {
filtered_by_GO <- names(matSorted)[tolower(names(matSorted)) %in% goWords]
matSorted <- matSorted[filtered_by_GO]
Expand Down
4 changes: 2 additions & 2 deletions R/sc.R
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ plotReducedDimWithTexts <- function(sce, marker.info,
YMe <- dens_max$y

new_points <- rbind(new_points,
c(map_group[i],
c(colmap[i,"group"],
XMe - r,
YMe - r,
XMe + r,
YMe + r))
} else {
new_points <- rbind(new_points,
c(map_group[i],
c(colmap[i,"group"],
ctr["x"] - min(dist2center),
ctr["y"] - min(dist2center),
ctr["x"] + max(dist2center),
Expand Down
16 changes: 3 additions & 13 deletions man/generalf.Rd

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

0 comments on commit 944e160

Please sign in to comment.