JaccardCoef: A function to calculate the Jaccard similarity index between...

Description Usage Arguments Details Value Author(s) Examples

View source: R/JaccardCoef.R

Description

The JaccardCoef function takes the return values of compareComplex function and calculates, for each pair of complexes C-i and K-j (where C-i is in first bipartite graph matrix and K-j is second), the similarity coefficient of Jaccard.

Usage

1
JaccardCoef(dataMat)

Arguments

dataMat

A list which is the output from compareComplex, which is a list of three matrices: intersect, cminusk, and kminusc which are explained in the details.

Details

The argument of this function is a list of three matrices all of whom are indexed exactly in the same manner - the rows of each of the matrix is indexed by the complexes, {C-i}, of the first bipartite graph, bg1, and the colunms are indexed by the complexes, {K-j} of the second bipartite graph, bg2.

The first matrix of the list is the intersect matrix, I. The (i,j) entry of I is the cardinality of complex C-i of bg1 and K-j of bg2.

The second matrix of the list is the cminusk matrix, Q. The (i,j) entry of Q is the cardinality of the set difference between C-i and K-j.

The third matrix of the list is the kminusc matrix, P. The (i,j) entry of P is the cardinality of the set difference between K-j and C-i.

The Jaccard Coefficient between two sets (here between two complexes) C-i and K-j is given by the quotient of cardinality(C-i intersect K-j) and cardinality(C-i union K-j). Note that cardinality(C-i intersect K-j) is the (i,j) entry of I, and that cardinality(C-i union K-j) is the sum of the (i,j) entry of I, Q, P.

Value

The return value is a matrix consisting of the Jaccaard coefficient for each pair of complexes C-i and K-j with rows in indexed by C-i and columns indexed by K-j.

Author(s)

Tony Chiang

Examples

1
2
3
4
5
6
#go = getGOInfo(wantAllComplexes=FALSE)
#mips = getMipsInfo(wantSubComplexes=FALSE)
#goM = createGOMatrix(go)
#mipsM = createMipsMatrix(mips)
#cc = runCompareComplex(mipsM, goM, byWhich = "ROW")
#cc$simInd

Example output

Loading required package: GO.db
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: IRanges
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid


Loading required package: RpsiXML
Loading required package: annotate
Loading required package: XML
Loading required package: graph

Attaching package: 'graph'

The following object is masked from 'package:XML':

    addNode

Loading required package: RBGL
Loading required package: hypergraph
No methods found in "Biobase" for requests: listlen
No methods found in "annotate" for requests: pubmed, buildPubMedAbst

Attaching package: 'RpsiXML'

The following object is masked from 'package:IRanges':

    members

Loading required package: apComplex

ScISI documentation built on Nov. 8, 2020, 5:48 p.m.