-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvisualize_domain_enrichments.Rmd
115 lines (90 loc) · 3.8 KB
/
visualize_domain_enrichments.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
```{r}
library(shiny)
library(visNetwork)
options(shiny.trace = TRUE)
```
# Domains
## {.sidebar data-width="200" .opening-page-text}
#### Legend
<p class='options-text'><b>Kinase groups by color</b></p>
```{r}
imageOutput('legend4',height="auto")
output$legend4 <- renderImage({
list(src='img/kinase_families_legend2.png',width="100%",padding="0px 0px 5px 0px")
},deleteFile=FALSE)
```
#### Include more proteins
```{r,cache=FALSE}
checkboxInput(inputId='toggleOneDegree4', "Proteins adjacent to selected set", value = FALSE)
checkboxInput(inputId='toggleDisconnected4', "Proteins with no interactions", value = FALSE)
```
#### Layout
```{r,cache=FALSE}
selectizeInput('layout4',label=NULL,choices=names(layout_choices),selected="Default",multiple=FALSE)
```
#### Export
```{r, cache=FALSE}
selectizeInput('download_choice4',label=NULL,choices=names(export_choices))
filename4 <- reactive({export_choices[[input$download_choice4]]})
(downloadButton('download4',"Download"))
output$download4 <- downloadHandler(
filename=function() {paste(c(input$domain,filename4()), collapse='_')},
content = function(file) {export_method(filename4(),g4(),file)}
)
```
#### Data Overview {.disclaimer-text}
Last update: </br> <b>`r dataset_last_update`</b>
Domains available: </br> <b> `r npathways`</b>
Domains data source: </br> `r interpro_name` gene set library provided by [Enrichr](https://maayanlab.cloud/Enrichr/).
Enrichment analysis software: </br> [GSEApy](https://github.com/zqfang/GSEApy/){target="_blank"} <i>`r gseapy_release`</i>.
For more details,see our [paper](https://doi.org/10.1101/2023.12.08.570875){target="_blank"}.
## Main Panel {data-width=750}
#### Choose a domain {.opening-page-text }
Visualize kinase-substrate interactions among proteins with select [InterPro](https://www.ebi.ac.uk/interpro/){target="_blank"} **domains**. Choose a domain from the dropdown menu.
<p class='options-text'>
Domains were selected by enriching their protein sets against substrates in the KiNet interaction dataset. If a domain is only present in kinase substrates, you may not see any nodes or edges. Use the sidebar options to <b>include more proteins</b>.
</p>
```{r, cache = FALSE}
selectizeInput(inputId='domain',label=NULL,choices=all_domains,selected="SH3 domain",options=list(maxOptions=200))
initialGeneList4 <- reactive({get_domain_genes(input$domain)})
```
### {}
```{r,cache=FALSE}
g4 <- reactive({get_pathway_graph(initialGeneList4(),input$toggleOneDegree4,input$toggleDisconnected4)})
visNetworkOutput('network4')
output$network4 <- renderVisNetwork({
vis_default(g4()) %>%
visEvents(select="function(nodes){Shiny.onInputChange('selectNode4',nodes.nodes);}") %>%
visEvents(doubleClick="function(nodes){Shiny.onInputChange('nextCenterNode',nodes.nodes)}") %>%
visEvents(selectEdge = "function(edges) {Shiny.setInputValue('selectedEdges4', edges);}") %>%
visIgraphLayout(layout=layout_choices[[input$layout4]])
})
infoGene4 <- reactive({
if(is.null(input$selectNode4)) {NULL} else {get_gene_name(input$selectNode4)}
})
infoEdge4 <- reactive({
req(input$selectedEdges4)
req(input$selectedEdges4$edges)
req(g4())
req(g4()$edges)
edge_id <- input$selectedEdges4$edges
e <- g4()$edges %>% filter(id == edge_id)
req(nrow(e)==1)
render_edge_info(e)
})
```
## {data-width="650" .opening-page-text}
### {data-height="500"}
#### Interaction information
<p class='options-text'> <b> Click on an edge</b> </p>
```{r,cache=FALSE}
renderUI({infoEdge4()})
```
### {data-height="140"}
#### Troubleshooting
<div class="options-text">
<p><b>Not laid out as expected? </b></p>
<p>Try a different layout, or, manually move nodes around.</p>
<p><b>Not seeing any interactions?</b></p>
<p>There may be none in the selected set. Use the options provided to <b>include more proteins</b>. </p>
</div>