diff --git a/README.md b/README.md index 9d21ac2..430763a 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,77 @@ You can install the development version of this package through Github: devtools::install_github("Vitek-Lab/MSstatsBioNet", build_vignettes = TRUE) ``` +## Usage Examples + +Here are some examples to help you get started with MSstatsBioNet: + +### Annotate Protein Information + +Use the `annotateProteinInfoFromIndra` function to annotate a data frame with protein information from Indra. + +```r +library(MSstatsBioNet) + +# Example data frame +df <- data.frame(Protein = c("CLH1_HUMAN")) + +# Annotate protein information +annotated_df <- annotateProteinInfoFromIndra(df, "Uniprot_Mnemonic") +print(head(annotated_df)) +``` + +### Visualize Networks with Cytoscape + +Create an interactive network diagram using `cytoscapeNetwork`. + +```r +# Define nodes and edges +nodes <- data.frame( + id = c("TP53", "MDM2", "CDKN1A"), + logFC = c(1.5, -0.8, 2.1), + stringsAsFactors = FALSE +) +edges <- data.frame( + source = c("TP53", "MDM2"), + target = c("MDM2", "TP53"), + interaction = c("Activation", "Inhibition"), + stringsAsFactors = FALSE +) + +# Render the network +cytoscapeNetwork(nodes, edges) +``` + +### Export Network to HTML + +Export your network visualization to an HTML file using `exportNetworkToHTML`. + +```r +# Export the network to an HTML file +exportNetworkToHTML(nodes, edges, filename = "network.html") +``` + +### Retrieve Subnetwork from INDRA + +Use `getSubnetworkFromIndra` to retrieve a subnetwork of protein interactions from the INDRA database. + +```r +# Load example input data +input <- data.table::fread(system.file( + "extdata/groupComparisonModel.csv", + package = "MSstatsBioNet" +)) + +# Get subnetwork +subnetwork <- getSubnetworkFromIndra(input) +print(head(subnetwork$nodes)) +print(head(subnetwork$edges)) +``` + ## License -This package is distributed under the [Artistic-2.0](https://opensource.org/licenses/Artistic-2.0) license. However, its dependencies may have different licenses. +This package is distributed under the [Artistic-2.0](https://opensource.org/licenses/Artistic-2.0) license. However, its dependencies may have different licenses. -Notably, INDRA is distributed under the [BSD 2-Clause](https://opensource.org/license/bsd-2-clause) license. Furthermore, INDRA's knowledge sources may have different licenses for commercial applications. Please refer to the [INDRA README](https://github.com/sorgerlab/indra?tab=readme-ov-file#indra-modules) for more information on its knowledge sources and their associated licenses. +Notably, INDRA is distributed under the [BSD 2-Clause](https://opensource.org/license/bsd-2-clause) license. Furthermore, INDRA's knowledge sources may have different licenses for commercial applications. Please refer to the [INDRA README](https://github.com/sorgerlab/indra?tab=readme-ov-file#indra-modules) for more information on its knowledge sources and their associated licenses. ## Databases Supported @@ -36,4 +103,4 @@ Notably, INDRA is distributed under the [BSD 2-Clause](https://opensource.org/li ## Visualization Options Supported -- Cytoscape Desktop +- Cytoscape Desktop \ No newline at end of file