-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenes4epilepsy.Rmd
92 lines (79 loc) · 2.63 KB
/
genes4epilepsy.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
---
title: 'PanRank - Genes4Epilepsy'
css: styles.css
---
<div class="data-container">
<div id="description">
This page contains **PanRank** candidate gene rankings based on gene panels from
[Genes4Epilepsy](https://bahlolab.github.io/Genes4Epilepsy/), a curated list
of monogenic epilepsy genes. PanRank scores are between 0 and 1 and represent
the predicted probability that a gene is disease-causing with the specified mode
of inheritance. The "Known Inheritance" column indicates the known mode of
inheritance used to train the model.
Choose the Epilepsy phenotype and gene subset below. By default, genes are
sorted by decreasing PanRank Dominant score, and only genes not
yet associated with the selected phenotype ("novel" genes) are shown.
Hover over gene names for a description as well as links to external resources.
</div>
<div id="roc-plot" style="width:265px;height:275px;"></div>
</div>
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
library(tidyverse)
make_select_script <- function(named_files, label) {
str_c(
'<script>',
'function makeSelect() {',
str_c('return \'<label for="file-select">', label, ':</label>\' +'),
'\'<select id="file-select" class="custom-select">\' +',
str_c('\'<option value="', named_files, '">', names(named_files), '</option> \' +', collapse = '\n'),
'\'</select>\';',
'}',
'</script>',
sep = '\n'
)
}
make_doc_ready_script <- function(fixedUrl, initUrl) {
str_c(
'<script>',
'$(document).ready(function() {',
str_c('const fixedUrl = "', fixedUrl, '";'),
str_c('const initUrl = "', initUrl, '";'),
'initData();',
'loadData(fixedUrl, initUrl);',
'});',
'</script>',
sep = '\n'
)
}
```
```{r, results='asis'}
files <-
list.files('data', pattern = '.csv.gz$', full.names = T) %>%
keep(str_detect, 'G4E_') %>%
discard(str_detect, '.roc.') %>%
discard(str_detect, "fixed.csv.gz") %>%
setNames(., str_remove(basename(.), '.csv.gz$'))
names(files) <-
names(files) %>%
str_remove('G4E_') %>%
str_replace('ALL', 'Epilepsy')
cat(
read_file(
'template.html'
),
make_select_script(
named_files = files,
label = 'Phenotype'
)
# make_doc_ready_script(
# fixedUrl = "data/fixed.csv.gz",
# initUrl = files[1]
# )
)
```
**Note:** "GGE" and "Focal" phenotypes have insufficient numbers of recessively inherited genes for training so no predictions are made.
---
PanRank is developed by [Jacob E. Munro](https://orcid.org/0000-0002-2751-0989), [Mark F.
Bennett](https://orcid.org/0000-0002-3561-6804) and [Melanie
Bahlo](https://orcid.org/0000-0001-5132-0774)