ML dashboard fixes

This commit is contained in:
Tanushree Tunstall 2022-09-12 14:03:11 +01:00
parent 27f70afb2c
commit b137ac688b
2 changed files with 18 additions and 18 deletions

View file

@ -818,8 +818,8 @@ if (interactive()){
### NGLViewer #### ### NGLViewer ####
# Structure Viewer WebGL/NGLViewR window # Structure Viewer WebGL/NGLViewR window
output$structure <- renderNGLVieweR({ output$structure <- renderNGLVieweR({
#ngl_gene=isolate(input$switch_target) ngl_gene=isolate(input$switch_target)
ngl_gene=input$switch_target # ngl_gene=input$switch_target
ngl_drug=target_map[[ngl_gene]] ngl_drug=target_map[[ngl_gene]]
ngl_pdb_file=paste0(load_dir, "Data/", ngl_drug, '/output/depth/', ngl_gene, '_complex.pdb') ngl_pdb_file=paste0(load_dir, "Data/", ngl_drug, '/output/depth/', ngl_gene, '_complex.pdb')
print(ngl_pdb_file) print(ngl_pdb_file)

View file

@ -147,22 +147,22 @@ makeplot = function(x, # the DataFrame to plot
y_coord_min = 0 y_coord_min = 0
} }
if (display_infobox) { if (display_infobox) {
metadata=t(plot_data[1,colnames(plot_data)[colnames(plot_data) %in% metadata_cols]]) metadata=plot_data[1,colnames(plot_data)[colnames(plot_data) %in% metadata_cols]]
if (display_combined){ if (display_combined){
metatext=paste0("Train/Test: ", metatext=paste0("Train/Test: ",
metadata[1], "/", metadata[2], metadata$n_training_size, "/", metadata$n_test_size,
"\nTrain/Test Target Ratio: ", metadata[3], "/", metadata[4], "\nTrain/Test Target Ratio: ", metadata$n_trainingY_ratio, "/", metadata$n_testY_ratio,
"\nResampling: ", metadata[5], "\nResampling: ", metadata$resampling,
"\nFeatures: ", metadata[6], "\nFeatures: ", metadata$n_features,
"\nGenes Trained: ", combined_training_genes, "\nGenes Trained: ", combined_training_genes,
"\nTest Gene: ", gene "\nTest Gene: ", gene
) )
} else { } else {
metatext=paste0("Train/Test: ", metatext=paste0("Train/Test: ",
metadata[1], "/", metadata[2], metadata$n_training_size, "/", metadata$n_test_size,
"\nTrain/Test Target Ratio: ", metadata[3], "/", metadata[4], "\nTrain/Test Target Ratio: ", metadata$n_trainingY_ratio, "/", metadata$n_testY_ratio,
"\nResampling: ", metadata[5], "\nResampling: ", metadata$resampling,
"\nFeatures: ", metadata[6], "\nFeatures: ", metadata$n_features,
"\nTest Gene: ", gene "\nTest Gene: ", gene
) )
} }
@ -171,7 +171,7 @@ makeplot = function(x, # the DataFrame to plot
grob <- grobTree(textGrob(metatext, grob <- grobTree(textGrob(metatext,
x=0.01, x=0.01,
y=0.90, y=0.80,
hjust=0, hjust=0,
gp=gpar(col="black") gp=gpar(col="black")
) )
@ -192,12 +192,12 @@ makeplot = function(x, # the DataFrame to plot
) + ) +
coord_cartesian(ylim = c(y_coord_min, 1)) + coord_cartesian(ylim = c(y_coord_min, 1)) +
annotation_custom(grob) + annotation_custom(grob) +
geom_label(aes_string(label=selection), geom_text(aes_string(label=selection),
position=position_dodge(width = -0.75), position=position_dodge(width = -0.75),
#vjust = 1.5, vjust = -0.5,
alpha=0.75, alpha=0.75,
fill="white" fill="white"
) + ) +
scale_color_manual(values = colour_range) + scale_color_manual(values = colour_range) +
scale_fill_manual(values = colour_range) + scale_fill_manual(values = colour_range) +