Commit 7bb3c232 authored by smorabit's avatar smorabit
Browse files

added correlation options for ModuleConnectivity

parent a02fd9d6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
Package: hdWGCNA
Title: hdWGCNA
Version: 0.1.1.9011
Version: 0.1.1.9012
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.1.1.9012 (2022-08-27)
## Added
- None

## Changes
- Now includes options for other types of correlations in `ModuleConnectivity`.


# hdWGCNA 0.1.1.9011 (2022-08-17)
## Added
- None
+16 −8
Original line number Diff line number Diff line
@@ -893,20 +893,29 @@ AvgModuleExpr <- function(seurat_obj, n_genes = 25, wgcna_name=NULL, ...){

#' ModuleConnectivity
#'
#' Computes intramodular connectivity (kME) based on module eigengenes.
#' Computes eigengene-based connectivity (kME) based on module eigengenes and the
#' gene expression in selected cell populations.
#'
#' @param seurat_obj A Seurat object
#' @param group.by column in seurat_obj@meta.data containing grouping info, ie clusters or celltypes
#' @param group_name name of the group(s) in group.by to use for kME calculation
#' @param corFnc character string specifying the function to be used to calculate co-expression similarity. Defaults to bicor. Any function returning values
#' @param corOptions 	character string specifying additional arguments to be passed to the function given by corFnc. Use "use = 'p', method = 'spearman'" to obtain Spearman correlation. Use "use = 'p'" to obtain Pearson correlation.
#' @param harmonized logical determining whether to use harmonized MEs for kME calculation
#' @param assay Assay in seurat_obj containing expression information.
#' @param slot Slot in specified, default to normalized 'data' slot.
#' @param wgcna_name The name of the hdWGCNA experiment in the seurat_obj@misc slot
#' @keywords scRNA-seq
#' @export
#' @examples
#' ModuleConnectivity(pbmc)
ModuleConnectivity <- function(
  seurat_obj,
  group.by = NULL,
  group_name = NULL,
  corFnc = 'bicor',
  corOptions = "use='p'",
  harmonized=TRUE,
  assay = NULL,
  slot = 'data',
  group.by = NULL,
  group_name = NULL,
  wgcna_name = NULL,
  ...
){
@@ -941,14 +950,13 @@ ModuleConnectivity <- function(
  )[genes_use,cells.use]

  datExpr <- t(as.matrix(exp_mat))
  print(dim(datExpr))
  print('running signedKME...')

  kMEs <- WGCNA::signedKME(
    datExpr,
    MEs,
    outputColumnName = "kME",
    corFnc = "bicor",
    corFnc = corFnc,
    corOptions = corOptions,
    ...
  )

+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
[![R](https://img.shields.io/github/r-package/v/smorabit/hdWGCNA)](https://github.com/smorabit/hdWGCNA/tree/dev)
[![ISSUES](https://img.shields.io/github/issues/smorabit/hdWGCNA)](https://github.com/smorabit/hdWGCNA/issues)
[![DOI](https://zenodo.org/badge/286864581.svg)](https://zenodo.org/badge/latestdoi/286864581)

[![Stars](https://img.shields.io/github/stars/smorabit/hdWGCNA?style=social)](https://github.com/smorabit/hdWGCNA/)

**Note:** hdWGCNA is under active development, so you will likely run into errors and small typos
if you choose to use hdWGCNA before its first stable release.
+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.9011</span>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.1.1.9012</span>
      </span>
    </div>

Loading