getFactorMarkers: Find shared and dataset-specific markers

View source: R/factorMarker.R

getFactorMarkersR Documentation

Find shared and dataset-specific markers

Description

Applies various filters to genes on the shared (W) and dataset-specific (V) components of the factorization, before selecting those which load most significantly on each factor (in a shared or dataset-specific way).

Usage

getFactorMarkers(
  object,
  dataset1,
  dataset2,
  factorShareThresh = 10,
  datasetSpecificity = NULL,
  logFCThresh = 1,
  pvalThresh = 0.05,
  nGenes = 30,
  printGenes = FALSE,
  verbose = getOption("ligerVerbose", TRUE),
  factor.share.thresh = factorShareThresh,
  dataset.specificity = datasetSpecificity,
  log.fc.thresh = logFCThresh,
  pval.thresh = pvalThresh,
  num.genes = nGenes,
  print.genes = printGenes
)

Arguments

object

liger object with factorization results.

dataset1

Name of first dataset. Required.

dataset2

Name of second dataset. Required

factorShareThresh

Numeric. Only factors with a dataset specificity less than or equal to this threshold will be used. Default 10.

datasetSpecificity

Numeric vector. Pre-calculated dataset specificity if available. Length should match number of all factors available. Default NULL automatically calculates with calcDatasetSpecificity.

logFCThresh

Numeric. Lower log-fold change threshold for differential expression in markers. Default 1.

pvalThresh

Numeric. Upper p-value threshold for Wilcoxon rank test for gene expression. Default 0.05.

nGenes

Integer. Max number of genes to report for each dataset. Default 30.

printGenes

Logical. Whether to print ordered markers passing logFC, UMI and frac thresholds, when verbose = TRUE. Default FALSE.

verbose

Logical. Whether to show information of the progress. Default getOption("ligerVerbose") or TRUE if users have not set.

factor.share.thresh, dataset.specificity, log.fc.thresh, pval.thresh, num.genes, print.genes

Deprecated. See Usage section for replacement.

Value

A list object consisting of the following entries:

value of \code{dataset1}

data.frame of dataset1-specific markers

shared

data.frame of shared markers

value of \code{dataset1}

data.frame of dataset2-specific markers

num_factors_V1

A frequency table indicating the number of factors each marker appears, in dataset1

num_factors_V2

A frequency table indicating the number of factors each marker appears, in dataset2

Examples

library(dplyr)
result <- getFactorMarkers(pbmcPlot, dataset1 = "ctrl", dataset2 = "stim")
print(class(result))
print(names(result))
result$shared %>% group_by(factor_num) %>% top_n(2, logFC)

rliger documentation built on Oct. 30, 2024, 1:07 a.m.