Skip to content

Commit

Permalink
update shiny app
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspershen committed Dec 29, 2023
1 parent 218d386 commit 1094ffd
Show file tree
Hide file tree
Showing 18 changed files with 406 additions and 1,323 deletions.
4 changes: 3 additions & 1 deletion R/18-report_functional_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ report_functional_module <-
interpretation_result,
path = ".",
type = c("html", "pdf", "word", "md", "all")) {
# browser()
if (missing(object)) {
stop("object is missing")
}
Expand All @@ -75,7 +76,7 @@ report_functional_module <-
as.numeric(stringr::str_extract(
grep(pattern = "Report", dir(path), value = TRUE),
"[0-9]{1,10}"
))
)), na.rm = TRUE
)

if(is.na(idx)){
Expand Down Expand Up @@ -265,6 +266,7 @@ report_functional_module <-
interpretation_result <- "> No interpretation result is provided."
}

# browser()
##transform rmd to HTML or pdf
if (type == "html" | type == "all") {
rmarkdown::render(
Expand Down

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
28 changes: 21 additions & 7 deletions inst/shinyapp/files/introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,34 @@ output:
toc_float:
collapsed: false
smooth_scroll: true
number_sections: true
number_sections: false
date: "2023-12-25"
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# R Markdown
# Module Annotation for Pathway Analysis

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
The R package "MAPA" represents a significant advancement in the field of bioinformatics, particularly in the analysis of RNA-seq and proteomics data. Developed by Dr. Xiaotao Shen, this tool is available on GitHub at [https://github.com/jaspershen/mapa](https://github.com/jaspershen/mapa).

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
MAPA is designed to perform pathway enrichment analysis, a crucial step in understanding the biological significance of large-scale experimental data. By analyzing RNA-seq and proteomics datasets, MAPA helps identify enriched biological pathways, providing insights into the molecular mechanisms underlying specific diseases or phenotypic expressions.

```{r cars}
summary(cars)
```
One of the standout features of MAPA is its ability to reduce redundancy in biological information. It achieves this by merging enriched pathways into coherent modules and functional modules This not only simplifies the interpretation of complex datasets but also provides a clearer understanding of the biological processes at play.

Additionally, MAPA leverages the capabilities of large language models like ChatGPT to interpret and contextualize the biological results. This integration allows for a more nuanced and comprehensive analysis, aligning the computational findings with biological relevance to specific diseases or phenotypes.

Overall, MAPA serves as an essential tool for researchers and scientists in the field of bioinformatics, offering a sophisticated yet user-friendly approach to pathway analysis and interpretation. Its ability to distill complex datasets into meaningful biological insights is invaluable for advancing our understanding of various biological processes and disease mechanisms.

# Contacts

If you have any questions about MAPA, please contact Dr. Xiaotao Shen.

<i class="fa fa-weixin"></i> [shenzutao1990](https://www.shenxt.info/files/wechat_QR.jpg)

<i class="fa fa-envelope"></i> [email protected]

<i class="fa fa-twitter"></i> [Twitter](https://twitter.com/JasperShen1990)

<i class="fa fa-map-marker-alt"></i> [M339, Alway building, Cooper Lane, Palo Alto, CA 94304](https://www.google.com/maps/place/Alway+Building/@37.4322345,-122.1770883,17z/data=!3m1!4b1!4m5!3m4!1s0x808fa4d335c3be37:0x9057931f3b312c29!8m2!3d37.4322345!4d-122.1748996)
55 changes: 38 additions & 17 deletions inst/shinyapp/files/introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -353,23 +353,44 @@
</div>


<div id="r-markdown" class="section level1" number="1">
<h1><span class="header-section-number">1</span> R Markdown</h1>
<p>This is an R Markdown document. Markdown is a simple formatting
syntax for authoring HTML, PDF, and MS Word documents. For more details
on using R Markdown see <a href="http://rmarkdown.rstudio.com" class="uri">http://rmarkdown.rstudio.com</a>.</p>
<p>When you click the <strong>Knit</strong> button a document will be
generated that includes both content as well as the output of any
embedded R code chunks within the document. You can embed an R code
chunk like this:</p>
<pre class="r"><code>summary(cars)</code></pre>
<pre><code>## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00</code></pre>
<div id="module-annotation-for-pathway-analysis" class="section level1">
<h1>Module Annotation for Pathway Analysis</h1>
<p>The R package “MAPA” represents a significant advancement in the
field of bioinformatics, particularly in the analysis of RNA-seq and
proteomics data. Developed by Dr. Xiaotao Shen, this tool is available
on GitHub at <a href="https://github.com/jaspershen/mapa">https://github.com/jaspershen/mapa</a>.</p>
<p>MAPA is designed to perform pathway enrichment analysis, a crucial
step in understanding the biological significance of large-scale
experimental data. By analyzing RNA-seq and proteomics datasets, MAPA
helps identify enriched biological pathways, providing insights into the
molecular mechanisms underlying specific diseases or phenotypic
expressions.</p>
<p>One of the standout features of MAPA is its ability to reduce
redundancy in biological information. It achieves this by merging
enriched pathways into coherent modules and functional modules This not
only simplifies the interpretation of complex datasets but also provides
a clearer understanding of the biological processes at play.</p>
<p>Additionally, MAPA leverages the capabilities of large language
models like ChatGPT to interpret and contextualize the biological
results. This integration allows for a more nuanced and comprehensive
analysis, aligning the computational findings with biological relevance
to specific diseases or phenotypes.</p>
<p>Overall, MAPA serves as an essential tool for researchers and
scientists in the field of bioinformatics, offering a sophisticated yet
user-friendly approach to pathway analysis and interpretation. Its
ability to distill complex datasets into meaningful biological insights
is invaluable for advancing our understanding of various biological
processes and disease mechanisms.</p>
</div>
<div id="contacts" class="section level1">
<h1>Contacts</h1>
<p>If you have any questions about MAPA, please contact Dr. Xiaotao
Shen.</p>
<p><i class="fa fa-weixin"></i> <a href="https://www.shenxt.info/files/wechat_QR.jpg">shenzutao1990</a></p>
<p><i class="fa fa-envelope"></i> <a href="mailto:[email protected]" class="email">[email protected]</a></p>
<p><i class="fa fa-twitter"></i> <a href="https://twitter.com/JasperShen1990">Twitter</a></p>
<p><i class="fa fa-map-marker-alt"></i> <a href="https://www.google.com/maps/place/Alway+Building/@37.4322345,-122.1770883,17z/data=!3m1!4b1!4m5!3m4!1s0x808fa4d335c3be37:0x9057931f3b312c29!8m2!3d37.4322345!4d-122.1748996">M339,
Alway building, Cooper Lane, Palo Alto, CA 94304</a></p>
</div>


Expand Down
76 changes: 66 additions & 10 deletions inst/shinyapp/files/tutorials.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,87 @@
title: ""
output:
html_document:
toc: true
toc: false
toc_float:
collapsed: false
smooth_scroll: true
number_sections: true
number_sections: false
date: "2023-12-25"
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# Upload data
# Introduction

## Data preparation
MAPA is a Shiny application designed for analyzing and visualizing biological data, especially in the context of pathways and networks. This tutorial will walk you through the steps of using MAPA for data upload, enrichment, merging, visualization, interpretation, and reporting.

## Data format
This tutorial provides a step-by-step guide to using the MAPA Shiny app for biological data analysis. Each tab in the app is dedicated to a specific aspect of the analysis, ensuring a structured and comprehensive approach to data processing and visualization. Remember to explore various options and parameters to tailor the analysis to your specific needs.

# Enrich pathways
# Step 1: Data Upload and ID Mapping

# Merge pathways
1. **Upload Data**:
- Navigate to the "Upload Data" tab.
- Use `fileInput` to upload your data in CSV or Excel format. You can also check "Use example" to work with preloaded data.
- Select the type of ID your data contains (ENSEMBL, UniProt, or EntrezID).

# Merge Modules
2. **ID Mapping**:
- Click "Submit" to map IDs using the `clusterProfiler` and `org.Hs.eg.db` packages.
- The mapped data will appear in a table. You can download it by clicking "Download".

# Data visualization
# Step 2: Enrich Pathways

1. **Select Databases and Parameters**:
- In the "Enrich Pathways" tab, choose the databases (GO, KEGG, Reactome) for pathway enrichment.
- Set parameters like organism, P-value cutoff, adjustment method, and gene set size.

2. **Run Enrichment**:
- Click "Submit" to start the enrichment process.
- Once completed, results for each selected database will appear in separate tabs. These can be downloaded.

# Step 3: Merge Pathways

1. **Set Merging Criteria**:
- Go to the "Merge Pathways" tab.
- Adjust parameters like P-adjust cutoff, gene count cutoff, similarity cutoff, and similarity method for each database.

2. **Merge and Visualize**:
- Click "Submit" to merge pathways.
- View the merged pathways in the result table and download if needed.
- You can also visualize the pathways by clicking on the “Generate plot” buttons under each database tab.

# Step 4: Merge Modules

1. **Merge Functional Modules**:
- In the "Merge Modules" tab, set the similarity cutoff and method.
- Click "Submit" to merge.
- View and download the merged module results.

2. **Visualize Merged Modules**:
- Generate a plot for the merged modules using provided controls for customization.

# Step 5: Data Visualization

1. **Customized Plots**:
- The "Data Visualization" tab offers various plotting options (Barplot, Module Similarity Network, etc.).
- Customize your plot using the available options and generate it.
- Use the download button to save your plot.

# Step 6: LLM Interpretation

1. **Generate Interpretations**:
- Navigate to "LLM Interpretation".
- Provide an OpenAI Key for GPT-3 access, select your disease or phenotype, and set the interpretation parameters.
- Click "Submit" to get an interpretation of your data using GPT-3.

# Step 7: Results and Reporting

1. **Generate Report**:
- In the "Results and Report" tab, click on "Generate report" to compile your analysis results.
- View the report in the app or download it.

2. **Code Access**:
- Throughout the process, you can view the R code for each step by clicking the "Code" button. This is useful for understanding the underlying computations or for advanced customization.

# Results and report

1,306 changes: 124 additions & 1,182 deletions inst/shinyapp/files/tutorials.html

Large diffs are not rendered by default.

Loading

0 comments on commit 1094ffd

Please sign in to comment.