A method to scale a matrix of distance scores with the GO term similarity of the associated genesets.

scaleGO(
  scores,
  geneset_ids,
  method = "Wang",
  ontology = "BP",
  species = "org.Hs.eg.db",
  BPPARAM = BiocParallel::SerialParam()
)

Arguments

scores

a Matrix::Matrix(), a matrix of (distance) scores for the identifiers in geneset_ids.

geneset_ids

list, a list of GO identifiers to score

method

character, the method to calculate the GO similarity. See GOSemSim::goSim measure parameter for possibilities.

ontology

character, the ontology to use. See GOSemSim::goSim ont parameter for possibilities.

species

character, the species of your data. Indicated as org.XX.eg.db package from Bioconductor.

BPPARAM

A BiocParallelParam object specifying how parallelization should be handled

Value

A Matrix::Matrix() of scaled values.

Examples

## Mock example showing how the data should look like
go_ids <- c("GO:0002503", "GO:0045087", "GO:0019886",
            "GO:0002250", "GO:0001916", "GO:0019885")
set.seed(42)
scores <- Matrix::Matrix(stats::runif(36, min = 0, max = 1), 6, 6)
similarity <- scaleGO(scores,
                      go_ids)
#> Warning: use 'annoDb' instead of 'OrgDb'
#> preparing gene to GO mapping data...
#> preparing IC data...

## Example using the data available in the package
data(scores_macrophage_topGO_example_small, package = "GeDi")
data(macrophage_topGO_example_small, package = "GeDi")
go_ids <- macrophage_topGO_example_small$Genesets
if (FALSE) {
scores_scaled <- scaleGO(scores_macrophage_topGO_example_small,
                         go_ids)
}