RunSWNE: Wrapper for running SWNE analysis

View source: R/run_swne.R

RunSWNER Documentation

Wrapper for running SWNE analysis

Description

Wrapper for running SWNE analysis

Usage

## S3 method for class 'cisTopic'
RunSWNE(
  cisTopicObject,
  proj.method = "sammon",
  cells.use = NULL,
  dist.metric = "cosine",
  n.cores = 8,
  hide.factors = T,
  n_pull = 3,
  alpha.exp = 1.25,
  snn.exp = 1,
  snn.k = 20,
  prune.SNN = 1/15,
  use.paga.pruning = T,
  sample.groups = NULL,
  paga.qval.cutoff = 0.001
)

## S3 method for class 'Seurat'
RunSWNE(
  object,
  proj.method = "sammon",
  reduction.use = "pca",
  cells.use = NULL,
  dims.use = NULL,
  genes.use = NULL,
  dist.metric = "cosine",
  distance.matrix = NULL,
  n.cores = 8,
  k,
  k.range,
  var.genes,
  loss = "mse",
  genes.embed,
  hide.factors = T,
  n_pull = 3,
  ica.fast = T,
  alpha.exp = 1.25,
  snn.exp = 1,
  snn.k = 10,
  use.paga.pruning = T,
  sample.groups = NULL,
  paga.qval.cutoff = 0.001,
  reduction.name = "swne",
  reduction.key = "SWNE_",
  return.format = "embedding",
  ...
)

## S3 method for class 'Pagoda2'
RunSWNE(
  object,
  proj.method = "sammon",
  dist.metric = "cosine",
  n.cores = 8,
  k,
  k.range,
  var.genes,
  loss = "mse",
  genes.embed,
  hide.factors = T,
  n_pull = 3,
  ica.fast = T,
  n.var.genes = 3000,
  alpha.exp = 1.25,
  snn.exp = 1,
  snn.k = 20,
  use.paga.pruning = T,
  sample.groups = NULL,
  paga.qval.cutoff = 0.001
)

## S3 method for class 'dgCMatrix'
RunSWNE(
  data.matrix,
  proj.method = "sammon",
  dist.metric = "cosine",
  n.cores = 3,
  k,
  k.range,
  var.genes,
  loss = "mse",
  genes.embed,
  hide.factors = T,
  n_pull = 3,
  ica.fast = T,
  alpha.exp = 1.25,
  snn.exp = 1,
  snn.k = 20,
  use.paga.pruning = T,
  sample.groups = NULL,
  paga.qval.cutoff = 0.001
)

## S3 method for class 'matrix'
RunSWNE(
  data.matrix,
  proj.method = "sammon",
  dist.metric = "cosine",
  n.cores = 8,
  k,
  k.range,
  var.genes = rownames(data.matrix),
  loss = "mse",
  genes.embed,
  hide.factors = T,
  n_pull = 3,
  alpha.exp = 1.25,
  snn.exp = 1
)

## S3 method for class 'dgTMatrix'
RunSWNE(
  data.matrix,
  proj.method = "sammon",
  dist.metric = "cosine",
  n.cores = 3,
  k,
  k.range,
  var.genes = rownames(data.matrix),
  loss = "mse",
  genes.embed,
  hide.factors = T,
  n_pull = 3,
  alpha.exp = 1.25,
  snn.exp = 1
)

Arguments

proj.method

Method to use to project factors in 2D. Either "sammon" or "umap"

cells.use

Which cells to analyze (default, all cells)

n.cores

Number of cores to use (passed to FindNumFactors)

hide.factors

Hide factors when plotting SWNE embedding

n_pull

Maximum number of factors "pulling" on each sample

alpha.exp

Increasing alpha.exp increases how much the NMF factors "pull" the samples (passed to EmbedSWNE)

snn.exp

Decreasing snn.exp increases the effect of the similarity matrix on the embedding (passed to EmbedSWNE)

snn.k

Changes the number of nearest neighbors used to build SNN (passed to CalcSNN)

prune.SNN

The minimum fraction of shared nearest neighbors (smaller values are set to zero)

use.paga.pruning

Use PAGA graphs to prune

sample.groups

Clusters to use for PAGA (default is to do a de-novo clustering)

paga.qval.cutoff

q-value cutoff for significant shared edges between clusters

object

A Seurat, Pagoda2 or cisTopicObject object with normalized data

reduction.use

Which dimensional reduction (e.g. PCA, ICA) to use for the tSNE. Default is PCA.

dims.use

Which dimensions to use as input features

genes.use

If set, run the SWNE on this subset of genes (instead of running on a set of reduced dimensions). Not set (NULL) by default

distance.matrix

If set, runs tSNE on the given distance matrix instead of data matrix (experimental)

k

Number of NMF factors (passed to RunNMF). If none given, will be derived from FindNumFactors.

k.range

Range of factors for FindNumFactors to iterate over if k is not given

var.genes

vector to specify variable genes. Will infer from Seurat or use full dataset if not given.

loss

loss function to use (passed to RunNMF)

genes.embed

Genes to add to the SWNE embedding

ica.fast

Whether to run SVD before ICA initialization

reduction.name

dimensional reduction name, specifies the position in the object$dr list. swne by default

reduction.key

dimensional reduction key, specifies the string before the number for the dimension names. SWNE_ by default

return.format

format to return ("seurat" object or raw "embedding")

n.var.genes

Number of variable genes to use

data.matrix

a data matrix (genes x cells) which has been pre-normalized

batch

Vector of batch IDs to regress away

dist.use

Similarity function to use for calculating factor positions (passed to EmbedSWNE). Options include pearson (correlation), IC (mutual information), cosine, euclidean.

Value

A list of factor (H.coords) and sample coordinates (sample.coords) in 2D


yanwu2014/swne documentation built on Aug. 5, 2023, 4:42 a.m.