getClusterGene: Identifying cluster specific genes under clutering from...

Description Usage Arguments Value Examples

Description

Identifying cluster specific genes under clutering from Seurat or dbscan

Usage

1
getClusterGene(obj, method)

Arguments

obj

The list objective from the function SCcluster

method

clutering results from "Seurat" or "dbscan"

Value

\res

clustergeneA data frame including cluster specfic genes

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
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)
res=getClusterGene(obj=res,method="Seurat")

## The function is currently defined as
function (obj, method) 
{
    marker = obj$marker
    if (method == "Seurat") {
        seuratCluster = obj$seuratCluster
        gene = get_marker_genes(obj$rawdata[marker, names(seuratCluster)], 
            seuratCluster)
        gene$gene = marker
        obj$clustergene = gene
        obj$method = method
    }
    else if (method == "dbscan") {
        dbscanCluster = obj$dbscanCluster
        gene = get_marker_genes(obj$rawdata[marker, names(dbscanCluster)], 
            dbscanCluster)
        gene$gene = marker
        obj$clustergene = gene
        obj$method = method
    }
    return(obj)
  }

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