Skip to content

Commit cb76867

Browse files
authored
Merge pull request #9 from weaversd/AAlist
added AA annotation
2 parents a02849d + 41f6ac6 commit cb76867

File tree

5 files changed

+48
-4
lines changed

5 files changed

+48
-4
lines changed

Documentation/Documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Multiple Samples will be displayed as an overlaid intensity plot. The peptide fi
122122
The following customizations can be added to overlaid intensity traces or the stacked peptide plot in either one, two, or multiple samples. These customizations can be accessed in the dropdown menus above the plots. Different combinations of Annotations and PTMs can be used.
123123

124124
## Annotation
125-
Allows for the overlay of specific sequence features on the intensity plots generated in `One Sample`, `Two Samples`, and `Multiple Samples`. A preset annotation can be selected from the menu (e.g. potential N-glycosylation sites or trypsin cut sites) or a custom annotation can be typed using RegEx.
125+
Allows for the overlay of specific sequence features on the intensity plots generated in `One Sample`, `Two Samples`, and `Multiple Samples`. A preset annotation can be selected from the menu (e.g. potential N-glycosylation sites or trypsin cut sites) or a custom annotation can be typed using RegEx. Additionally, the amino acid sequence can be displayed along the x-axis by toggling a checkbox within the annotation dropdown menu. This is not very useful when observing the full protein sequence but can be helpful when the plot is zoomed in.
126126
<img src="annotation_1.png" alt="drawing" width="700" id="borderimage"/>
127127
<br/><br/>
128128
<img src="annotation_2.png" alt="drawing" width="700" id="borderimage"/>

Documentation/Release Updates.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@ Version 0.1.9
4848
Version 0.1.10
4949
2022-11-22
5050
- Increased all font sizes in plots
51-
- updated required packages
51+
- updated required packages
52+
53+
Version 0.1.11
54+
2022-11-22
55+
- Added annotation option to display amino acid sequence along the x-axis.

server.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ server <- function(input, output, session) {
140140
return_plot <- return_plot + scale_y_continuous(trans = pseudo_log_trans(base = 2),
141141
breaks = base_breaks())
142142
}
143+
if (input$diplayAAs) {
144+
return_plot <- add_amino_acids_layer(plot = return_plot,
145+
proteinSeq = protein_obj1()[1])
146+
}
143147

144148

145149
} else {
@@ -162,6 +166,11 @@ server <- function(input, output, session) {
162166
breaks = base_breaks())
163167
}
164168

169+
if (input$diplayAAs) {
170+
return_plot <- add_amino_acids_layer(plot = return_plot,
171+
proteinSeq = protein_obj1()[1])
172+
}
173+
165174

166175
}
167176
create_plotly(return_plot)
@@ -341,6 +350,11 @@ server <- function(input, output, session) {
341350
color = input$annot_color)
342351
}
343352

353+
if (input$diplayAAs) {
354+
return_plot <- add_amino_acids_layer(plot = return_plot,
355+
proteinSeq = protein_obj1()[1])
356+
}
357+
344358
if(input$displayPTMs) {
345359
if(input$two_sample_comparison == "Difference" |
346360
input$two_sample_comparison == "Fold Change"){
@@ -599,6 +613,11 @@ server <- function(input, output, session) {
599613
color = input$annot_color)
600614
}
601615

616+
if (input$diplayAAs) {
617+
return_plot <- add_amino_acids_layer(plot = return_plot,
618+
proteinSeq = protein_obj1()[1])
619+
}
620+
602621
if(input$displayPTMs) {
603622
if(input$mult_sample_comparison == "Difference" |
604623
input$mult_sample_comparison == "Fold Change"){
@@ -950,6 +969,11 @@ PTM_regex_length <- reactive(length(PTM_regex()))
950969
color = input$annot_color)
951970
}
952971

972+
if (input$diplayAAs) {
973+
return_plot <- add_amino_acids_layer(plot = return_plot,
974+
proteinSeq = protein_obj1()[1])
975+
}
976+
953977
if(input$displayPTMs) {
954978
if(input$stacked_peptides_yunits == "AA Position"){
955979
return_plot <- add_PTM_layer_stacked(plot = return_plot,

ui.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ library(shiny)
22
ui <- navbarPage(title = "PrIntMap-R",
33
tabPanel("Documentation",
44
includeMarkdown("Documentation/Documentation.md"),
5-
"Version 0.1.10"), #update version here for each push
5+
"Version 0.1.11"), #update version here for each push
66
tabPanel("Run",
77
flowLayout(
88
fileInput(inputId = "database_file", label = "Upload fasta database file",
@@ -60,7 +60,10 @@ ui <- navbarPage(title = "PrIntMap-R",
6060
"green",
6161
"pink",
6262
"purple"),
63-
selected = "red")),
63+
selected = "red"),
64+
checkboxInput("diplayAAs",
65+
label = "Show Amino Acids")),
66+
6467
),
6568
dropdown(
6669
label = "PTMs",

www/annotation_functions.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,17 @@ add_annotation_layer <- function(plot,
3535
geom_vline(xintercept = annotation_df$AA_index, color = color,
3636
size = 0.5)
3737
return(plot)
38+
}
39+
40+
41+
42+
add_amino_acids_layer <- function(plot, proteinSeq) {
43+
44+
AA_df <- create_AA_df(proteinSeq)
45+
46+
return_plot <- plot +
47+
geom_text(data = AA_df,
48+
aes(x = AA_index, y = 0, label = AA))
49+
50+
return(return_plot)
3851
}

0 commit comments

Comments
 (0)