### Example: Browse OmnipathR Log (Non-runnable) Source: https://r.omnipathdb.org/reference/omnipath_log.html This example demonstrates how to call `omnipath_log()` within an `if (FALSE)` block, indicating it's a non-executable example for documentation purposes. It shows the basic usage for opening the log file. ```R if (FALSE) { # \dontrun{ omnipath_log() # then you can browse the log file, and exit with `q` } # } ``` -------------------------------- ### Example of GO slim annotation output Source: https://r.omnipathdb.org/reference/go_annot_slim.html This example demonstrates how to call the `go_annot_slim` function and print the resulting tibble, showing gene annotations with GO slim terms. ```r if (FALSE) { goslim <- go_annot_slim(organism = 'human', slim = 'generic') goslim # # A tibble: 276,371 x 8 # db db_object_id db_object_symbol go_id aspect db_object_name # # 1 UniPr. A0A024RBG1 NUDT4B GO:0. F Diphosphoinosito. # 2 UniPr. A0A024RBG1 NUDT4B GO:0. F Diphosphoinosito. # 3 UniPr. A0A024RBG1 NUDT4B GO:0. C Diphosphoinosito. # 4 UniPr. A0A024RBG1 NUDT4B GO:0. C Diphosphoinosito. # 5 UniPr. A0A024RBG1 NUDT4B GO:0. C Diphosphoinosito. # # . with 276,366 more rows, and 2 more variables: # # db_object_synonym , db_object_type } ``` -------------------------------- ### Install Nichenetr Package Source: https://r.omnipathdb.org/articles/nichenet.html Install the nichenetr package and its dependencies from GitHub. This function also installs necessary dependencies. ```r require(devtools) install_github('saeyslab/nichenetr') ``` -------------------------------- ### Example Usage of remap_tf_target_download Source: https://r.omnipathdb.org/reference/remap_tf_target_download.html This example demonstrates how to call the `remap_tf_target_download` function and inspect the resulting data frame, which contains TF-target relationships with associated scores. ```R if (FALSE) { remap_interactions <- remap_tf_target_download() remap_interactions # # A tibble: 9,546,470 x 4 # source_genesymbol target_genesymbol target_ensembl score # # 1 ADNP PTPRS ENSG00000105426.16 1000 # 2 AFF4 PRKCH ENSG00000027075.14 1000 # 3 AHR CTNND2 ENSG00000169862.18 1000 # 4 AR PDE4D ENSG00000113448.18 1000 # 5 ARID1A PLEC ENSG00000178209.14 1000 # # . with 9,546,460 more rows } ``` -------------------------------- ### Example Usage of Nichenet Ligand Activities Source: https://r.omnipathdb.org/reference/nichenet_ligand_activities.html This example demonstrates how to use the nichenet_ligand_activities function within a typical NicheNet analysis workflow. It shows the necessary preceding steps to generate the required input matrices and vectors. ```R if (FALSE) { networks <- nichenet_networks() expression <- nichenet_expression_data() optimization_results <- nichenet_optimization(networks, expression) nichenet_model <- nichenet_build_model(optimization_results, networks) lt_matrix <- nichenet_ligand_target_matrix( nichenet_model$weighted_networks, networks$lr_network, nichenet_model$optimized_parameters ) ligand_activities <- nichenet_ligand_activities( ligand_target_matrix = lt_matrix, lr_network = networks$lr_network, # the rest of the parameters should come # from your transcriptomics data: expressed_genes_transmitter = expressed_genes_transmitter, expressed_genes_receiver = expressed_genes_receiver, genes_of_interest = genes_of_interest ) } ``` -------------------------------- ### Example Usage of get_signed_ptms Source: https://r.omnipathdb.org/reference/get_signed_ptms.html This example demonstrates how to use the get_signed_ptms function. It first imports enzyme-substrate data from 'PhosphoSite' and 'SIGNOR' resources, along with general interactions, and then uses these to generate signed PTMS. ```r enzsub <- import_omnipath_enzsub(resources = c('PhosphoSite', 'SIGNOR')) interactions <- import_omnipath_interactions() enzsub <- get_signed_ptms(enzsub, interactions) ``` -------------------------------- ### Test NicheNet Pipeline Source: https://r.omnipathdb.org/articles/nichenet.html Run a test of the NicheNet pipeline with a reduced set of parameters and dummy gene sets to verify installation and environment setup. This test takes approximately 10 minutes. ```r require(OmnipathR) nichenet_workarounds() nichenet_test() ``` -------------------------------- ### Example: Get InBioMap interaction data Source: https://r.omnipathdb.org/reference/inbiomap_raw.html This is an example of how to call the `inbiomap_raw` function to obtain the interaction data. The code is set to not run by default. ```R if (FALSE) { inbiomap_psimitab <- inbiomap_raw() } ``` -------------------------------- ### guide2pharma_download() Source: https://r.omnipathdb.org/reference/index.html Downloads interactions from the Guide to Pharmacology database. ```APIDOC ## guide2pharma_download() ### Description Downloads interactions from the Guide to Pharmacology database ### Method Function Call ### Parameters None explicitly documented. ### Response Interaction data from the Guide to Pharmacology database. ``` -------------------------------- ### Install OmnipathR Package Source: https://r.omnipathdb.org/articles/bioc_workshop.html Installs the latest version of the OmnipathR package from GitHub. Ensure you have the devtools package installed. ```R library(devtools) install_github('saezlab/OmnipathR') ``` -------------------------------- ### Example of calling NicheNet workarounds Source: https://r.omnipathdb.org/reference/nichenet_workarounds.html This is an example of how to call the `nichenet_workarounds` function. It is wrapped in `if (FALSE)` to prevent execution during standard package checks. ```R if (FALSE) { nichenet_workarounds() } ``` -------------------------------- ### guide2pharma_download Source: https://r.omnipathdb.org/reference/guide2pharma_download.html Downloads ligand-receptor interactions from the Guide to Pharmacology (IUPHAR/BPS) database. ```APIDOC ## guide2pharma_download ### Description Downloads ligand-receptor interactions from the Guide to Pharmacology (IUPHAR/BPS) database (https://www.guidetopharmacology.org/). ### Usage ```R guide2pharma_download() ``` ### Value A tibble (data frame) of interactions as it is provided by the database. ### Examples ```R g2p_data <- guide2pharma_download() g2p_data ``` ``` -------------------------------- ### Download Interactions from Guide to Pharmacology Source: https://r.omnipathdb.org/reference/guide2pharma_download.html Downloads ligand-receptor interactions from the Guide to Pharmacology database. Returns a tibble of interactions. ```r guide2pharma_download() ``` ```r g2p_data <- guide2pharma_download() g2p_data ``` -------------------------------- ### Install OmnipathR Development Version Source: https://r.omnipathdb.org/index.html Installs the development version of OmnipathR directly from GitHub using the devtools package. This provides access to the latest features and updates. ```r require(devtools) install_github('saezlab/OmnipathR') ``` -------------------------------- ### nichenet_lr_network_guide2pharma Source: https://r.omnipathdb.org/reference/nichenet_lr_network_guide2pharma.html Downloads ligand-receptor interactions from the Guide to Pharmacology database and converts it to a format suitable for NicheNet. ```APIDOC ## nichenet_lr_network_guide2pharma ### Description Downloads ligand-receptor interactions from the Guide to Pharmacology database and converts it to a format suitable for NicheNet. ### Usage ```R nichenet_lr_network_guide2pharma() ``` ### Value Data frame with ligand-receptor interactions in NicheNet format. ### See also `nichenet_lr_network`, `guide2pharma_download` ### Examples ```R g2p_lr_network <- nichenet_lr_network_guide2pharma() ``` ``` -------------------------------- ### Download, cache, and remove a specific resource Source: https://r.omnipathdb.org/reference/omnipath_cache_remove.html This example demonstrates downloading a resource from a URL, caching it, and then removing the specific cache entry using its key. It ensures the resource is available and then cleans up the cache. ```R bioc_url <- 'https://bioconductor.org/' version <- omnipath_cache_latest_or_new(url = bioc_url) httr::GET(bioc_url, httr::write_disk(version$path, overwrite = TRUE)) #> Response [https://bioconductor.org/] #> Date: 2024-04-07 15:20 #> Status: 200 #> Content-Type: text/html #> Size: 37.3 kB #> /home/denes/.cache/OmnipathR/41346a00fb20d2a9df03aa70cf4d50bf88ab154a-1 omnipath_cache_download_ready(version) key <- omnipath_cache_key(bioc_url) omnipath_cache_remove(key = key) ``` -------------------------------- ### Example: Get Human Swiss-Prot Entries Source: https://r.omnipathdb.org/reference/all_uniprots.html Demonstrates fetching only the 'id' field for human reviewed UniProt entries. The output is a tibble showing entry names. ```r human_swissprot_entries <- all_uniprots(fields = 'id') human_swissprot_entries #> # A tibble: 20,426 × 1 #> `Entry Name` #> #> 1 CP2D7_HUMAN #> 2 PIOS1_HUMAN #> 3 SIK1B_HUMAN #> 4 MOTSC_HUMAN #> 5 CD3CH_HUMAN #> 6 NBDY_HUMAN #> 7 CIROP_HUMAN #> 8 S12A8_HUMAN #> 9 RBM47_HUMAN #> 10 IFT56_HUMAN #> # ℹ 20,416 more rows # # A tibble: 20,396 x 1 #> `Entry name` #> #> 1 OR4K3_HUMAN #> 2 O52A1_HUMAN #> 3 O2AG1_HUMAN #> 4 O10S1_HUMAN #> 5 O11G2_HUMAN #> # . with 20,386 more rows ``` -------------------------------- ### Parse OBO File and Inspect Results Source: https://r.omnipathdb.org/reference/obo_parser.html Demonstrates downloading a GO slim OBO file, parsing it with `obo_parser` into a list format, and inspecting the structure of the parsed data. ```R goslim_url <- "http://current.geneontology.org/ontology/subsets/goslim_generic.obo" path <- tempfile() httr::GET(goslim_url, httr::write_disk(path, overwrite = TRUE)) #> Response [http://current.geneontology.org/ontology/subsets/goslim_generic.obo] #> Date: 2024-04-07 15:00 #> Status: 200 #> Content-Type: text/obo #> Size: 115 kB #> /tmp/RtmpgsvP1J/file165a6038fedfc0 obo <- obo_parser(path, tables = FALSE) unlink(path) names(obo) #> [1] "names" "namespaces" "relations" "subsets" "obsolete" #> [6] "rel_lst_c2p" ``` ```R # [1] "names" "namespaces" "relations" "subsets" "obsolete" head(obo$relations, n = 2) #> $`GO:0000228` #> $`GO:0000228`$is_a #> [1] "GO:0005694" #> #> $`GO:0000228`$part_of #> [1] "GO:0005634" #> #> #> $`GO:0000278` #> $`GO:0000278`$has_part #> [1] "GO:0140014" #> #> # $`GO:0000001` # $`GO:0000001`$is_a # [1] "GO:0048308" "GO:0048311" # # $`GO:0000002` # $`GO:0000002`$is_a # [1] "GO:0007005" ``` -------------------------------- ### Generate Gene-Metabolite Network Source: https://r.omnipathdb.org/reference/chalmers_gem_network.html Call the function with default arguments to generate a gene-metabolite network for human. Note: This example may produce an error if the 'R.matlab' package is not installed. ```R gem <- chalmers_gem_network() #> Error in map2(.x, .y, .f, ..., .progress = .progress): ℹ In index: 1. #> ℹ With name: col_types. #> Caused by error in `loadNamespace()`: #> ! there is no package called ‘R.matlab’ ``` -------------------------------- ### Retrieve STITCH Links Dataset Source: https://r.omnipathdb.org/reference/stitch_links.html Call the stitch_links function to retrieve the default STITCH links dataset for humans. No specific setup or imports are required beyond having the package installed. ```R stl <- stitch_links() ``` -------------------------------- ### NicheNet ligand-target matrix creation Source: https://r.omnipathdb.org/reference/nichenet_ligand_target_matrix.html This example demonstrates the full workflow of building a NicheNet model and then using it to create the ligand-target matrix. It requires prior steps of fetching networks, expression data, optimizing parameters, and building the model. ```R if (FALSE) { networks <- nichenet_networks() expression <- nichenet_expression_data() optimization_results <- nichenet_optimization(networks, expression) nichenet_model <- nichenet_build_model(optimization_results, networks) lt_matrix <- nichenet_ligand_target_matrix( nichenet_model$weighted_networks, networks$lr_network, nichenet_model$optimized_parameters ) } ``` -------------------------------- ### Get ReMap interactions with a different target count Source: https://r.omnipathdb.org/reference/remap_filtered.html This example demonstrates how to use `remap_filtered` to retrieve ReMap TF-target interactions, specifically limiting the number of targets per TF to 100. The output is a tibble showing source and target gene symbols. ```R remap_interactions <- remap_filtered(top_targets = 100) remap_interactions ``` -------------------------------- ### Get Ancestors of Ontology Terms Source: https://r.omnipathdb.org/reference/ancestors.html Retrieves all ancestors (parents) of the specified ontology terms by recursively walking the ontology tree up to the root. It collects all visited nodes, which represent the ancestors of the starting nodes. The function can return either term IDs or names and allows filtering by specific relation types. ```APIDOC ## ancestors ### Description Starting from the selected nodes, recursively walks the ontology tree until it reaches the root. Collects all visited nodes, which are the ancestors (parents) of the starting nodes. ### Usage ```R ancestors( terms, db_key = "go_basic", ids = TRUE, relations = c("is_a", "part_of", "occurs_in", "regulates", "positively_regulates", "negatively_regulates") ) ``` ### Arguments * **terms** (Character vector) - Ontology term IDs or names. A mixture of IDs and names can be provided. * **db_key** (Character) - Key to identify the ontology database. For available keys see `omnipath_show_db`. * **ids** (Logical) - Whether to return IDs or term names. * **relations** (Character vector) - Ontology relation types. Only these relations will be used. ### Value Character vector of ontology IDs. If the input terms are all root nodes, `NULL` is returned. The starting nodes won't be included in the result unless some of them are ancestors of other starting nodes. ### Details Note: this function relies on the database manager, the first call might take long because of the database load process. Subsequent calls within a short period should be faster. See `get_ontology_db`. ### Examples ```R ancestors('GO:0005035', ids = FALSE) #> [1] "molecular_function" #> [2] "transmembrane signaling receptor activity" #> [3] "death receptor activity" #> [4] "signaling receptor activity" #> [5] "molecular transducer activity" # [1] "molecular_function" # [2] "transmembrane signaling receptor activity" # [3] "signaling receptor activity" # [4] "molecular transducer activity" ``` ``` -------------------------------- ### Save and Load HTML Content from Cache Source: https://r.omnipathdb.org/reference/omnipath_cache_save.html This example shows how to save HTML content downloaded from a URL to the cache and then load it back. It uses `readChar` to read the content and `url` to establish the connection. ```R bioc_url <- 'https://bioconductor.org/' bioc_html <- readChar(url(bioc_url), nchars = 99999) omnipath_cache_save(bioc_html, url = bioc_url) bioc_html <- omnipath_cache_load(url = bioc_url) ``` -------------------------------- ### Install OmnipathR from Bioconductor Source: https://r.omnipathdb.org/index.html Installs the latest stable release of the OmnipathR package from Bioconductor. Ensure BiocManager is installed first. ```r if (!requireNamespace(‘BiocManager’, quietly = TRUE)) install.packages(‘BiocManager’) ## Last release in Bioconductor BiocManager::install(‘OmnipathR’, version = ‘3.12’) ``` -------------------------------- ### preppi_download Source: https://r.omnipathdb.org/reference/index.html Downloads interactions from PrePPI. ```APIDOC ## preppi_download() ### Description Interactions from PrePPI. ### Method N/A (Function Call) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Run NicheNet Main Function with Custom Parameters Source: https://r.omnipathdb.org/reference/nichenet_main.html Use this snippet to run the `nichenet_main` function, allowing for customization of network resources and optimization parameters. It demonstrates how to exclude specific resources, override default settings, and specify the number of CPU cores for optimization. ```R if (FALSE) { nichenet_results <- nichenet_main( # altering some network resource parameters, the rest # of the resources will be loaded according to the defaults signaling_network = list( cpdb = NULL, # this resource will be excluded inbiomap = NULL, evex = list(min_confidence = 1.0) # override some parameters ), gr_network = list(only_omnipath = TRUE), n_top_ligands = 20, # override the default number of CPU cores to use mlrmbo_optimization_param = list(ncores = 4) ) } ``` -------------------------------- ### Get summary of annotations database Source: https://r.omnipathdb.org/reference/database_summary.html Call `database_summary` with 'annotations' to get a summary of the annotations database. The result is a list by default. ```r annotations_summary <- database_summary('annotations') ``` -------------------------------- ### Build NicheNet GR Network with Defaults Source: https://r.omnipathdb.org/reference/nichenet_gr_network.html Loads all network resources with their default parameters. This is the most comprehensive network prior. ```r gr_network <- nichenet_gr_network() ``` -------------------------------- ### Example of using nichenet_gr_network_remap Source: https://r.omnipathdb.org/reference/nichenet_gr_network_remap.html Demonstrates how to use the `nichenet_gr_network_remap` function with a specific `top_targets` value to limit the number of targets per transcription factor. ```R # use only max. top 100 targets for each TF: remap_gr_network <- nichenet_gr_network_remap(top_targets = 100) ``` -------------------------------- ### Get Log File Path for a Specific Package Source: https://r.omnipathdb.org/reference/omnipath_logfile.html Use the `logfile` function to get the log file path for a specified package. Defaults to 'OmnipathR'. ```R logfile(pkg = "OmnipathR") ``` -------------------------------- ### Create and retrieve a cache record Source: https://r.omnipathdb.org/reference/omnipath_cache_get.html Demonstrates creating an example cache record for a Bioconductor URL and then retrieving it using `omnipath_cache_get`. Includes cleanup of the created record. ```R # create an example cache record bioc_url <- 'https://bioconductor.org/' version <- omnipath_cache_latest_or_new(url = bioc_url) omnipath_cache_remove(url = bioc_url) # cleaning up # retrieve the cache record record <- omnipath_cache_get(url = bioc_url) record$key #> [1] "41346a00fb20d2a9df03aa70cf4d50bf88ab154a" # [1] "41346a00fb20d2a9df03aa70cf4d50bf88ab154a" record$url #> [1] "https://bioconductor.org/" # [1] "https://bioconductor.org/" ``` -------------------------------- ### Get Complex Resources - R Source: https://r.omnipathdb.org/reference/get_complex_resources.html Call this function to get the names of complex databases available on Omnipath.org. The `dataset` argument is ignored for this query type. ```r get_complex_resources() ``` -------------------------------- ### Install Required R Packages Source: https://r.omnipathdb.org/articles/paths.html Checks for and installs missing R packages required for the OmnipathR package and its dependencies. Ensures all necessary libraries are available before proceeding. ```R library(OmnipathR) library(magrittr) library(dplyr) library(purrr) library(igraph) library(rlang) library(tidyselect) library(stringr) library(rmarkdown) ``` ```R missing_packages <- setdiff( c( 'magrittr', 'dplyr', 'purrr', 'igraph', 'rlang', 'tidyselect', 'stringr', 'rmarkdown', 'devtools' ), installed.packages() ) if(length(missing_packages)){ install.packages(missing_packages) } if(!'OmnipathR' %in% installed.packages()){ library(devtools) devtools::install_github('saezlab/OmnipathR') } ``` -------------------------------- ### Build NicheNet LR Network with Defaults Source: https://r.omnipathdb.org/reference/nichenet_lr_network.html Loads all network resources with default parameters. This is the most common usage. ```r lr_network <- nichenet_lr_network() ``` -------------------------------- ### Build human PKN for COSMOS Source: https://r.omnipathdb.org/reference/cosmos_pkn.html Downloads, processes, and combines resources to build the human prior knowledge network. This operation can take a significant amount of time, especially on the first run. ```R if (FALSE) { # \dontrun{ human_cosmos <- cosmos_pkn(organism = "human") } # } ``` -------------------------------- ### Download Ligand-Receptor Network from Guide to Pharmacology Source: https://r.omnipathdb.org/reference/nichenet_lr_network_guide2pharma.html Use this function to download ligand-receptor interactions from the Guide to Pharmacology database. The output is a data frame formatted for NicheNet. ```R g2p_lr_network <- nichenet_lr_network_guide2pharma() ``` -------------------------------- ### Load Package Configuration Source: https://r.omnipathdb.org/reference/omnipath_load_config.html Use `omnipath_load_config` or `load_config` to load package settings from a specified configuration file. The `path` argument specifies the file, `title` selects a specific configuration within the file, and `user` can force the use of user-level configurations. ```R omnipath_load_config(path = NULL, title = "default", user = FALSE, ...) load_config( path = NULL, title = "default", user = FALSE, pkg = "OmnipathR", ... ) ``` ```R omnipath_load_config(path = 'my_custom_omnipath_config.yml') ``` -------------------------------- ### Run NicheNet Main with Small Network Option Source: https://r.omnipathdb.org/articles/nichenet.html Initiates the NicheNet analysis using a pre-defined small network option, which utilizes a high-quality subset of OmniPath data for faster testing. ```r nichenet_results <- nichenet_main(small = TRUE) ``` -------------------------------- ### zenodo_download Source: https://r.omnipathdb.org/reference/index.html Retrieves data from Zenodo. ```APIDOC ## zenodo_download() ### Description Retrieves data from Zenodo. ### Method N/A (Function Call) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Get Interaction Resources - R Source: https://r.omnipathdb.org/reference/get_interaction_resources.html Retrieves the names of available interaction databases from Omnipath.org. Call without arguments to get all available resources, or specify a dataset for a filtered list. ```r get_interaction_resources(dataset = NULL) ``` -------------------------------- ### Retrieve KEGG Database Entries Source: https://r.omnipathdb.org/reference/kegg_api_templates.html This example demonstrates how to retrieve information about database entries from KEGG. It shows the structure of the returned data, including available database types. ```r ddi <- keggGet("drug") ddi[[1]] ddi[[1]]$dbentries ``` -------------------------------- ### Custom stitch_network example Source: https://r.omnipathdb.org/reference/stitch_network.html An example of calling stitch_network with custom protein and metabolite ID types. This call specifically requests 'genesymbol' for proteins and 'hmdb' for metabolites, while using default values for other parameters. ```R stn <- stitch_network(protein_ids = 'genesymbol', metabolite_ids = 'hmdb') ``` -------------------------------- ### Build Complete COSMOS Protein-Kinase Network (PKN) Source: https://r.omnipathdb.org/articles/cosmos.html Constructs the complete COSMOS PKN by integrating various data resources. This function can take a significant amount of time but benefits from caching. Use this for the final network build. ```r pkn <- cosmos_pkn() pkn ``` -------------------------------- ### Get OmnipathR Log File Path Source: https://r.omnipathdb.org/reference/omnipath_logfile.html Retrieves the path to the current log file for the OmnipathR package. It can also be used to get the log file path for other packages by specifying the `pkg` argument. ```APIDOC ## Function: omnipath_logfile ### Description Path to the current OmnipathR log file. ### Usage ```R omnipath_logfile() logfile(pkg = "OmnipathR") ``` ### Arguments #### pkg - **pkg** (Character) - Required - Name of a package. ### Value Character: path to the current logfile, or `NULL` if no logfile is available. ### Examples ```R omnipath_logfile() #> [1] "/home/denes/omnipathr/omnipathr-log/omnipathr-20241201-2047.log" # [1] "/home/denes/omnipathr/omnipathr-log/omnipathr-20210309-1642.log" ``` ``` -------------------------------- ### Load a built-in database Source: https://r.omnipathdb.org/reference/load_db.html Loads a specified built-in database. Use 'omnipath_show_db()' to see available databases and their keys. The loaded database is accessible via 'get_db()'. ```R load_db('go_slim') ``` ```R omnipath_show_db() #> # A tibble: 23 × 10 #> name last_used lifetime package loader loader_param latest_param #> #> 1 Gene O… 2024-04-07 17:01:07 300 Omnipa… go_on… #> 2 Gene O… NA 300 Omnipa… go_on… #> 3 Gene O… NA 300 Omnipa… go_on… #> 4 Gene O… NA 300 Omnipa… go_on… #> 5 Gene O… 2024-04-07 17:05:01 300 Omnipa… go_on… #> 6 Gene O… NA 300 Omnipa… go_on… #> 7 Gene O… NA 300 Omnipa… go_on… #> 8 Gene O… NA 300 Omnipa… go_on… #> 9 Gene O… NA 300 Omnipa… go_on… #> 10 Gene O… NA 300 Omnipa… go_on… #> # ℹ 13 more rows #> # ℹ 3 more variables: loaded , db , key ``` -------------------------------- ### Run NicheNet Main with Quality Filtering Parameters Source: https://r.omnipathdb.org/articles/nichenet.html Executes the main NicheNet analysis pipeline, applying custom quality filtering parameters for the ligand-receptor network. ```r nichenet_results <- nichenet_main( quality_filter_param = list( min_curation_effort = 1, consensus_percentile = 30 ) ) ``` -------------------------------- ### Example: Clean UniProt Gene Symbols Source: https://r.omnipathdb.org/reference/uniprot_genesymbol_cleanup.html This example demonstrates how to use the `uniprot_genesymbol_cleanup` function with a specific TrEMBL ID and organism. The output is a data frame showing the input ID and its corresponding SwissProt ID if a mapping is found. ```r if (FALSE) { uniprot_genesymbol_cleanup('Q6PB82', organism = 10090) # # A tibble: 1 × 2 # input output # # 1 Q6PB82 O70405 } ``` -------------------------------- ### ramp_sqlite Source: https://r.omnipathdb.org/reference/index.html Downloads and opens the RaMP database as an SQLite file. ```APIDOC ## ramp_sqlite() ### Description Download and open RaMP database SQLite. ### Method N/A (Function Call) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Get UniProt ID type label Source: https://r.omnipathdb.org/reference/uniprot_id_type.html Use `uniprot_id_type` to get the UniProt specific ID type label for a given identifier type. This label can be used in UniProt REST queries. If the label cannot be translated, the input is returned unchanged. ```R uniprot_id_type("entrez") #> [1] "entrez" # [1] "database(GeneID)" ``` -------------------------------- ### Get Descendants of Ontology Terms Source: https://r.omnipathdb.org/reference/descendants.html Retrieves all descendant terms (children) of the specified ontology terms. Use `ids = FALSE` to get term names instead of IDs. The function can be slow on the first call due to database loading. ```R descendants('GO:0005035', ids = FALSE) #> [1] "tumor necrosis factor receptor activity" #> [2] "death receptor activity" #> [3] "TRAIL receptor activity" #> [4] "TNFSF11 receptor activity" # [1] "tumor necrosis factor-activated receptor activity" # [2] "TRAIL receptor activity" # [3] "TNFSF11 receptor activity" ``` -------------------------------- ### Run the NicheNet pipeline with a little dummy network Source: https://r.omnipathdb.org/reference/nichenet_test.html Loads a tiny network and runs the NicheNet pipeline with a low number of iterations for testing. This function is intended to ensure the computational integrity of the pipeline. ```APIDOC ## nichenet_test() ### Description Loads a tiny network and runs the NicheNet pipeline with a low number of iterations in the optimization process. This way the pipeline runs in a reasonable time in order to test the code. Due to the random subsampling disconnected networks might be produced sometimes. If you see an error like "Error in if (sd(prediction_vector) == 0) ... missing value where TRUE/FALSE needed", the random subsampled input is not appropriate. In this case just interrupt and call again. This test ensures the computational integrity of the pipeline. If it fails during the optimization process, try to start it over several times, even restarting R. The unpredictability is related to `mlrMBO` and `nichenetr` not being prepared to handle certain conditions, and it's also difficult to find out which conditions lead to which errors. At least 3 different errors appear time to time, depending on the input. It also seems like restarting R sometimes helps, suggesting that the entire system might be somehow stateful. You can ignore the ` Parallelization was not stopped` warnings on repeated runs. ### Usage ```R nichenet_test(...) ``` ### Arguments `...` Passed to `nichenet_main`. ### Value A named list with the intermediate and final outputs of the pipeline: `networks`, `expression`, `optimized_parameters`, `weighted_networks` and `ligand_target_matrix`. ### Examples ```R if (FALSE) { nnt <- nichenet_test() } ``` ``` -------------------------------- ### Print Interactions with Default Settings Source: https://r.omnipathdb.org/reference/print_interactions.html Prints a subset of enzyme-substrate interactions. Includes a warning for uninitialized columns. ```R enzsub <- enzyme_substrate() print_interactions(head(enzsub)) ``` -------------------------------- ### Build NicheNet Signaling Network Source: https://r.omnipathdb.org/reference/nichenet_signaling_network_vinayagam.html Generates a signaling network data frame for NicheNet. The example shows a basic call to the function. Note that the example output indicates an HTTP 403 error, suggesting potential access issues with the supplementary data. ```R vi_signaling_network <- nichenet_signaling_network_vinayagam() #> Error in (function (url, post = NULL, ...) { httr <- handle_name <- NULL http_param %<>% ensure_list_2 content_param %<>% ensure_list_2 http_method <- if (is.null(post)) GET else POST http_param$body <- post req_headers %<>% list_null http_param %<>% c(list(add_headers(.headers = unlist(req_headers)), handle = structure(list(handle = new_handle(CONNECTTIMEOUT = getOption("omnipath.connect_timeout")), url = (httr %:::% handle_name)(url))), class = "handle"))) if (!is.null(path)) { http_param %<>% c(list(write_disk(path, overwrite = TRUE))) } response <- exec(http_method, url = url, !!!http_param) http_status <- status_code(response) msg <- sprintf("HTTP %i", http_status) if (http_status != 200L) { log_warn(msg) stop(msg) } log_trace(msg) result <- FALSE if (return_response) { result <- response } else { if (is.null(path) && !ignore_contents) { result <- exec(content, response, !!!content_param) %>% reader(...) } } if (keep_headers) { attr(result, "headers") <- headers(response) } return(result)})("https://www.science.org/action/downloadSupplement?doi=10.1126%2Fscisignal.2001699&file=4_rs8_tables_s1_s2_and_s6.zip"): HTTP 403 ``` -------------------------------- ### walk_ontology_tree Source: https://r.omnipathdb.org/reference/index.html Retrieves all nodes of a subtree starting from the selected nodes. ```APIDOC ## walk_ontology_tree() ### Description All nodes of a subtree starting from the selected nodes. ### Method N/A (Function Call) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ```