scWGNA.compare: Runs a comparative scWGCNA analysis

View source: R/scWGCNA.compare.R

scWGNA.compareR Documentation

Runs a comparative scWGCNA analysis

Description

This function runs a WGCNA analysis adapted for single cells. Based on single-cell or pseudocell data.

Usage

scWGNA.compare(
  scWGCNA.data,
  test.list,
  test.names,
  ortho = NULL,
  ortho.sp = NULL,
  is.pseudocell = T,
  ...
)

Arguments

scWGCNA.data

The WGCNA data to use as reference for comparative analysis. Output from run.scWGCNA

test.list

List of Seurat objects. The samples to test conservation in. If data is calculated on pseudocells, these should also be pseudocell objects

test.names

Vector of strings. Contains the names for each of the samples in test.

ortho

Data frame. If the test objects and the reference data have different feature names, a data frame should be provided. Only listing 1-to-1 orthologous genes. The species of the reference MUST always be column no. 1

ortho.sp

Vector numeric. Indicating to which species in ortho each test sample belongs to.

is.pseudocell

Logic. Is the analysis based on pseudocells?

...

Further parameters, passed to WGCNA::modulePreservation

Value

It returns a new object, main result of WGCNA::modulePreservation

Examples

# A pre-calculated WGCNA data list
class(MmLimbE155.scWGCNA)
Mm.scW = MmLimbE155.scWGCNA

# A Seurat object with chicken limb cells
my.small_GgLimbHH29

# We calculate pseudocells for this object
Gg.ps=calculate.pseudocells(my.small_GgLimbHH29, dims = 1:10)

# Our Seurat objects contain gene names equivalencies in the misc slot.
# We use them to biuld a table of orthologous genes
my.ortho = merge(my.small_MmLimbE155@misc$gnames,my.small_GgLimbHH29@misc$gnames, by = "Gene.name")
my.ortho=my.ortho[,2:3]

# Comparative tests
MmvGg = scWGNA.compare(Mm.scW, test.list=list(Gg.ps), test.names="Gg", ortho=my.ortho, ortho.sp=2)

CFeregrino/scWGCNA documentation built on Nov. 21, 2022, 2:31 a.m.