Skip to content

Commit

Permalink
Post-review changes (#28)
Browse files Browse the repository at this point in the history
* Remove seed setting from start of vignette

* Include package loading chunk in vignette

* Make WGCNA picksoftthreshold silent

* Fix application of capture.output for WGCNA soft thresholding function

* Import capture.output from utils

* Add capture.output to NAMESPACE

* Improve stability plot resolution

* Bump version
  • Loading branch information
jackgisby authored Jan 9, 2025
1 parent 7519a28 commit 8bf8654
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ReducedExperiment
Type: Package
Title: Containers and tools for dimensionally-reduced -omics representations
Version: 0.99.4
Version: 0.99.5
Authors@R: c(
person("Jack", "Gisby", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-0511-8123")),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ importClassesFrom(SummarizedExperiment,SummarizedExperiment)
importFrom(lme4,lmerControl)
importFrom(lmerTest,lmer)
importFrom(utils,.DollarNames)
importFrom(utils,capture.output)
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# ReducedExperiment 0.99.5 (2025-01-09)
* Switched variable names to CamelCase
* Added comparison of ReducedExperiment and similar object systems
* Ensured methods are replicable with seed arguments
* Passed Bioconductor review

# ReducedExperiment 0.99.0 (2024-09-27)
* Developed ReducedExperiment classes and functionality
* Made package compatible with R and BioC checks
Expand Down
26 changes: 20 additions & 6 deletions R/modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ identifyModules <- function(
#'
#' @author Jack Gisby
#'
#' @importFrom utils capture.output
#' @export
assessSoftThreshold <- function(
X, assay_name = "normal", powerVector = 1:30, RsquaredCut = 0.85,
Expand All @@ -207,14 +208,27 @@ assessSoftThreshold <- function(
if (inherits(X, "SummarizedExperiment"))
X <- assay(X, assay_name)

# Apply soft thresholding function
threshold_output <- WGCNA::pickSoftThreshold(
t(X),
powerVector = powerVector, RsquaredCut = RsquaredCut,
corFnc = corFnc, networkType = networkType,
blockSize = maxBlockSize, verbose = verbose, ...
args <- list(
data = t(X),
powerVector = powerVector,
RsquaredCut = RsquaredCut,
corFnc = corFnc,
networkType = networkType,
blockSize = maxBlockSize,
verbose = verbose,
...
)

# Apply soft thresholding function (if verbose == 0 suppress the print)
if (verbose == 0) {
capture.output(
threshold_output <- do.call(WGCNA::pickSoftThreshold, args),
file = NULL
)
} else {
threshold_output <- do.call(WGCNA::pickSoftThreshold, args)
}

# Get the output
wgcna_power_estimate <- threshold_output$powerEstimate
fit_indices <- threshold_output$fitIndices
Expand Down
Binary file modified inst/stability.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions vignettes/ReducedExperiment.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ knitr::opts_chunk$set(
fig.align = "center",
dpi = 300
)
# Seed
set.seed(1)
```

# Installation
Expand All @@ -53,7 +50,7 @@ devtools::install_github("jackgisby/ReducedExperiment")

# Introduction

```{r load-packages, message=FALSE, warning=FALSE, include=FALSE}
```{r load-packages, message=FALSE, warning=FALSE, include=TRUE}
library(SummarizedExperiment)
library(ReducedExperiment)
library(ggplot2)
Expand Down

0 comments on commit 8bf8654

Please sign in to comment.