Skip to content

Commit

Permalink
pvacview extra modules added
Browse files Browse the repository at this point in the history
  • Loading branch information
Evelyn Schmidt authored and susannasiebert committed Feb 8, 2024
1 parent 8964672 commit fda31e3
Show file tree
Hide file tree
Showing 43 changed files with 2,636 additions and 7,710 deletions.
512 changes: 512 additions & 0 deletions pvactools/tools/pvacview/.Rhistory

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions pvactools/tools/pvacview/__init__.py

This file was deleted.

20 changes: 10 additions & 10 deletions pvactools/tools/pvacview/anchor_and_helper_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ peptide_coloring <- function(hla_allele, peptide_row) {
#calculate anchor list for specific peptide length and HLA allele combo given contribution cutoff
calculate_anchor <- function(hla_allele, peptide_length, anchor_contribution) {
result <- tryCatch({
anchor_raw_data <- as.numeric(anchor_data[[peptide_length]][anchor_data[[peptide_length]]["HLA"] == hla_allele][2:(peptide_length + 1)])
anchor_raw_data <- as.numeric(anchor_data[[peptide_length]][anchor_data[[peptide_length]]["HLA"] == hla_allele][2:(peptide_length + 1)])
if (any(is.na(anchor_raw_data))) {
return("NA")
}
Expand All @@ -100,7 +100,7 @@ calculate_anchor <- function(hla_allele, peptide_length, anchor_contribution) {
}
}
return(anchor_list)
}, error = function(e) { return("NA") })
}, error = function(e) { return("NA") })
}

#converts string range (e.g. '2-4', '6') to associated list
Expand Down Expand Up @@ -224,7 +224,7 @@ tier <- function(variant_info, anchor_contribution, dna_cutoff, allele_expr_cuto
return("Pass")
}
}

if ((mt_binding < binding_threshold) && allele_expr_pass && vaf_clonal_pass && tsl_pass && !anchor_residue_pass) {
if (percentile_filter) {
if (mt_percent <= percentile_threshold) {
Expand Down Expand Up @@ -275,7 +275,7 @@ tier_numbers <- function(variant_info, anchor_contribution, dna_cutoff, allele_e
rna_depth <- as.numeric(variant_info["RNA Depth"])
allele_expr <- as.numeric(variant_info["Allele Expr"])
if (use_allele_specific_binding_thresholds && hla_allele %in% names(meta_data[["allele_specific_binding_thresholds"]][hla_allele])) {
binding_threshold <- as.numeric(meta_data[["allele_specific_binding_thresholds"]][hla_allele])
binding_threshold <- as.numeric(meta_data[["allele_specific_binding_thresholds"]][hla_allele])
}
trna_vaf <- as.numeric(meta_data["trna_vaf"])
trna_cov <- as.numeric(meta_data["trna_cov"])
Expand Down Expand Up @@ -305,11 +305,11 @@ tier_numbers <- function(variant_info, anchor_contribution, dna_cutoff, allele_e
range_stop <- as.numeric(strsplit(mutation_pos_list, "-")[[1]][2])
mutation_pos_list <- c(range_start:range_stop)
if (all(mutation_pos_list %in% anchor_list)) {
if (is.na(wt_binding)) {
anchor_residue_pass <- FALSE
}else if (wt_binding < binding_threshold) {
anchor_residue_pass <- FALSE
}
if (is.na(wt_binding)) {
anchor_residue_pass <- FALSE
}else if (wt_binding < binding_threshold) {
anchor_residue_pass <- FALSE
}
}
}else if (!is.na(mutation_pos_list)) {
if (all(as.numeric(mutation_pos_list) %in% anchor_list)) {
Expand Down Expand Up @@ -354,7 +354,7 @@ tier_numbers <- function(variant_info, anchor_contribution, dna_cutoff, allele_e
return(5)
}
}else {
return(5)
return(5)
}
}
if ((mt_binding < binding_threshold) && allele_expr_pass && !vaf_clonal_pass && tsl_pass && anchor_residue_pass) {
Expand Down
2 changes: 2 additions & 0 deletions pvactools/tools/pvacview/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ library(shiny)

source(server.R)
source(ui.R)
source(neofox_ui.R)
source(custom_ui.R)

options(shiny.host = '127.0.0.1')
options(shiny.port = 3333)
Expand Down
45 changes: 38 additions & 7 deletions pvactools/tools/pvacview_dev_eve/custom_ui.R → pvactools/tools/pvacview/custom_ui.R
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@ custom_tab <- tabItem("custom",
br(), br(),
uiOutput("custom_upload_ui")
),
uiOutput("custom_group_by_feature_ui"),
uiOutput("custom_order_by_feature_ui"),
uiOutput("custom_peptide_features_ui"),
box(
title = "Choose How to Visualize Data", status = "primary", solidHeader = TRUE, width = NULL,
uiOutput("custom_group_by_feature_ui"),
h5("Group peptides together by a certain feature. For example, grouping by variant would allow user to explore all proposed peptides for one variant at a time."),
uiOutput("custom_order_by_feature_ui"),
h5("Order peptides by a certain feature. For example, ordering peptides by binding scores to find the best binders."),
uiOutput("custom_peptide_features_ui"),
h5("Choose what features you would like to consider for each group of peptides.")
),

actionButton("visualize_custom", "Visualize")
),
column(6,
Expand Down Expand Up @@ -59,14 +66,38 @@ custom_tab <- tabItem("custom",
enable_sidebar = TRUE, sidebar_width = 25, sidebar_start_open = TRUE,
DTOutput('customTable')%>% withSpinner(color="#8FCCFA"),
span("Currently investigating row: ", verbatimTextOutput("customSelected")),
style = "overflow-x: scroll;font-size:100%")
style = "overflow-x: scroll;font-size:100%"),
),
fluidRow(
box(width = 12, title = "Detailed Data", solidHeader = TRUE, collapsible = TRUE, status = "primary",
tabBox(width = 12, title = " ",
tabPanel("Peptide candidates grouped by selected feature",
DTOutput('customPeptideTable')%>% withSpinner(color="#8FCCFA"), style = "overflow-x: scroll;font-size:100%")
DTOutput('customPeptideTable')%>% withSpinner(color="#8FCCFA"), style = "overflow-x: scroll;font-size:100%"
)
),
fluidRow(
box(width = 12,
title = "Dynamic Scatter Plot", status = "primary", solidHeader = TRUE, collapsible = TRUE,
h4("Scatter plot to explore characteristics of data"),
sidebarPanel(
#variable selection for x-axis
uiOutput("xvrbl_custom"),
uiOutput("xvrbl_log_custom"),
uiOutput("xvrbl_scale_custom"),
# variable selection for y-axis
uiOutput("yvrbl_custom"),
uiOutput("yvrbl_log_custom"),
uiOutput("yvrbl_scale_custom"),
# color
uiOutput("color_custom"),
uiOutput("min_color_custom"),
uiOutput("max_color_custom"),
# size
uiOutput("size_custom")
),
mainPanel(
align = "center",
plotlyOutput(outputId = "scatter_custom", height = "800px") %>% withSpinner(color = "#8FCCFA"),
)

)
)
)
Expand Down
Binary file modified pvactools/tools/pvacview/data/.DS_Store
Binary file not shown.
File renamed without changes.
Loading

0 comments on commit fda31e3

Please sign in to comment.