sorting out bp_subcolours in interaction
This commit is contained in:
parent
e8734b1c4b
commit
51aa321792
1 changed files with 59 additions and 0 deletions
59
scripts/functions/tests/test_bp_subcolours_i.R
Normal file
59
scripts/functions/tests/test_bp_subcolours_i.R
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
#!/usr/bin/env Rscript
|
||||||
|
#source("~/git/Misc/shiny/myshiny/gid_data.R")
|
||||||
|
|
||||||
|
source("~/git/LSHTM_analysis/config/gid.R")
|
||||||
|
source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R")
|
||||||
|
source("~/git/LSHTM_analysis/scripts/functions/bp_subcolours.R")
|
||||||
|
|
||||||
|
# p1
|
||||||
|
bp_stability_hmap(plotdf = merged_df3
|
||||||
|
, stability_colname = "duet_scaled"
|
||||||
|
, stability_outcome_colname = "duet_outcome"
|
||||||
|
, p_title = "DUET" )
|
||||||
|
|
||||||
|
# p2
|
||||||
|
bp_stability_hmap(plotdf = merged_df3
|
||||||
|
, stability_colname = "foldx_scaled"
|
||||||
|
, stability_outcome_colname = "foldx_outcome"
|
||||||
|
, p_title = "FoldX" )
|
||||||
|
|
||||||
|
# p3
|
||||||
|
bp_stability_hmap(plotdf = merged_df3
|
||||||
|
, stability_colname = "deepddg_scaled"
|
||||||
|
, stability_outcome_colname = "deepddg_outcome"
|
||||||
|
, p_title = "DeepDDG" )
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
|
||||||
|
merged_df3_f = merged_df3
|
||||||
|
|
||||||
|
setDT(merged_df3_f)[, pos_count := .N, by = position]
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
ui <- basicPage(
|
||||||
|
plotOutput("plot1", click = "plot_click"),
|
||||||
|
verbatimTextOutput("info")
|
||||||
|
)
|
||||||
|
|
||||||
|
server <- function(input, output) {
|
||||||
|
output$plot1 <- renderPlot({
|
||||||
|
|
||||||
|
#plot(mtcars$wt, mtcars$mpg)
|
||||||
|
bp_stability_hmap(plotdf = merged_df3_f
|
||||||
|
, xvar_colname = "position"
|
||||||
|
, stability_colname = "foldx_scaled"
|
||||||
|
, stability_outcome_colname = "foldx_outcome"
|
||||||
|
, p_title = "FoldX" )
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
output$info <- renderPrint({
|
||||||
|
# With base graphics, need to tell it what the x and y variables are.
|
||||||
|
nearPoints(merged_df3_f, input$plot_click
|
||||||
|
, xvar = "position"
|
||||||
|
, yvar = "pos_count"
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
shinyApp(ui, server)
|
Loading…
Add table
Add a link
Reference in a new issue