From a0866a136ab812fee90bed4c65d0fd9b361e0582 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Sun, 11 Dec 2022 19:47:38 +0000 Subject: [PATCH] aaaaaaa --- tb_host/app.R | 63 ++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/tb_host/app.R b/tb_host/app.R index b114665..53b954c 100644 --- a/tb_host/app.R +++ b/tb_host/app.R @@ -260,17 +260,19 @@ server <- function(input, output) { input$all_mutations }, { gene = input$gene - mutations = paste0( - apply( - unique_missense_genes[unique_missense_genes$gene_name == gene,c("position","chain")], - 1, - function(x){ - paste0(trimws(x[1]), - ":", - trimws(x[2]) - )} - ), - collapse="," + mutations = paste0(":", + as.matrix(unique_missense_genes[unique_missense_genes$gene_name == gene,c("chain")])[1], + " and (", + paste0( + apply( + unique_missense_genes[unique_missense_genes$gene_name == gene,c("position","chain")], + 1, + function(x){ + paste0(trimws(x[1]) + )} + ), + collapse=", " + ), ")" ) print(mutations) @@ -286,31 +288,30 @@ server <- function(input, output) { ) %>% addSelection(type="surface", param = list(name = "all_mutations", - color="green", - sele = "20:A, 22:A, 157:A" + color="red", + sele = mutations + #colorScheme = "bfactor", + #opacity = 1 + ) + ) + NGLVieweR_proxy("af_structure") %>% + updateVisibility("cartoon", FALSE) %>% + addSelection(type="surface", + param = list(name = "all_mutations_surface", + sele = "all", + color="tan", + opacity = 0.2 + ) + ) %>% + addSelection(type="surface", + param = list(name = "all_mutations", + color="red", + sele = mutations #colorScheme = "bfactor", #opacity = 1 ) ) - # addSelection('spacefill', - # param = list( - # name = "Pos", - # sele = "4:A,20:A,22:A,157:A,344:A", - # color = "red", - # opacity=0.1 - # ) - # ) - # NGLVieweR_proxy("af_structure") %>% - # addSelection('ball+stick', - # param = list( - # name = "Pos", - # sele = mutations, - # color = "red", - # opacity=0.1 - # ) - # ) }) - } # Run the application