forked from iracooke/AlignStatShiny
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
161 lines (142 loc) · 7.22 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# This is the user-interface definition of a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#
library("shiny")
shinyUI(fluidPage(
# Sidebar with a slider input for number of bins
verticalLayout(
titlePanel("AlignStat: A tool for the statistical comparison of alternative multiple sequence alignments"),
wellPanel(
div(class="header",
p("This webtool compares two alternative multiple sequence alignments (MSAs) to determine how well
they align homologous residues in the same columns as one another. It classifies similarities
and differences into conserved sequence, conserved gaps, splits, merges and shifts.
Summarising these categories for each column yields information on which columns are agreed
upon by both MSAs, and which differ. Output graphs visualise the comparison data for analysis."),
p("All of the calculations and plots generated by this webtool can also be generated using the underlying ",
a(href="https://github.com/TS404/AlignStat","AlignStat R package")," which is available on ",
a(href="https://cran.r-project.org/package=AlignStat","CRAN"),"")
)
),
conditionalPanel(
condition = "!output.comparison_done",
mainPanel(
h3("Upload your two alignments to make a comparison"),
p("Alignments must be in fasta, clustal, msf, or phylip formats. Both alignments should contain the same sequences in any order."),
p("If you are unsure how to format your inputs or simply want some data to try the app please take a look at the example data."),
a(href="https://dl.dropboxusercontent.com/u/226794/AlignStatShiny/example.zip",class="btn btn-default shiny-download-link",
list(tags$em(class="fa fa-download"),"Example Data")),
br(),br(),
wellPanel(
fileInput("align_a","Alignment A in fasta, clustal, msf, or phylip format"),
fileInput("align_b","Alignment B in fasta, clustal, msf, or phylip format"),
checkboxInput("stack_category_proportions","Stack category proportions",value = TRUE),
checkboxInput("show_prop_cys","Show cysteine abundance",value = FALSE),
checkboxInput("calculate_column_score","Calculate column score",value = FALSE),
checkboxInput("calculate_sum_of_pairs","Calculate sum of pairs",value = FALSE)
)
)
),
conditionalPanel(
condition = "output.comparison_done",
h3("Your AlignStat results are shown below. To run a new comparison simply refresh this page in your browser")
),
conditionalPanel(
condition = "output.comparison_done",
wellPanel(
# Show a plot of the generated distribution
plotOutput("heatmap"),
textOutput("heatmap_caption"),
downloadButton("heatmap_download",label = "Download")
)
),
conditionalPanel(
condition = "output.comparison_done",
wellPanel(
plotOutput("matrix"),
textOutput("matrix_caption"),
downloadButton("matrix_download",label = "Download")
)
),
conditionalPanel(
condition = "output.comparison_done",
wellPanel(
plotOutput("match_summary"),
textOutput("match_summary_caption"),
downloadButton("match_summary_download",label = "Download")
)
),
conditionalPanel(
condition = "output.comparison_done",
wellPanel(
plotOutput("plot_dissimilarity_summary"),
textOutput("plot_dissimilarity_caption"),
downloadButton("dissimilarity_summary_download",label = "Download")
)
),
conditionalPanel(
condition = "output.comparison_has_sum_of_pairs",
wellPanel(
plotOutput("SP_summary"),
textOutput("SP_summary_caption"),
downloadButton("SP_summary_download",label = "Download")
)
),
conditionalPanel(
condition = "output.comparison_done",
wellPanel(
p("When comparing the positions of two MSAs:
A ‘match’ is when both alignments contain an identical characters that is not a gap.
A ‘merge’ is when alignment A contains a gap, but alignment B contains any other character.
A ‘split’ is when alignment B contains a gap, but alignment A contains any other character.
A ‘shift’ is when two alignments contain a non-identical character, neither of which are gaps.
A ‘conserved gap’ is when the both alignments contain a gap."),
p("For further information see",
a(href="https://github.com/TS404/AlignStat","github.com/TS404/AlignStat"))
),
wellPanel(
h4("Download results in csv format"),
downloadButton("similarity_matrix_csv","Similarity Matrix"),
downloadButton("dissimilarity_matrix_csv","Dissimilarity Matrix"),
downloadButton("results_summary_csv","Results Summary"),
p("The Similarity Matrix records which columns of the reference and comparison
MSAs best match. Its [i,j]th entry is the similarity score between
the ith column of the reference alignment and the jth column of the
comparison alignment. Used to determine which columns are most similar
for further analysis. Used to generate the similarity heatmap plot."),
p("The Dissimilarity Matrix categorises dissimilarity in the MSF.
Its [i,j]th entry is the dissimilarity category of the jth
residue of the ith sequence for the reference alignment versus the
comparison alignment (M=match, g=conserved gap, m=merge, s=split, x=shift).
Used to the dissimilarity matrix plot."),
p("The Results Matrix summarises columnwise similarity and disimilarity.
Its [i,j]th entry is the ith match category average of the
jth column of the reference alignment versus the comparison alignment
(i1=match, i2=conserved gap, i3=merge, i4=split, i5=shift). Used to
generate the similarity summary and dissimilarity summary plots.")
)
),
conditionalPanel(
condition = "output.comparison_has_sum_of_pairs",
wellPanel(
h4("Download SPS results in txt and formats"),
downloadButton("SP_ref_txt","Sum of Pairs Reference"),
downloadButton("SP_com_txt","Sum of Pairs Comparison"),
downloadButton("SP_scores_csv","Sum of Pairs Scores"),
p("The Sum of Pairs Reference lists all residue pairs present in the reference
MSA. The Sum of Pairs Comparison lists all residue pairs present in the
comparison MSA. The Sum of Pairs Scores lists the proportion of reference
pairs retained in each column of the comparison MSA")
)
),
wellPanel(
p("AlignStat was developed by Thomas Shafee and Ira Cooke at the ",
a(href="http://www.latrobe.edu.au/lims","La Trobe Institute of Molecular Science (LIMS)")," and ",
a(href="http://hexima.com.au/","Hexima")),
img(src="http://cysbar.science.latrobe.edu.au/img/lims.png",width="200px"),
img(src="http://cysbar.science.latrobe.edu.au/img/hexima.png",width="200px")
)
)
))