getMNN: Mutual nearest coexpressed gene pairs

Description Usage Arguments Value See Also Examples

Description

Idenitify mutual nearest expressed gene pairs based on binary expression data

Usage

1
getMNN(HamD, genename, k, n)

Arguments

HamD

A matrix from multiplicate of binary data tcrossprod(binadata) and diag are zero.

genename

The rownames and colnames of matrix HamD

k

The maximum number that how many nearest neighbors would be considered.

n

The minimum number which is the coexpressed cells for each gene pairs

Value

A list including the MNN nearest neighbors which co-expressed in more than MNNindex samples.

See Also

getMarker

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data(melanoma)
melanoma1=as.matrix(melanoma[,2:dim(melanoma)[2]])
row.names(melanoma1)=melanoma[,1]
res=ModalFilter(data=melanoma1,geneK=10,cellK=10,width=2,cutoff=2)
res=GeneFilter(obj=res)
data = filterres$data
data = res$newdata
binadata = res$binadata
genename = row.names(binadata)
HamD = tcrossprod(binadata)
diag(HamD) = 0
marker = getMNN(HamD = HamD, genename = genename,
        k = 200, n = 20)

## The function is currently defined as
function (HamD, genename, k, n)
{
    MNNgene = lapply(1:dim(HamD)[1], RankGene, k = k, HamD = HamD,
        geneName = genename, n = n)
    genePair = unique(as.character(do.call(cbind, lapply(1:length(MNNgene),
        MNNpair, MNNgene = MNNgene, geneName = genename))))
    return(genePair)
  }

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