runSeurat: standard seurat preprocessing step

View source: R/runSeurat.R

runSeuratR Documentation

standard seurat preprocessing step

Usage

runSeurat(counts, gene.use = FALSE, resolution)

Arguments

counts
gene.use
resolution

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (counts, gene.use = FALSE, resolution) 
{
    require(Seurat)
    tmp <- CreateSeuratObject(counts = counts)
    tmp <- tmp[-grep("^RPS", rownames(tmp)), ]
    tmp <- tmp[-grep("^RPL", rownames(tmp)), ]
    tmp <- NormalizeData(tmp)
    tmp <- FindVariableFeatures(tmp)
    if (!gene.use) {
        gene.use <- VariableFeatures(tmp)
    }
    else {
        gene.use <- gene.use[gene.use %in% rownames(tmp)]
    }
    tmp <- ScaleData(tmp, features = gene.use)
    tmp <- RunPCA(tmp, features = gene.use)
    tmp <- FindNeighbors(tmp, dims = 1:10)
    tmp <- FindClusters(tmp, resolution = resolution)
    tmp <- RunTSNE(tmp, dims = 1:10, check_duplicates = FALSE)
    return(tmp)
  }

lkmklsmn/empty_nn documentation built on Jan. 30, 2024, 1:31 a.m.