clusterSNE: Implementation of BH-SNE on RNA-Seq data.

Usage Arguments Examples

View source: R/clusterSNE.R

Usage

1
clusterSNE(data.set, perp, dim, tha, pc, iter, seed)

Arguments

data.set

Normalized RNA-Seq data set.

perp

Initial perplexity value provided to Rtsne. (See Rtsne documentation)

dim

Number of final dimensions. Typically 2 or 3.

tha

Theta value for Rtsne. Value should be between 0 and 1, with lower values more accurate but requiring significantly longer processing times. Default = 0.3. (See Rtsne documentation)

pc

Whether to perform a PCA on the data prior to BH-SNE. Default = FALSE.

iter

Number of iterations to perform. Default = 1000.

seed

Set seed for reproducability of results. Defualt = 0.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## The function is currently defined as
function (data.set, perp, dim, tha, pc, iter, seed) 
{
    set.seed(seed)
    Rdis.sne = Rtsne(data.set, perplexity = perp, dims = dim, 
        theta = tha, initial_dims = ncol(data.set), check_duplicates = FALSE, 
        pca = pc, verbose = TRUE, max_iter = iter)
    Rdis.sne = as.data.frame(Rdis.sne[1:6])
    colnames(Rdis.sne) = c("Theta", "Perplexity", "N", "orgD", 
        "x", "y", "Costs")
    rownames(Rdis.sne) = rownames(data.set)
    p = ggplot(Rdis.sne, aes(x, y)) + theme_bw() + theme(panel.grid.major = element_blank(), 
        panel.grid.minor = element_blank(), panel.background = element_blank()) + 
        geom_point(size = 2, pch = 21, fill = "grey") + theme(legend.position = "none")
    print(p)
    return(Rdis.sne)
  }

sdrowland/RSMod documentation built on July 17, 2021, 7:16 p.m.