Skip to content

Commit

Permalink
ran styler
Browse files Browse the repository at this point in the history
  • Loading branch information
tonywu1999 committed Oct 4, 2024
1 parent 583346a commit cf29bee
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions R/getSubnetworkFromIndra.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#' Get subnetwork from INDRA database
#'
#'
#' Using differential abundance results from MSstats, this function retrieves
#' a subnetwork of protein interactions from INDRA database.
#'
#' @param input output of groupComparison function's comparisionResult table,
#' @param input output of groupComparison function's comparisionResult table,
#' which contains a list of proteins and their corresponding p-values, logFCs,
#' along with additional HGNC ID and HGNC name columns
#' @param pvalueCutoff p-value cutoff for filtering. Default is NULL, i.e. no
Expand Down
10 changes: 5 additions & 5 deletions R/visualizeNetworks.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#' Create visualization of network
#'
#' Use results from INDRA to generate a visualization of the a network on
#' Cytoscape Desktop. Note that the Cytoscape Desktop app must be open for
#'
#' Use results from INDRA to generate a visualization of the a network on
#' Cytoscape Desktop. Note that the Cytoscape Desktop app must be open for
#' this function to work.
#'
#' @param nodes dataframe of nodes consisting of columns
#' @param nodes dataframe of nodes consisting of columns
#' id (chararacter), pvalue (number), logFC (number)
#' @param edges dataframe of edges consisting of columns
#' source (character), target (character), interaction (character),
#' source (character), target (character), interaction (character),
#' evidenceCount (number), evidenceLink (character)
#' @param pvalueCutoff p-value cutoff for coloring significant proteins.
#' Default is 0.05
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-getSubnetworkFromIndra.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ test_that("getSubnetworkFromIndra with pvalue filter works correctly", {
return(readRDS(system.file("extdata/indraResponse.rds", package = "MSstatsBioNet")))
})
suppressWarnings(
subnetwork <- getSubnetworkFromIndra(input, pvalueCutoff = 0.45))
subnetwork <- getSubnetworkFromIndra(input, pvalueCutoff = 0.45)
)
expect_equal(nrow(subnetwork$nodes), 6)
expect_equal(nrow(subnetwork$edges), 2)
})
8 changes: 4 additions & 4 deletions tests/testthat/test-visualizeNetworks.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ test_that("visualizeNetworks with p-value and logFC constraints works", {

test_that("visualizeNetworks returns warning for non-interactive calls", {
input <- readRDS(system.file("extdata/subnetwork.rds",
package = "MSstatsBioNet"
package = "MSstatsBioNet"
))

mock_interactive <- mock(FALSE)
stub(
visualizeNetworks, "interactive",
mock_interactive
)

expect_warning(visualizeNetworks(input$nodes, input$edges,
pvalueCutoff = 0.01, logfcCutoff = 2.5
pvalueCutoff = 0.01, logfcCutoff = 2.5
))
})
3 changes: 2 additions & 1 deletion vignettes/MSstatsBioNet.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ knitr::opts_chunk$set(
Run this code below to install MSstatsBioNet from bioconductor

```{r eval = FALSE}
if (!require("BiocManager", quietly = TRUE))
if (!require("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
BiocManager::install("MSstatsBioNet")
```
Expand Down

0 comments on commit cf29bee

Please sign in to comment.