Commit c90fd58c authored by smorabit's avatar smorabit
Browse files

setDatExpr bugfix

parent 97950a2c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
Package: hdWGCNA
Title: hdWGCNA
Version: 0.2.13
Version: 0.2.14
Authors@R: c(
    person("Sam", "Morabito", , "smorabit@uci.edu", role = c("aut", "cre"),
           comment = c(ORCID = "0000-0002-7768-4856")),
+8 −0
Original line number Diff line number Diff line
# hdWGCNA 0.2.14 (2023-02-14)
## Added
- None

## Changes
- Fixed a bug in `SetDatExpr` that would throw an error when group.by=NULL was selected.


# hdWGCNA 0.2.13 (2023-02-13)
## Added
- None
+11 −10
Original line number Diff line number Diff line
@@ -196,7 +196,6 @@ SetDatExpr <- function(
  # get parameters from seurat object
  params <- GetWGCNAParams(seurat_obj, wgcna_name)
  genes_use <- GetWGCNAGenes(seurat_obj, wgcna_name)
  modules <- GetModules(seurat_obj, wgcna_name)

  # get metacell object
  m_obj <- GetMetacellObject(seurat_obj, wgcna_name)
@@ -222,14 +221,14 @@ SetDatExpr <- function(
    stop("Assay not found. Check names(seurat_obj@assays) or names(GetMetacellObject(seurat_obj)@assays)")
  }

  # check that group.by is in the Seurat object & in the metacell object:
  if(!is.null(group.by)){

    # check that group.by is in the Seurat object & in the metacell object:
    if(!(group.by %in% colnames(s_obj@meta.data))){
      m_cell_message <- ""
      if(use_metacells){m_cell_message <- "metacell"}
      stop(paste0(group.by, ' not found in the meta data of the ', m_cell_message, ' Seurat object'))
    }
  }

    # check that the selected groups are in the Seurat object:
    if(!all(group_name %in% s_obj@meta.data[[group.by]])){
@@ -239,6 +238,8 @@ SetDatExpr <- function(
      )
    }

  }

  # columns to group by for cluster/celltype
  if(!is.null(group.by)){
    seurat_meta <- seurat_meta %>% subset(get(group.by) %in% group_name)
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@
      </button>
      <span class="navbar-brand">
        <a class="navbar-link" href="https://smorabit.github.io/hdWGCNA/index.html">hdWGCNA</a>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.13</span>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.14</span>
      </span>
    </div>

+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
      </button>
      <span class="navbar-brand">
        <a class="navbar-link" href="index.html">hdWGCNA</a>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.13</span>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.14</span>
      </span>
    </div>

Loading