run.scWGCNA: Runs a semi-automatic, iterative scWGCNA analysis

View source: R/runscWGCNA.R

run.scWGCNAR Documentation

Runs a semi-automatic, iterative scWGCNA analysis

Description

This function runs our semi-automatic single-cell WGCNA analysis. It runs in an iterative way. Based on single-cell or pseudocell data.

Usage

run.scWGCNA(
  p.cells,
  s.cells,
  idents,
  features,
  is.pseudocell = T,
  min.cells = 10,
  less = T,
  merging = T,
  g.names
)

Arguments

p.cells

Seurat object. The expression data used to run the co-expression analysis. Can be pseudocell or single-cell data but pseudocells are recommended.

s.cells

Seurat object. The single cell data, if running on single cell data already, please repeat the argument.

idents

Variable. Are certain clusters to be used? Please use group identities and not cell names.

features

Variable. The features to be used for the analysis. Default is F, which makes the script calculate variable genes.

is.pseudocell

Logical. Is the main data pseudocell data? Default is T

min.cells

Numeric. The minimum cells in which genes need to be expressed, to be considered for variable genes calculation. Default is 10

less

Logical. Should modules that are expressed in very few cells be filtered or merged with other modules? Default = T

merging

Logical. Should modules that are very similar (euclidean distance <0.25 ) be merged? Default = T

g.names

Data frame. If you're using gene IDs and no symbols, you might wanna provide a list of gene names for plotting. Two columns: 1= ids present in expression matrix, 2= names to appear in plots. Rownames= same as 1st row

Value

A list object with the resulting WGCNA data.

Examples


# A pre-analyzed Seurat object, subsampled
my.small_MmLimbE155
MmLimb.sc = my.small_MmLimbE155

# We calculate first pseudocells
MmLimb.ps=calculate.pseudocells(MmLimb.sc, dims = 1:10)

# We use all the features in this small example data. These are pre-computed highly variable genes.
my.f = rownames(MmLimb.sc)

# Use the pseudocells and single cells to calculate modules
MmLimb.scWGCNA = run.scWGCNA(p.cells = MmLimb.ps, s.cells = MmLimb.sc, features = my.f)


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