SCcluster: Application in Seurat cluster using markers selected from...

Usage Arguments Value Examples

Usage

1
SCcluster(obj)

Arguments

obj

The list objective from the function getMarker

Value

\res

tsnetSNE embeding from Seurat \resseuratClusterCluster results from Seurat \resdbscanClusterCluster results from dbscan

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
data(melanoma)
melanoma1=as.matrix(melanoma[,2:dim(melanoma)[2]])
row.names(melanoma1)=melanoma[,1]
res=ModalFilter(data=melanoma1,geneK=10,cellK=10)
res=GeneFilter(obj=res)
res=getMarker(obj=res,MNN=200,MNNIndex=20)
res=SCcluster(obj=res)
## The function is currently defined as
function (obj)
{
    data=obj$rawdata
    gene=row.names(data)
    gene=unique(gene)
    index=match(gene,row.names(data))
    data=data[index,]
    marker = obj$marker
    pbmc <- CreateSeuratObject(raw.data = data, min.cells = 3,
        min.genes = 200, project = "project")
    pbmc <- NormalizeData(object = pbmc, normalization.method = "LogNormalize",
        scale.factor = 10000)
    pbmc <- FindVariableGenes(object = pbmc, mean.function = ExpMean,
        dispersion.function = LogVMR, x.low.cutoff = 0.0125,
        x.high.cutoff = 3, y.cutoff = 0.5)
    pbmc <- ScaleData(object = pbmc)
    pbmc <- RunPCA(object = pbmc, pc.genes = gene, do.print = TRUE,
        pcs.print = 1:5, genes.print = 5)
    pbmc <- FindClusters(object = pbmc, reduction.type = "pca",
        dims.use = 1:8, resolution = 0.6, print.output = 0, save.SNN = TRUE,
        force.recalc = TRUE)
    pbmc <- RunTSNE(object = pbmc, dims.use = 1:15, do.fast = TRUE)
    TSNE = pbmc@dr$tsne@cell.embeddings
    seuratCluster = pbmc@ident
    dbscanCluster = dbscan(TSNE, eps = 1.2, minPts = 15)$cluster
    names(dbscanCluster) = row.names(TSNE)
    obj$tsne = TSNE
    obj$seuratCluster = seuratCluster
    obj$dbscanCluster = dbscanCluster
    return(obj)
  }

Fang0828/SCMarker documentation built on May 13, 2019, 12:51 p.m.