geneSim: Similarity score genes based on pathways similarity

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/geneSim.R

Description

Given two genes, calculates the Dice similarity between each pathway which is combined to obtain a similarity between the genes.

Usage

1
2
3
geneSim(gene1, gene2, info, method = "max", ...)

mgeneSim(genes, info, method = "max", ...)

Arguments

gene1, gene2

Ids of the genes to calculate the similarity, to be found in genes.

info

A list of genes and the pathways they are involved.

method

To combine the scores of each pathway, one of c("avg", "max", "rcmax", "rcmax.avg", "BMA"), if NULL returns the matrix of similarities.

...

Other arguments passed to combineScores

genes

A vector of genes.

Details

Given the information about the genes and their pathways, uses the ids of the genes to find the Dice similarity score for each pathway comparison between the genes. Later this similarities are combined using combineScores.

Value

The highest Dice score of all the combinations of pathways between the two ids compared if a method to combine scores is provided or NA if there isn't information for one gene. If an NA is returned this means that there isn't information available for any pathways for one of the genes. Otherwise a number between 0 and 1 (both included) is returned. Note that there isn't a negative value of similarity.

mgeneSim returns the matrix of similarities between the genes in the vector

Note

genes accept named characters and the output will use the names of the genes.

Author(s)

Lluis Revilla

See Also

conversions help page to transform Dice score to Jaccard score. For the method to combine the scores see combineScores.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
if (require("org.Hs.eg.db") & require("reactome.db")) {
    # Extract the paths of all genes of org.Hs.eg.db from KEGG
    # (last update in data of June 31st 2011)
    genes.kegg <- as.list(org.Hs.egPATH)
    # Extracts the paths of all genes of org.Hs.eg.db from reactome
    genes.react <- as.list(reactomeEXTID2PATHID)
    geneSim("81", "18", genes.react)
    geneSim("81", "18", genes.kegg)
    geneSim("81", "18", genes.react, NULL)
    geneSim("81", "18", genes.kegg, NULL)
} else {
    warning('You need reactome.db and org.Hs.eg.db package for this example')
}

mgeneSim(c("81", "18", "10"), genes.react)
mgeneSim(c("81", "18", "10"), genes.react, "avg")
named_genes <- structure(c("81", "18", "10"),
.Names = c("ACTN4", "ABAT", "NAT2"))
mgeneSim(named_genes, genes.react, "max")

Bioconductor-mirror/BioCor documentation built on May 29, 2017, 12:07 a.m.