-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
140 lines (120 loc) · 9.12 KB
/
ui.R
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
#--------- get plots
suppressWarnings(
suppressMessages(
source("Scripts/plotly_phenopca.r")))
# SHINY
library(shiny)
library(shinythemes)
# Define UI ----
ui <- fluidPage(theme = shinytheme('flatly'),
navbarPage(collapsible = T,
p('Conservation Genomics: ', em('Aegiphila Caymanensis')),
tabPanel('Background',
uiOutput('slide_display',
align = 'center'
),
column(4,
HTML(' '),
wellPanel(
sliderInput('slide_choice',
label = 'Slide',
min = 1,
max = 5,
value = 1,
step = 1,
round = T,
ticks = F,
width = '300px'
),
align = 'center'),
HTML(' '),
offset = 4)
),
tabPanel('Local Adaptation',
titlePanel(h1("Local Adaptation in an Edge-of-Extinction Species ")),
br(),
sidebarLayout(
sidebarPanel(
helpText(em(h4('Searching for evolution in real-time'))),
p('The following PCAs detail a search for local adaptation in the Critically Endangered plant species ',
em('Aegiphila caymanensis'),
'. Each PCA shows genetic variation, decomposed into principle axes, allowing us to visualise a wealth of genetic polymorphism in an interpretable 3D space.',
br(),
br(),
'Each marker represents one of the 10 remaining individuals of the species, and the colours indicate the two geographically distinct populations. The ',
strong(span("red", style = "color:red")),
' population is found on exposed rocky cliff faces, whereas the ',
strong(span("blue", style = "color:blue")),
' population is found wet farmland soil.',
br(),
br(),
'Lines drawn between individuals indicate k-medoids clustering; the clustering informs us as to whether genetic divergence within the species matches geographic separation. Grouping genes by function allows us to target our search using prior information about the plant\'s lifestyle. Differences in soil type are most likely to lead to unique specialisations in roots and recruitment; by performing clustering seperately on each group, and filtering out all other genes, we minimise the chance of signal being masked by background variation. In this case, clustering does not separate the populations, indicating local adaptation is unlikely.'
)
),
mainPanel(
tabsetPanel(
tabPanel(h4("Examine"),
column(3,
br(),
br(),
br(),
br(),
br(),
br(),
br(),
wellPanel(
helpText('Use dropdown to switch displayed PCA'),
selectInput("gene_group",
label = 'Gene Function Group',
choices = c("Root", "Leaf", "Reproduction", 'Recruitment'),
selected = 1)),
align = 'center'
),
column(8,
plotlyOutput('plot_choice', height = '650px'
)
)
),
tabPanel(h4("Compare"),
fluidRow(
column(6,
plotlyOutput('root_plot', height = '300px'),
em(h5(textOutput('r_title'))),
align = 'center'
),
column(6,
plotlyOutput('leaf_plot', height = '300px'),
em(h5(textOutput('l_title'))),
align = 'center'
)
),
fluidRow(
column(6,
plotlyOutput('flower_plot', height = '300px'),
em(h5(textOutput('f_title'))),
align = 'center'
),
column(6,
plotlyOutput('recruit_plot', height = '300px'),
em(h5(textOutput('g_title'))),
align = 'center'
)
)
)
)
),
position = 'right'
)
),
tabPanel('Breeding Pair Selection',
p('under construction!'))
)
)