This commit is contained in:
Tanushree Tunstall 2022-09-04 18:45:35 +01:00
parent 74df62bb85
commit d627e88aeb
3 changed files with 99 additions and 77 deletions

View file

@ -56,6 +56,8 @@ split_map = data.frame(
) )
) )
colour_range=c("#605ca8", "#bebddb", "#221e70")
metadata_cols = c("n_training_size", "n_test_size", "n_trainingY_ratio", "n_testY_ratio", "resampling", "n_features") metadata_cols = c("n_training_size", "n_test_size", "n_trainingY_ratio", "n_testY_ratio", "resampling", "n_features")
# hardcoded list of drugs # hardcoded list of drugs
@ -159,9 +161,6 @@ makeplot = function(x, # the DataFrame to plot
, position=position_dodge2(padding=0.1, preserve='total', reverse=TRUE) , position=position_dodge2(padding=0.1, preserve='total', reverse=TRUE)
) + ) +
coord_cartesian(ylim = c(y_coord_min, 1)) + coord_cartesian(ylim = c(y_coord_min, 1)) +
#scale_fill_manual(values = c("BT" = "#605ca8",
# "CV" = "#bebddb") ) +
#guides=guide_legend(reverse=TRUE) +
annotation_custom(grob) + annotation_custom(grob) +
# doesn't work with plotly but looks nice :-( # doesn't work with plotly but looks nice :-(
geom_label(aes_string(label=selection), geom_label(aes_string(label=selection),
@ -172,14 +171,9 @@ makeplot = function(x, # the DataFrame to plot
fill="white" fill="white"
) + ) +
scale_color_manual(values = colour_range) +
scale_fill_manual(values = colour_range) +
# works with plotly but i can't figure out the background yet
# geom_text(aes_string(label=selection, group=selection),
# position=position_dodge(width = -0.75),
# vjust = 1.5,
# alpha=0.75,
#
# ) +
# add little numbers for the BT bars only # add little numbers for the BT bars only
labs(x="",y=paste(selection,"Score")) + labs(x="",y=paste(selection,"Score")) +
@ -210,7 +204,21 @@ if (interactive()){
combined_training_genes = input$combined_training_genes combined_training_genes = input$combined_training_genes
selected_gene = combo[combo$drug == selected_drug,'gene'] selected_gene = combo[combo$drug == selected_drug,'gene']
if (combined_data == "FS"){
updateRadioButtons(
inputId="combined_training_genes",
choiceNames = c("One", "Two"),
choiceValues = c("1", "2"),
selected = "2"
)
} else{
updateRadioButtons(
inputId="combined_training_genes",
choiceNames = c("Five", "Six"),
choiceValues = c("5","6"),
selected = "5"
)
}
# hide stuff if selected # hide stuff if selected
if(combined_model == "combined") { if(combined_model == "combined") {
#if(combined_model == TRUE) { #if(combined_model == TRUE) {

View file

@ -20,7 +20,21 @@ shinyServer(function(input, output) {
combined_training_genes = input$combined_training_genes combined_training_genes = input$combined_training_genes
selected_gene = combo[combo$drug == selected_drug,'gene'] selected_gene = combo[combo$drug == selected_drug,'gene']
if (combined_data == "FS"){
updateRadioButtons(
inputId="combined_training_genes",
choiceNames = c("One", "Two"),
choiceValues = c("1", "2"),
selected = "2"
)
} else{
updateRadioButtons(
inputId="combined_training_genes",
choiceNames = c("Five", "Six"),
choiceValues = c("5","6"),
selected = "5"
)
}
# hide stuff if selected # hide stuff if selected
if(combined_model == "combined") { if(combined_model == "combined") {
#if(combined_model == TRUE) { #if(combined_model == TRUE) {
@ -73,6 +87,6 @@ shinyServer(function(input, output) {
# filedata example for combined: 6genes_logo_skf_BT_embb_actual # filedata example for combined: 6genes_logo_skf_BT_embb_actual
# 6genes_logo_skf_BT_embb_combined # 6genes_logo_skf_BT_embb_combined
}) })
} }
) )