force button
This commit is contained in:
parent
c4432dd490
commit
70f8a917e5
1 changed files with 104 additions and 79 deletions
|
@ -44,7 +44,110 @@ function(input, output, session) {
|
||||||
, color = "green")
|
, color = "green")
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
observeEvent(
|
||||||
|
{
|
||||||
|
input$switch_target
|
||||||
|
input$snp_ligand_dist
|
||||||
|
input$snp_nca_dist
|
||||||
|
input$snp_interface_dist
|
||||||
|
|
||||||
|
},{
|
||||||
|
target_gene = input$switch_target
|
||||||
|
merged_df3 = cbind(get(paste0(input$switch_target, '_merged_df3')))
|
||||||
|
|
||||||
|
position_max=max(merged_df3[['position']])
|
||||||
|
position_min=min(merged_df3[['position']])
|
||||||
|
min_ligand_distance=min(merged_df3$ligand_distance)
|
||||||
|
max_ligand_distance=max(merged_df3$ligand_distance)
|
||||||
|
# FIXME: these are IMPORTANT
|
||||||
|
# # add "pos_count" position count column
|
||||||
|
# merged_df3=merged_df3 %>% dplyr::add_count(position)
|
||||||
|
# merged_df3$pos_count=merged_df3$n
|
||||||
|
# merged_df3$n=NULL
|
||||||
|
#
|
||||||
|
mutable_df3 = cbind(merged_df3)
|
||||||
|
|
||||||
|
#### site_snp_count_bp ####
|
||||||
|
#mutable_df3[(mutable_df3$position>=plot_min & mutable_df3$position <=plot_max),]
|
||||||
|
# ligand_distance
|
||||||
|
# interface_dist
|
||||||
|
# nca_distance
|
||||||
|
# change to: multiple plots, all use site_snp_count_bp
|
||||||
|
# 4 x plots side by side, one normal (no dist. filter), 2/3 filtered by distance columns above
|
||||||
|
# use "subtitle text" from pos_count_bp_i.R
|
||||||
|
|
||||||
|
# different data ranges required for SNP distances
|
||||||
|
snp_ligand_dist_df3 = merged_df3[merged_df3[['ligand_distance']]<input$snp_ligand_dist,]
|
||||||
|
if ("interface_dist" %in% colnames(merged_df3)){
|
||||||
|
snp_interface_dist_df3 = merged_df3[merged_df3[['interface_dist']]<input$snp_interface_dist,]
|
||||||
|
} else {
|
||||||
|
snp_interface_dist_df3 = NULL
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("nca_distance" %in% colnames(merged_df3)){
|
||||||
|
snp_nca_dist_df3 = merged_df3[merged_df3[['nca_distance']]<input$snp_nca_dist,]
|
||||||
|
} else {
|
||||||
|
snp_nca_dist_df3 = NULL
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
output$site_snp_count_bp = renderPlot(
|
||||||
|
site_snp_count_bp(
|
||||||
|
mutable_df3,
|
||||||
|
title_colour = 'black',
|
||||||
|
subtitle_colour = "black",
|
||||||
|
leg_text_size = 12,
|
||||||
|
axis_label_size = 12,
|
||||||
|
geom_ls = 4
|
||||||
|
)
|
||||||
|
)
|
||||||
|
output$site_snp_count_bp_ligand = renderPlot(
|
||||||
|
site_snp_count_bp(
|
||||||
|
snp_ligand_dist_df3,
|
||||||
|
title_colour = 'black',
|
||||||
|
subtitle_colour = "black",
|
||||||
|
leg_text_size = 12,
|
||||||
|
axis_label_size = 12,
|
||||||
|
geom_ls = 4
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# if ("interface_dist" %in% colnames(input$switch_target)) {
|
||||||
|
output$site_snp_count_interface = renderPlot(
|
||||||
|
site_snp_count_bp(
|
||||||
|
snp_interface_dist_df3,
|
||||||
|
title_colour = 'black',
|
||||||
|
subtitle_colour = "black",
|
||||||
|
leg_text_size = 12,
|
||||||
|
axis_label_size = 12,
|
||||||
|
geom_ls = 4
|
||||||
|
)
|
||||||
|
)
|
||||||
|
# } #else {
|
||||||
|
# output$site_snp_count_interface = renderPlot(
|
||||||
|
# ggplot() + annotate(x=1,y=1,"text", label="No interface data for this target")+theme_void()
|
||||||
|
# )
|
||||||
|
# }
|
||||||
|
|
||||||
|
output$site_snp_count_nca = renderPlot( #{
|
||||||
|
#if ("nca_distance" %in% colnames(input$switch_target)) {
|
||||||
|
site_snp_count_bp(
|
||||||
|
snp_nca_dist_df3,
|
||||||
|
title_colour = 'black',
|
||||||
|
subtitle_colour = "black",
|
||||||
|
leg_text_size = 12,
|
||||||
|
axis_label_size = 12,
|
||||||
|
geom_ls = 4
|
||||||
|
)
|
||||||
|
# } else {
|
||||||
|
# ggplot() + annotate(x=1,y=1,"text", label="No RNA data for this target")+theme_void()
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
observeEvent(
|
observeEvent(
|
||||||
{
|
{
|
||||||
input$display_position_range
|
input$display_position_range
|
||||||
|
@ -52,9 +155,6 @@ function(input, output, session) {
|
||||||
input$logoplot_colour_scheme
|
input$logoplot_colour_scheme
|
||||||
input$omit_snp_count
|
input$omit_snp_count
|
||||||
input$switch_target
|
input$switch_target
|
||||||
input$snp_ligand_dist
|
|
||||||
input$snp_nca_dist
|
|
||||||
input$snp_interface_dist
|
|
||||||
input$force
|
input$force
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -122,19 +222,6 @@ function(input, output, session) {
|
||||||
updateNumericInput(session, "snp_nca_dist", min = min(merged_df3$nca_distance), max = max(merged_df3$nca_distance))
|
updateNumericInput(session, "snp_nca_dist", min = min(merged_df3$nca_distance), max = max(merged_df3$nca_distance))
|
||||||
|
|
||||||
|
|
||||||
# different data ranges required for SNP distances
|
|
||||||
snp_ligand_dist_df3 = merged_df3[merged_df3[['ligand_distance']]<input$snp_ligand_dist,]
|
|
||||||
if ("interface_dist" %in% colnames(merged_df3)){
|
|
||||||
snp_interface_dist_df3 = merged_df3[merged_df3[['interface_dist']]<input$snp_interface_dist,]
|
|
||||||
} else {
|
|
||||||
snp_interface_dist_df3 = NULL
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("nca_distance" %in% colnames(merged_df3)){
|
|
||||||
snp_nca_dist_df3 = merged_df3[merged_df3[['nca_distance']]<input$snp_nca_dist,]
|
|
||||||
} else {
|
|
||||||
snp_nca_dist_df3 = NULL
|
|
||||||
}
|
|
||||||
|
|
||||||
stability_colname = stability_boxes_df[stability_boxes_df$stability_type==input$stability_snp_param,"stability_colname"]
|
stability_colname = stability_boxes_df[stability_boxes_df$stability_type==input$stability_snp_param,"stability_colname"]
|
||||||
outcome_colname = stability_boxes_df[stability_boxes_df$stability_type==input$stability_snp_param,"outcome_colname"]
|
outcome_colname = stability_boxes_df[stability_boxes_df$stability_type==input$stability_snp_param,"outcome_colname"]
|
||||||
|
@ -242,68 +329,6 @@ function(input, output, session) {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
#### site_snp_count_bp ####
|
|
||||||
#mutable_df3[(mutable_df3$position>=plot_min & mutable_df3$position <=plot_max),]
|
|
||||||
# ligand_distance
|
|
||||||
# interface_dist
|
|
||||||
# nca_distance
|
|
||||||
# change to: multiple plots, all use site_snp_count_bp
|
|
||||||
# 4 x plots side by side, one normal (no dist. filter), 2/3 filtered by distance columns above
|
|
||||||
# use "subtitle text" from pos_count_bp_i.R
|
|
||||||
|
|
||||||
output$site_snp_count_bp = renderPlot(
|
|
||||||
site_snp_count_bp(
|
|
||||||
mutable_df3,
|
|
||||||
title_colour = 'black',
|
|
||||||
subtitle_colour = "black",
|
|
||||||
leg_text_size = 12,
|
|
||||||
axis_label_size = 12,
|
|
||||||
geom_ls = 4
|
|
||||||
)
|
|
||||||
)
|
|
||||||
output$site_snp_count_bp_ligand = renderPlot(
|
|
||||||
site_snp_count_bp(
|
|
||||||
snp_ligand_dist_df3,
|
|
||||||
title_colour = 'black',
|
|
||||||
subtitle_colour = "black",
|
|
||||||
leg_text_size = 12,
|
|
||||||
axis_label_size = 12,
|
|
||||||
geom_ls = 4
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
# if ("interface_dist" %in% colnames(input$switch_target)) {
|
|
||||||
output$site_snp_count_interface = renderPlot(
|
|
||||||
site_snp_count_bp(
|
|
||||||
snp_interface_dist_df3,
|
|
||||||
title_colour = 'black',
|
|
||||||
subtitle_colour = "black",
|
|
||||||
leg_text_size = 12,
|
|
||||||
axis_label_size = 12,
|
|
||||||
geom_ls = 4
|
|
||||||
)
|
|
||||||
)
|
|
||||||
# } #else {
|
|
||||||
# output$site_snp_count_interface = renderPlot(
|
|
||||||
# ggplot() + annotate(x=1,y=1,"text", label="No interface data for this target")+theme_void()
|
|
||||||
# )
|
|
||||||
# }
|
|
||||||
|
|
||||||
output$site_snp_count_nca = renderPlot( #{
|
|
||||||
#if ("nca_distance" %in% colnames(input$switch_target)) {
|
|
||||||
site_snp_count_bp(
|
|
||||||
snp_nca_dist_df3,
|
|
||||||
title_colour = 'black',
|
|
||||||
subtitle_colour = "black",
|
|
||||||
leg_text_size = 12,
|
|
||||||
axis_label_size = 12,
|
|
||||||
geom_ls = 4
|
|
||||||
)
|
|
||||||
# } else {
|
|
||||||
# ggplot() + annotate(x=1,y=1,"text", label="No RNA data for this target")+theme_void()
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue