scUnifrac_multi: scUnifrac_multi

Description Usage Arguments Value Examples

View source: R/scUnifrac.R

Description

Quantify pairwise cell population diversity between multiple (>=2) single cell RNA-seq datasets

Usage

1
2
scUnifrac_multi(dataall, group, genenum = 500, ncluster = 10, nDim = 4,
  normalize = T)

Arguments

dataall

matrix; the combined data matrix of all datasets, row is the gene symbol, the column is the cell id

group

a vector; giving the sample id/name to which each cell belongs to

genenum

integer; Number of highly variable genes to build the cell population structure (default: 500)

ncluster

integer; Number of clusters to divide cells (default: 10)

nDim

integer; Number of PCA dimensions to build the cell population structure (default: 4)

normalize

logical; Indicate whether normalize data1 and data2 (default: TRUE, normalize to the total count and log2 transform)

Value

List with the following elements:

distance

The pairwise distance matrix of cell population diversity among single-cell RNA-seq datasets

pvalue

The statistical signficance matrix of the distance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(scUnifrac)  
##load the two example datasets 
load(system.file("extdata", "colon1.Rdata", package = "scUnifrac"))
load(system.file("extdata", "pan1.Rdata", package = "scUnifrac"))
##generate two datasets from the colon data
colon1_1<-colon1[,1:500]
colon1_2<-colon1[,501:1000]
## run scUnifrac_multi on three datasets, two from the colon, one from the pancreas
result<-scUnifrac_multi(dataall=cbind(colon1_1,colon1_2,pan1),group=c(rep("c1",500),rep("c2",500),rep("pan",ncol(pan1))))  
result

liuqivandy/scUnifrac documentation built on Jan. 21, 2021, 2:02 p.m.