Skip to content

Commit

Permalink
Show all candidates from peptide table in the anchor heatmap plot
Browse files Browse the repository at this point in the history
  • Loading branch information
susannasiebert committed Sep 13, 2024
1 parent 28a995c commit fffc0ae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 14 additions & 3 deletions pvactools/tools/pvacview/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,9 @@ server <- shinyServer(function(input, output, session) {
})
##Add legend for anchor heatmap
output$peptideFigureLegend <- renderPlot({
if (is.null(df$metricsData)) {
return()
}
colors <- colorRampPalette(c("lightblue", "blue"))(99)[seq(1, 99, 7)]
color_pos <- data.frame(d = as.character(seq(1, 99, 7)), x1 = seq(0.1, 1.5, 0.1), x2 = seq(0.2, 1.6, 0.1), y1 = rep(1, 15), y2 = rep(1.1, 15), colors = colors)
color_label <- data.frame(x = c(0.1, 0.8, 1.6), y = rep(0.95, 3), score = c(0, 0.5, 1))
Expand All @@ -944,7 +947,15 @@ server <- shinyServer(function(input, output, session) {
print(p1)
})
##Anchor Heatmap overlayed on selected peptide sequences
output$anchorPlot <- renderPlot({
anchorPlotHeight <- reactive({
if (is.null(df$metricsData)) {
return(0)
}
peptide_data <- df$metricsData[[selectedID()]]$good_binders[[selectedTranscriptSet()]]$`peptides`
peptide_names <- names(peptide_data)
(length(peptide_names)) * 2 * 15
})
observe({output$anchorPlot <- renderPlot({
if (is.null(df$metricsData)) {
return()
}
Expand All @@ -964,7 +975,7 @@ server <- shinyServer(function(input, output, session) {
peptide_data[[peptide_names[[i]]]]$individual_el_percentile_calls <- NULL
}
peptide_data <- as.data.frame(peptide_data)
p1 <- ggplot() + scale_x_continuous(limits = c(0, 80)) + scale_y_continuous(limits = c(-31, 1))
p1 <- ggplot() + scale_x_continuous(limits = c(0, 80)) + scale_y_continuous(limits = c((length(peptide_names) * 2 + 1) * -1, 1))
all_peptides <- list()
incProgress(0.1)
for (i in 1:length(peptide_names)) {
Expand Down Expand Up @@ -1028,7 +1039,7 @@ server <- shinyServer(function(input, output, session) {
print(p1)
}
})
}, height = 400, width = 800)
}, height = anchorPlotHeight(), width = 800)})
#anchor score tables for each HLA allele
output$anchorWeights<- renderDT({
withProgress(message = "Loading Anchor Weights Table", value = 0, {
Expand Down
6 changes: 3 additions & 3 deletions pvactools/tools/pvacview/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ explore_tab <- tabItem(
fluidRow(
column(width = 6,
div(style = 'overflow-y:scroll;height: 500px;',
h4("Allele specific anchor prediction heatmap for top 15 candidates in peptide table."),
h5("HLA allele specific anchor predictions overlaying good-binding peptide sequences generated from each specific transcript.", br(),
" Current version supports the first 15 MT/WT peptide sequence pairs (first 30 rows of the peptide table)."), br(),
h4("Allele specific anchor prediction heatmap for the candidates in peptide table."),
h5("HLA allele specific anchor predictions overlaying candidate peptide sequences for selected transcript set."),
br(),
plotOutput(outputId = "peptideFigureLegend", height = "50px"),
plotOutput(outputId = "anchorPlot")
)
Expand Down

0 comments on commit fffc0ae

Please sign in to comment.