SPIN: A wrapper function for SPIN sorting method

Description Usage Arguments Value Examples

Description

A wrapper function for SPIN method provides a R version of SPIN [Tsafrir et al. 2005].

Usage

1
SPIN(data, sorting_method = c("STS", "neighborhood"), sigma_width = 1)

Arguments

data

An log2 transformed expresssion matrix containing n-rows of cells and m-cols of genes.

sorting_method

A character string indicating the choice of sorting method, i.e. 'STS' (Side-to-Side) or 'Neighborhood'.

sigma_width

An integer number determining the degree of spread of the gaussian distribution which is used for computing weight matrix for Neighborhood sorting method.

Value

A data frame containing single column of ordered sample IDs.

Examples

1
2
3
4
5
6
7
8
9
set.seed(15)
da <- iris[sample(150, 150, replace = FALSE), ]
rownames(da) <- paste0('spl_',seq(1,nrow(da)))
d <- da[,1:4]
dl <- da[,5,drop=FALSE]
res <- SPIN(data = d)
dl <- dl[match(res$SampleID,rownames(dl)),]
annot <- data.frame(id = seq(1,nrow(res)), label=dl, stringsAsFactors = FALSE)
#ggplot(annot, aes(x=id, y=id, colour = label)) + geom_point() + theme_bw()

JinmiaoChenLab/uSORT documentation built on May 7, 2019, 10:53 a.m.