### Generate and Plot GO Reduced Terms Wordcloud Source: https://ssayols.github.io/rrvgo/reference/wordcloudPlot.html This example demonstrates a full workflow: reading GO analysis data, calculating a similarity matrix, setting scores based on q-values, reducing the similarity matrix, and finally plotting the reduced terms as a word cloud. Ensure the necessary packages and databases (e.g., org.Hs.eg.db) are installed. ```R go_analysis <- read.delim(system.file("extdata/example.txt", package="rrvgo")) simMatrix <- calculateSimMatrix(go_analysis$ID, orgdb="org.Hs.eg.db", ont="BP", method="Rel") #> preparing gene to GO mapping data... #> preparing IC data... scores <- setNames(-log10(go_analysis$qvalue), go_analysis$ID) reducedTerms <- reduceSimMatrix(simMatrix, scores, threshold=0.7, orgdb="org.Hs.eg.db") #> 'select()' returned 1:many mapping between keys and columns wordcloudPlot(reducedTerms, min.freq=1, colors="black") ``` -------------------------------- ### Example: Reduce GO Terms with Custom Scores Source: https://ssayols.github.io/rrvgo/reference/reduceSimMatrix.html This example demonstrates how to use reduceSimMatrix with custom scores derived from p-values. It first reads example data, calculates a similarity matrix, computes scores by -log10 transforming q-values, and then reduces the GO terms. Ensure the 'org.Hs.eg.db' package is installed and loaded. ```R go_analysis <- read.delim(system.file("extdata/example.txt", package="rrvgo")) simMatrix <- calculateSimMatrix(go_analysis$ID, orgdb="org.Hs.eg.db", ont="BP", method="Rel") scores <- setNames(-log10(go_analysis$qvalue), go_analysis$ID) reducedTerms <- reduceSimMatrix(simMatrix, scores, threshold=0.7, orgdb="org.Hs.eg.db") ``` -------------------------------- ### Example Usage of treemapPlot Source: https://ssayols.github.io/rrvgo/reference/treemapPlot.html Demonstrates how to use treemapPlot after performing GO analysis, calculating a similarity matrix, and reducing terms. This example requires the 'rrvgo' and 'org.Hs.eg.db' packages. ```R if (FALSE) { # \dontrun{ go_analysis <- read.delim(system.file("extdata/example.txt", package="rrvgo")) simMatrix <- calculateSimMatrix(go_analysis$ID, orgdb="org.Hs.eg.db", ont="BP", method="Rel") scores <- setNames(-log10(go_analysis$qvalue), go_analysis$ID) reducedTerms <- reduceSimMatrix(simMatrix, scores, threshold=0.7, orgdb="org.Hs.eg.db") treemapPlot(reducedTerms) } # } ``` -------------------------------- ### Install rrvgo Package Source: https://ssayols.github.io/rrvgo/index.html Install the rrvgo package using BiocManager. Ensure BiocManager is installed first if you haven't already. ```R if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("rrvgo") ``` -------------------------------- ### Calculate Similarity Matrix Example Source: https://ssayols.github.io/rrvgo/reference/calculateSimMatrix.html Example of using calculateSimMatrix to compute the similarity matrix between GO terms. Requires the 'rrvgo' and 'org.Hs.eg.db' packages. Ensure the example.txt file is available in the 'extdata' directory of the 'rrvgo' package. ```R go_analysis <- read.delim(system.file("extdata/example.txt", package="rrvgo")) simMatrix <- calculateSimMatrix(go_analysis$ID, orgdb="org.Hs.eg.db", ont="BP", method="Rel") #> #> preparing gene to GO mapping data... #> preparing IC data... ``` -------------------------------- ### Example Usage of gg_color_hue Source: https://ssayols.github.io/rrvgo/reference/gg_color_hue.html Demonstrates how to use the gg_color_hue function to generate colors for plotting points. This example is wrapped in a \dontrun{} block, indicating it should not be run automatically during package checks. ```R if (FALSE) { # \dontrun{ plot(1:10, pch=16, cex=2, col=gg_color_hue(10)) } # } ``` -------------------------------- ### Launch rrvgo Shiny Interface Source: https://ssayols.github.io/rrvgo/reference/shiny_rrvgo.html Starts the interactive web interface. Additional arguments are passed directly to shiny::runApp(). ```R shiny_rrvgo(...) ``` -------------------------------- ### Generate Heatmap from Similarity Matrix Source: https://ssayols.github.io/rrvgo/reference/heatmapPlot.html Example workflow calculating a similarity matrix and plotting it using heatmapPlot. ```R go_analysis <- read.delim(system.file("extdata/example.txt", package="rrvgo")) simMatrix <- calculateSimMatrix(go_analysis$ID, orgdb="org.Hs.eg.db", ont="BP", method="Rel") #> preparing gene to GO mapping data... #> preparing IC data... scores <- setNames(-log10(go_analysis$qvalue), go_analysis$ID) reducedTerms <- reduceSimMatrix(simMatrix, scores, threshold=0.7, orgdb="org.Hs.eg.db") #> 'select()' returned 1:many mapping between keys and columns heatmapPlot(simMatrix, reducedTerms, annotateParent=TRUE, annotationLabel="parentTerm", fontsize=6) ``` -------------------------------- ### Generate a GO term scatter plot Source: https://ssayols.github.io/rrvgo/reference/scatterPlot.html Example workflow for calculating a similarity matrix and visualizing reduced GO terms using scatterPlot. ```R go_analysis <- read.delim(system.file("extdata/example.txt", package="rrvgo")) simMatrix <- calculateSimMatrix(go_analysis$ID, orgdb="org.Hs.eg.db", ont="BP", method="Rel") #> preparing gene to GO mapping data... #> preparing IC data... scores <- setNames(-log10(go_analysis$qvalue), go_analysis$ID) reducedTerms <- reduceSimMatrix(simMatrix, scores, threshold=0.7, orgdb="org.Hs.eg.db") #> 'select()' returned 1:many mapping between keys and columns scatterPlot(simMatrix, reducedTerms) #> Warning: ggrepel: 10 unlabeled data points (too many overlaps). Consider increasing max.overlaps ``` -------------------------------- ### View rrvgo Vignette Source: https://ssayols.github.io/rrvgo/index.html Access the package documentation and vignettes locally within R. This provides detailed examples and usage instructions. ```R browseVignettes("rrvgo") ``` -------------------------------- ### Get GO Term Description Source: https://ssayols.github.io/rrvgo/reference/getGoTerm.html Retrieves the description of a specified GO term. ```APIDOC ## GET /go/term/{term_id} ### Description Retrieves the description of a GO term given its identifier. ### Method GET ### Endpoint /go/term/{term_id} ### Parameters #### Path Parameters - **term_id** (string) - Required - The GO term identifier (e.g., 'GO:0008150'). ### Response #### Success Response (200) - **description** (string) - The description of the GO term. #### Response Example ```json { "description": "biological_process" } ``` ``` -------------------------------- ### Load an orgdb Object Source: https://ssayols.github.io/rrvgo/reference/loadOrgdb.html Use this function to load an orgdb object from one of the org.* Bioconductor packages. Ensure the specified package is installed. ```R loadOrgdb(orgdb) ``` -------------------------------- ### gg_color_hue Function Source: https://ssayols.github.io/rrvgo/reference/gg_color_hue.html Generates a color palette by spacing hues equally around the color wheel, starting from 15. ```APIDOC ## gg_color_hue ### Description Emulate ggplot2 color palette by generating equally spaced hues around the color wheel. ### Parameters - **n** (integer) - Required - The number of colors to generate. ### Value - Returns a vector of alphanumeric color codes. ### Request Example ```r gg_color_hue(10) ``` ### Response Example ```r [1] "#F8766D" "#D39200" "#93AA00" "#00BA38" "#00C19F" "#00B9E3" "#619CFF" "#DB72FB" "#FF61C3" "#FF61C3" ``` ``` -------------------------------- ### Create Custom OrgDb Object Source: https://ssayols.github.io/rrvgo/articles/rrvgo.html If an organism is not supported by Bioconductor, create a custom OrgDb object using AnnotationForge and GOSemSim. This allows for semantic similarity calculations with new species. ```r my_new_fancy_orgdb_object <- 'org.Zz.eg.db' hsGO <- GOSemSim::godata(my_new_fancy_orgdb_object, ont="MF") ``` -------------------------------- ### shiny_rrvgo Function Source: https://ssayols.github.io/rrvgo/reference/shiny_rrvgo.html Launches an interactive web interface using the shiny_rrvgo function. Additional parameters can be passed to shiny::runApp(). ```APIDOC ## shiny_rrvgo() ### Description Launches an interactive web interface. ### Method Function Call ### Endpoint N/A (R function) ### Arguments `...` - Other parameters sent to `shiny::runApp()`. ### Value Nothing ``` -------------------------------- ### Launch Shiny App Source: https://ssayols.github.io/rrvgo/articles/rrvgo.html Call shiny_rrvgo() to launch an interactive Shiny app for exploring rrvgo plots and tables. This provides an accessible interface for non-technical users. ```r rrvgo::shiny_rrvgo() ``` -------------------------------- ### Visualize GO terms with a scatter plot Source: https://ssayols.github.io/rrvgo/articles/rrvgo.html Plots GO terms as points where distances represent semantic similarity, using PCoA on the dissimilarity matrix. ```R scatterPlot(simMatrix, reducedTerms) ``` -------------------------------- ### Generate Word Cloud Plot Source: https://ssayols.github.io/rrvgo/articles/rrvgo.html Use wordcloudPlot to visualize the frequency of GO terms. This can help identify common processes and functions. Parameters like min.freq and colors can be adjusted. ```r wordcloudPlot(reducedTerms, min.freq=1, colors="black") ``` -------------------------------- ### Calculate GO term similarity matrix Source: https://ssayols.github.io/rrvgo/articles/rrvgo.html Computes the semantic similarity matrix between a list of GO terms using a specified OrgDb object and ontology. ```R library(rrvgo) go_analysis <- read.delim(system.file("extdata/example.txt", package="rrvgo")) simMatrix <- calculateSimMatrix(go_analysis$ID, orgdb="org.Hs.eg.db", ont="BP", method="Rel") ``` -------------------------------- ### Visualize similarity matrix as a heatmap Source: https://ssayols.github.io/rrvgo/articles/rrvgo.html Generates a heatmap of the similarity matrix with optional parent term annotation. ```R heatmapPlot(simMatrix, reducedTerms, annotateParent=TRUE, annotationLabel="parentTerm", fontsize=6) ``` -------------------------------- ### Reduce GO Terms by Similarity and Scores Source: https://ssayols.github.io/rrvgo/reference/reduceSimMatrix.html Use this function to group GO terms that are highly similar and select a representative term for each group based on provided scores or default metrics like uniqueness and size. Ensure the simMatrix is square and scores are appropriately formatted if custom scores are used. ```R reduceSimMatrix( simMatrix, scores = c("uniqueness", "size"), threshold = 0.7, orgdb, keytype = "ENTREZID", children = TRUE ) ``` -------------------------------- ### Generate Treemap Plot Source: https://ssayols.github.io/rrvgo/articles/rrvgo.html Use treemapPlot to create a space-filling visualization of hierarchical GO terms. The size of each term is proportional to its score, and terms are grouped by their parent. ```r treemapPlot(reducedTerms) ``` -------------------------------- ### loadOrgdb Function Source: https://ssayols.github.io/rrvgo/reference/loadOrgdb.html Documentation for the loadOrgdb function used to load an orgdb object. ```APIDOC ## loadOrgdb ### Description Loads an orgdb object from one of the org.* Bioconductor packages. ### Parameters #### Arguments - **orgdb** (string) - Required - One of the org.* Bioconductor packages. ### Value The loaded orgdb object. ``` -------------------------------- ### scatterPlot Function Source: https://ssayols.github.io/rrvgo/reference/scatterPlot.html Visualizes GO terms as scattered points where distances represent term similarity. ```APIDOC ## scatterPlot ### Description Plot GO terms as scattered points based on a similarity matrix and reduced terms. ### Parameters - **simMatrix** (matrix) - Required - A square similarity matrix. - **reducedTerms** (data.frame) - Required - A data.frame with the reduced terms from reduceSimMatrix(). - **algorithm** (string) - Optional - Algorithm for dimensionality reduction. Either "pca" or "umap". - **onlyParents** (boolean) - Optional - If TRUE, plot only parent terms. - **size** (string) - Optional - Metric for point size, either "size" or "score". - **addLabel** (boolean) - Optional - Whether to add labels with the most representative term. - **labelSize** (numeric) - Optional - Text size for the labels. ### Value - **ggplot2 object** - A plot object ready to be printed or manipulated. ### Request Example scatterPlot(simMatrix, reducedTerms, algorithm="pca", onlyParents=FALSE, size="score", addLabel=TRUE, labelSize=3) ``` -------------------------------- ### wordcloudPlot Function Source: https://ssayols.github.io/rrvgo/reference/wordcloudPlot.html Generates a wordcloud plot from reduced GO terms. ```APIDOC ## wordcloudPlot ### Description Plots GO reduced terms as a wordcloud. ### Arguments - **reducedTerms** (data.frame) - Required - A data.frame with the reduced terms from reduceSimMatrix(). - **onlyParents** (boolean) - Optional - Use only parent terms to calculate frequencies. Defaults to TRUE. - **...** (dots) - Optional - Other parameters sent to wordcloud::wordcloud(). ### Value Nothing ### Example ```r go_analysis <- read.delim(system.file("extdata/example.txt", package="rrvgo")) simMatrix <- calculateSimMatrix(go_analysis$ID, orgdb="org.Hs.eg.db", ont="BP", method="Rel") scores <- setNames(-log10(go_analysis$qvalue), go_analysis$ID) reducedTerms <- reduceSimMatrix(simMatrix, scores, threshold=0.7, orgdb="org.Hs.eg.db") wordcloudPlot(reducedTerms, min.freq=1, colors="black") ``` ``` -------------------------------- ### Reduce GO terms based on similarity Source: https://ssayols.github.io/rrvgo/articles/rrvgo.html Groups GO terms based on a similarity threshold and selects a representative term for each group based on provided scores. ```R scores <- setNames(-log10(go_analysis$qvalue), go_analysis$ID) reducedTerms <- reduceSimMatrix(simMatrix, scores, threshold=0.7, orgdb="org.Hs.eg.db") ``` -------------------------------- ### Plot GO Reduced Terms as Wordcloud Source: https://ssayols.github.io/rrvgo/reference/wordcloudPlot.html Use wordcloudPlot to visualize GO reduced terms. Pass the reducedTerms data frame and set onlyParents to TRUE to use only parent terms for frequency calculation. Additional parameters can be passed to the wordcloud::wordcloud function. ```R wordcloudPlot(reducedTerms, onlyParents = TRUE, ...) ``` -------------------------------- ### calculateSimMatrix Function Signature Source: https://ssayols.github.io/rrvgo/reference/calculateSimMatrix.html This is the function signature for calculateSimMatrix. It takes GO terms, an organism database, and optional parameters for key type, semantic data, ontology, similarity method, and inclusion of terms without IC. ```R calculateSimMatrix( x, orgdb, keytype = "ENTREZID", semdata = GOSemSim::godata(annoDb = orgdb, ont = ont, keytype = keytype), ont = c("BP", "MF", "CC"), method = c("Resnik", "Lin", "Rel", "Jiang", "Wang"), include_terms_without_IC = FALSE ) ``` -------------------------------- ### heatmapPlot Function Source: https://ssayols.github.io/rrvgo/reference/heatmapPlot.html Visualizes a similarity matrix as a heatmap, supporting optional annotations for parent terms. ```APIDOC ## heatmapPlot ### Description Plots a similarity matrix as a heatmap. This function is designed to visualize the similarity scores between terms. ### Parameters - **simMatrix** (matrix) - Required - A square similarity matrix. - **reducedTerms** (data.frame) - Optional - A data.frame containing reduced terms from reduceSimMatrix(). - **annotateParent** (boolean) - Optional - Whether to add annotation of the parent term. Defaults to TRUE. - **annotationLabel** (string) - Optional - Display "parent" ids or "parentTerm" string. Defaults to "parentTerm". - **...** (dots) - Optional - Other parameters passed to pheatmap::pheatmap(). ### Value Returns invisibly a pheatmap object that is a list with components. ### Request Example heatmapPlot(simMatrix, reducedTerms, annotateParent=TRUE, annotationLabel="parentTerm", fontsize=6) ``` -------------------------------- ### Cite rrvgo Package Source: https://ssayols.github.io/rrvgo/articles/rrvgo.html Use citation("rrvgo") to obtain the correct citation for the rrvgo package. This ensures proper attribution when using the package in research publications. ```r citation("rrvgo") ``` -------------------------------- ### getGoSize Function Source: https://ssayols.github.io/rrvgo/reference/getGoSize.html Retrieves the number of genes associated with specified GO terms using an orgdb object. ```APIDOC ## getGoSize ### Description Get GO term size (# of genes). ### Parameters - **terms** (vector) - Required - GO terms to query. - **orgdb** (object/string) - Required - One of org.* Bioconductor packages (the package name, or the package itself). - **keytype** (string) - Required - Keytype passed to AnnotationDbi::keys to retrieve GO terms associated to gene ids in your orgdb. - **children** (boolean) - Required - Include genes in children terms (based on relationships in the GO DAG hierarchy). ### Value - **number** (integer) - Number of genes associated with each term. ``` -------------------------------- ### rrvgo Function Reference Source: https://ssayols.github.io/rrvgo/reference/index.html A collection of functions for processing and visualizing Gene Ontology (GO) term semantic similarity. ```APIDOC ## Function Reference ### calculateSimMatrix - **Description**: Calculate the score similarity matrix between terms. ### getGoSize - **Description**: Get GO term size (# of genes). ### getGoTerm - **Description**: Get the description of a GO term. ### getTermDisp - **Description**: Calculate the term dispensability score, defined as the semantic similarity threshold a term was assigned to a cluster. ### getTermUniq - **Description**: Calculate the term uniqueness score, defined as 1 minus the average semantic similarity of a term to all other terms. ### gg_color_hue - **Description**: Emulate ggplot2 color palette. ### heatmapPlot - **Description**: Plot similarity matrix as a heatmap. ### loadOrgdb - **Description**: Load an orgdb object. ### reduceSimMatrix - **Description**: Reduce a set of GO terms based on their semantic similarity and scores. ### scatterPlot - **Description**: Plot GO terms as scattered points. ### shiny_rrvgo - **Description**: Launch an interactive web interface. ### treemapPlot - **Description**: Plot GO terms as a treemap. ### wordcloudPlot - **Description**: Plot GO reduced terms as a wordcloud. ``` -------------------------------- ### gg_color_hue Function Signature Source: https://ssayols.github.io/rrvgo/reference/gg_color_hue.html Defines the signature of the gg_color_hue function, which takes the number of colors 'n' as an argument. ```R gg_color_hue(n) ``` -------------------------------- ### heatmapPlot Function Signature Source: https://ssayols.github.io/rrvgo/reference/heatmapPlot.html Defines the parameters for the heatmapPlot function, including the similarity matrix and optional annotation settings. ```R heatmapPlot( simMatrix, reducedTerms = NULL, annotateParent = TRUE, annotationLabel = "parentTerm", ... ) ``` -------------------------------- ### treemapPlot Function Source: https://ssayols.github.io/rrvgo/reference/treemapPlot.html Plots Gene Ontology (GO) terms as a treemap based on their similarity scores. ```APIDOC ## treemapPlot treemapPlot ### Description Plots GO terms as a treemap. ### Method Function Call ### Endpoint N/A (R function) ### Parameters #### Arguments - **reducedTerms** (data.frame) - Required - A data.frame with the reduced terms from reduceSimMatrix() - **size** (string) - Optional - What to use as point size. Can be either GO term's "size" or "score". Defaults to "score". - **title** (string) - Optional - Title of the plot. Defaults to nothing. - **...** - Optional - Other parameters sent to treemap::treemap() ### Value A list from the call to the `treemap()` function is silently returned. ### Examples ```R if (FALSE) { # \dontrun{ go_analysis <- read.delim(system.file("extdata/example.txt", package="rrvgo")) simMatrix <- calculateSimMatrix(go_analysis$ID, orgdb="org.Hs.eg.db", ont="BP", method="Rel") scores <- setNames(-log10(go_analysis$qvalue), go_analysis$ID) reducedTerms <- reduceSimMatrix(simMatrix, scores, threshold=0.7, orgdb="org.Hs.eg.db") treemapPlot(reducedTerms) } ``` ``` -------------------------------- ### treemapPlot Function Signature Source: https://ssayols.github.io/rrvgo/reference/treemapPlot.html Signature for the treemapPlot function, used for plotting GO terms as a treemap. Accepts reduced terms, size parameter, and an optional title. ```R treemapPlot(reducedTerms, size = "score", title = "", ...) ``` -------------------------------- ### calculateSimMatrix Source: https://ssayols.github.io/rrvgo/reference/calculateSimMatrix.html Calculates the score similarity matrix between terms. ```APIDOC ## calculateSimMatrix ### Description Calculate the score similarity matrix between terms. ### Method `calculateSimMatrix` ### Arguments - **x** (vector) - GO terms - **orgdb** (string) - one of org.* Bioconductor packages (the package name, or the package itself) - **keytype** (string, optional) - keytype passed to AnnotationDbi::keys to retrieve GO terms associated to gene ids in your orgdb. Default: "ENTREZID" - **semdata** (object, optional) - object with prepared GO DATA for measuring semantic similarity. Default: GOSemSim::godata(annoDb = orgdb, ont = ont, keytype = keytype) - **ont** (vector, optional) - ontology. One of c("BP", "MF", "CC"). Default: c("BP", "MF", "CC") - **method** (vector, optional) - distance method. One of the supported methods by GOSemSim: c("Resnik", "Lin", "Rel", "Jiang", "Wang"). Default: c("Resnik", "Lin", "Rel", "Jiang", "Wang") - **include_terms_without_IC** (boolean, optional) - whether to include terms for which there's no Information Content in OrgDb. NOTE: Including them can mess up with the algorithm that aggregates the distances. Default: FALSE. ### Value a square matrix with similarity scores between terms ### Details All similarity measures available are those implemented in the [GOSemSim package](https://www.bioconductor.org/packages/release/bioc/html/GOSemSim.html), namely the Resnik, Lin, Relevance, Jiang and Wang methods. See the [Semantic Similarity Measurement Based on GO](https://www.bioconductor.org/packages/release/bioc/vignettes/GOSemSim/inst/doc/GOSemSim.html#semantic-similarity-measurement-based-on-go) section from the GOSeSim documentation for more details. ### Examples ```R go_analysis <- read.delim(system.file("extdata/example.txt", package="rrvgo")) simMatrix <- calculateSimMatrix(go_analysis$ID, orgdb="org.Hs.eg.db", ont="BP", method="Rel") ``` ``` -------------------------------- ### reduceSimMatrix Function Source: https://ssayols.github.io/rrvgo/reference/reduceSimMatrix.html Reduces a set of Gene Ontology (GO) terms based on their semantic similarity and provided scores. It groups terms with similarity above a threshold and selects a representative term for each group based on scores like 'uniqueness' or 'size'. ```APIDOC ## reduceSimMatrix Function ### Description Reduces a set of GO terms based on their semantic similarity and scores. It groups terms with similarity above a threshold and selects a representative term for each group based on scores like 'uniqueness' or 'size'. ### Method Function call (R) ### Parameters #### Arguments - **simMatrix** (matrix) - A square similarity matrix. - **scores** (character or named vector) - One of c("uniqueness", "size"), or a named vector with scores for each term. Higher values favor the term as a representative. Defaults to c("uniqueness", "size"). - **threshold** (numeric) - Similarity threshold (0-1). Defaults to 0.7. - **orgdb** (character or object) - An org.* Bioconductor package name or object. - **keytype** (character) - Keytype passed to AnnotationDbi::keys to retrieve GO terms associated to gene ids in your orgdb. Defaults to "ENTREZID". - **children** (boolean) - When retrieving GO term size, include genes in children terms. Defaults to TRUE. ### Details Groups terms which are at least within a similarity below `threshold`. Decides which term remains based on a score. If no score is provided, then decides based on the "uniqueness" or the term "size". Currently, rrvgo uses the similarity between pairs of terms to compute a distance matrix, defined as (1-simMatrix). The terms are then hierarchically clustered using complete linkage, and the tree is cut at the desired threshold, picking the term with the highest score as the representative of each group. Therefore, higher thresholds lead to fewer groups, and the threshold should be read as the minimum similarity between group representatives. ### Request Example ```R go_analysis <- read.delim(system.file("extdata/example.txt", package="rrvgo")) simMatrix <- calculateSimMatrix(go_analysis$ID, orgdb="org.Hs.eg.db", ont="BP", method="Rel") scores <- setNames(-log10(go_analysis$qvalue), go_analysis$ID) reducedTerms <- reduceSimMatrix(simMatrix, scores, threshold=0.7, orgdb="org.Hs.eg.db") ``` ### Response #### Value A data.frame identifying the different clusters of terms, the parent term representing the cluster, and some metrics of importance describing how unique and dispensable a term is. ``` -------------------------------- ### Calculate term dispensability score Source: https://ssayols.github.io/rrvgo/reference/getTermDisp.html Computes the dispensability score for terms based on their similarity to a cluster representative. ```R getTermDisp(simMatrix, cluster, clusterRep) ``` -------------------------------- ### Define scatterPlot function signature Source: https://ssayols.github.io/rrvgo/reference/scatterPlot.html The function signature for scatterPlot, showing available parameters for dimensionality reduction and labeling. ```R scatterPlot( simMatrix, reducedTerms, algorithm = c("pca", "umap"), onlyParents = FALSE, size = "score", addLabel = TRUE, labelSize = 3 ) ``` -------------------------------- ### getTermUniq Function Source: https://ssayols.github.io/rrvgo/reference/getTermUniq.html Calculates the term uniqueness score, defined as 1 minus the average semantic similarity of a term to all other terms. ```APIDOC ## GET /calculate/termUniqueness ### Description Calculates the term uniqueness score, defined as 1 minus the average semantic similarity of a term to all other terms. ### Method GET ### Endpoint /calculate/termUniqueness ### Parameters #### Query Parameters - **simMatrix** (matrix) - Required - A square similarity matrix. - **cluster** (vector) - Optional - A vector with the cluster each entry in the simMatrix belongs to. If NULL, no clustering is applied. ### Response #### Success Response (200) - **uniqueness_scores** (vector) - A vector of term uniqueness scores. ``` -------------------------------- ### Calculate Term Uniqueness Score Source: https://ssayols.github.io/rrvgo/reference/getTermUniq.html Use getTermUniq to calculate the term uniqueness score. Provide a square similarity matrix and an optional cluster vector. Returns a vector of term uniqueness scores. ```R getTermUniq(simMatrix, cluster = NULL) ``` -------------------------------- ### getTermDisp Function Source: https://ssayols.github.io/rrvgo/reference/getTermDisp.html Calculates the term dispensability score. The dispensability score is defined as the semantic similarity threshold a term was assigned to a cluster (namely, the similarity of a term to the cluster representative term). ```APIDOC ## getTermDisp Function ### Description Calculates the term dispensability score, defined as the semantic similarity threshold a term was assigned to a cluster (namely, the similarity of a term to the cluster representative term). ### Method Function Call ### Endpoint N/A (R function) ### Parameters #### Arguments - **simMatrix** (matrix) - A square similarity matrix. - **cluster** (vector) - The cluster assignment for each term. - **clusterRep** (vector) - The cluster representative term. ### Value - **vector** - A vector of term dispensability scores. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.