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
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: icWGCNA
Title: Iterative Correcting Weighted Gene Co-expression Network Analysis
Version: 0.4.0
Version: 0.4.1
Authors@R: c(
person("Mike", "Mason", , "mike.mason@bms.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-5652-7739")),
Expand Down Expand Up @@ -35,7 +35,7 @@ Suggests:
foreach,
ggplot2,
mockery,
msigdbr,
msigdbdf (>= 24.1.0),
parallel,
purrr,
R.utils,
Expand All @@ -52,9 +52,11 @@ Suggests:
LinkingTo:
Rcpp,
RcppEigen
Remotes: dviraran/xCell
Remotes:
dviraran/xCell,
igordot/msigdbdf
Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Config/testthat/parallel: true
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# icWGCNA 0.4.1

- Fixed bug in `map_eigengenes_on_seurat()` when cutoff method is "value"
- Updated MSigDB data for `compute_MSigDB_enrichment()`

# icWGCNA 0.4.0

### New Features
Expand Down
14 changes: 7 additions & 7 deletions R/downstream.R
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ compute_MSigDB_enrichment <- function(membership_matrix,
memb_cut = .65,
cats = c("H", "C3", "C6", "C7", "C8"),
p_cut = 0.001) {
needed_packages <- c('msigdbr', 'foreach', 'tidyr')
needed_packages <- c('msigdbdf', 'foreach', 'tidyr')
missing_packages <- !vapply(needed_packages,
FUN = requireNamespace, quietly = TRUE,
FUN.VALUE = logical(1))
Expand All @@ -308,8 +308,8 @@ compute_MSigDB_enrichment <- function(membership_matrix,
stop("membership_matrix values can't be <-1 or >1")
}

m_df_simp <- msigdbr::msigdbr(species = "Homo sapiens")
gs_cat_levels <- sort(unique(m_df_simp$gs_cat))
m_df_simp <- msigdbdf::msigdbdf(target_species = "HS")
gs_cat_levels <- sort(unique(m_df_simp$gs_collection))

if (all(!cats %in% gs_cat_levels)) {
stop('No "cats" found in MSigDB. Must use at least one of: ',
Expand All @@ -322,8 +322,8 @@ compute_MSigDB_enrichment <- function(membership_matrix,
}

sig_list <- lapply(cats, function(xx) {
tmp_data <- m_df_simp[m_df_simp$gs_cat == xx, ]
split(x = tmp_data$gene_symbol, f = tmp_data$gs_name)
tmp_data <- m_df_simp[m_df_simp$gs_collection == xx, ]
split(x = tmp_data$db_gene_symbol, f = tmp_data$gs_name)
})
names(sig_list) <- cats

Expand Down Expand Up @@ -924,7 +924,7 @@ display_top_genes <- function(
#' results <- icwgcna(ex)
#'
#' unique_top_genes <- map_eigengenes_on_seurat(
#' SeuratObject::pbmc_small
#' SeuratObject::pbmc_small,
#' results$community_membership
#' )
#' }
Expand Down Expand Up @@ -957,7 +957,7 @@ map_eigengenes_on_seurat <- function(

message('Collecting signatures...')

if (cutoff_method %in% c('kme', 'both')) {
if (cutoff_method %in% c('value', 'both')) {

genelist <- lapply(
membership,
Expand Down
2 changes: 1 addition & 1 deletion man/map_eigengenes_on_seurat.Rd

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

486 changes: 162 additions & 324 deletions tests/testthat/_snaps/downstream.md

Large diffs are not rendered by default.

Binary file modified tests/testthat/fixtures/testing_MSigDB_enrichment.rds
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/testthat/test-downstream.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ test_that('requireNamespace stubbing (MSigDB)', {

expect_error(
compute_MSigDB_enrichment(testing_results$community_membership),
"Must have the following R packages installed for this function: msigdbr, foreach, tidyr")
"Must have the following R packages installed for this function: msigdbdf, foreach, tidyr")

})

Expand Down
Loading