Commit 0d1ea14f authored by smorabit's avatar smorabit
Browse files

projectmodules update

parent 18ad491e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
Package: hdWGCNA
Title: hdWGCNA
Version: 0.1.1.9010
Version: 0.1.1.9011
Authors@R: c(
    person("Sam", "Morabito", , "smorabit@uci.edu", role = c("aut", "cre"),
           comment = c(ORCID = "0000-0002-7768-4856")),
+11 −1
Original line number Diff line number Diff line
# hdWGCNA 0.1.1.9009 (2022-07-30)
# hdWGCNA 0.1.1.9011 (2022-08-17)
## Added
- None

## Changes
- Reverted the `exclude_grey` flag back to doing nothing in the `ModuleEigengenes` function because it messed up some downstream tasks, will resolve in a future update.
- `ProjectModules` now excludes modules with too many missing genes in the query dataset,
tunable by the `overlap_proportion` parameter.


# hdWGCNA 0.1.1.9010 (2022-07-30)
## Added
- None

+13 −0
Original line number Diff line number Diff line
@@ -1128,6 +1128,7 @@ ProjectModules <- function(
  group.by.vars=NULL,
  gene_mapping=NULL, # table mapping genes from species 1 to species 2
  genome1_col=NULL, genome2_col=NULL,
  overlap_proportion = 0.5,
  vars.to.regress = NULL,
  scale.model.use = 'linear',
  wgcna_name=NULL, wgcna_name_proj=NULL,
@@ -1156,6 +1157,18 @@ ProjectModules <- function(
    modules <- TransferModuleGenome(modules, gene_mapping, genome1_col, genome2_col)
  }

  # what is the proportion of genes in each module that are in seurat_obj?
  mods <- as.character(unique(modules$module))
  mod_props <- unlist(lapply(mods, function(x){
    cur_mod <- subset(modules, module == x)
    sum(cur_mod$gene_name %in% rownames(seurat_obj)) / nrow(cur_mod)
  }))
  mods_keep <- mods[mod_props >= overlap_proportion]

  # only keep modules that have enough overlapping genes
  modules <- subset(modules, module %in% mods_keep) %>%
    dplyr::mutate(module = droplevels(module))

  # get genes that overlap between WGCNA genes & seurat_obj genes:
  gene_names <- modules$gene_name
  genes_use <- intersect(gene_names, rownames(seurat_obj))
+0 −1
Original line number Diff line number Diff line
@@ -81,7 +81,6 @@ ConstructMetacells <- function(
      this_choice <- cell_sample[nrow(cell_sample), ]
      shared <- sapply(others, get_shared, this_choice = this_choice)

      # if (max(shared) < 0.9 * k) { # old way of doing it
      if(max(shared) <= max_shared){
          chosen <- new_chosen
      }
+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.1.1.9010</span>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.1.1.9011</span>
      </span>
    </div>

Loading