GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — voyAGEr/server.R at main · DiseaseTranscriptomicsLab/voyAGEr Expand file tree/ Copy pathserver.RMore file actions 1573 lines (1358 loc) · 77.7 KB / Copy pathserver.RFile metadata and controls1573 lines (1358 loc) · 77.7 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 library(viridis) library(RSQLite) library(manipulateWidget) library(highcharter) library(tm) library(reshape2) library(plyr) library(htmltools) library(RColorBrewer) library(shiny) library(shinyBS) source(file = 'functions_helpers.R') shinyInput <- function(FUN, len, id, ...) { inputs <- character(len) for (i in seq_len(len)) { inputs[i] <- as.character(FUN(paste0(id, i), style='padding:4px;font-size:80%', ...)) } inputs } shinyServer( function(input, output, session) { # DATA IMPORT ------------------------------------------------------------- #Database for the pvalue = f(age) for each gene, tissue and variable # DBconnection3 <- dbConnect(RSQLite::SQLite(), # dbname = "DB_pvalue_ShARP-LM.db") #Significance pvalue = f(age) for a single gene across tissue #Need to take gene-specific information from DB_pvalue_ShARP-LM.db #p_Alterations gathers signficiance for all tissue for a single genes and variable p_Alterations <- reactive({ gene <- input$gene variable <- input$variable_Gene_Alteration validate(need(!is.null(gene) & gene != "", "")) tissue <- geneList$tissue[[match(gene, geneList$gene)]] modifiedTissuename <- gsub("-", "_", tissue) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) p <- data.frame() for (i in 1:length(modifiedTissuename)) { if (tissue[i] %in% c("Ovary", "Uterus", "Vagina", "Prostate", "Fallopian Tube", "Testis") & variable %in% c("Gender", "Int_Age_Gender")) { tmp <- NULL } else { # #SQL database # tmp <- dbGetQuery(DBconnection3, paste("SELECT * FROM", paste0(modifiedTissuename[i], "_", variable))) # #RDS files local # tmp <- readRDS(paste("/genedata/home/arthur/Documents/GTEx/shiftingLM_genes/shiny_app/RDS files/DB_pvalue_ShARP-LM/", # modifiedTissuename[i], "_", variable, ".RDS", sep = "")) #RDS files online tmp <- readRDS(paste("data/DB_pvalue_ShARP-LM/", modifiedTissuename[i], "_", variable, ".RDS", sep = "")) #gene <- gsub("-", "_", gene) # '-' creates issues when calling database so '-' were replaced by "_" in the database's names #gene <- gsub("\\.", "_", gene) # '.' creates issues when calling database so '-' were replaced by "_" in the database's names tmp <- tmp[tmp$gene == gene,] tmp <- tmp[, -1] tmp <- -log10(tmp) fit <- smooth.spline(as.numeric(colnames(tmp)), tmp) fit <- predict(fit, seq(26, 64, by = 0.5))$y tmp <- data.frame(t(fit)) colnames(tmp) <- seq(26, 64, by = 0.5) rownames(tmp) <- tissue[i] } p <- rbind(p, tmp) } p }) #alterations significance for a single gene, tissue and variable p_Alteration_gene <- reactive({ gene <- input$gene variable <- input$variable_Gene_Alteration tissue <- input$tissue validate(need(!is.null(tissue) & tissue != "" & tissue != "All tissues", "")) modifiedTissuename <- gsub("-", "_", tissue) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) if (tissue %in% c("Ovary", "Uterus", "Vagina", "Prostate", "Fallopian Tube", "Testis") & variable %in% c("Gender", "Int_Age_Gender")) { pvalueData <- NULL } else { # #SQL database # pvalueData <- dbGetQuery(DBconnection3, paste("SELECT * FROM", paste0(modifiedTissuename, "_", variable))) # #RDS files local # pvalueData <- readRDS(paste("/genedata/home/arthur/Documents/GTEx/shiftingLM_genes/shiny_app/RDS files/DB_pvalue_ShARP-LM/", # modifiedTissuename, "_", variable, ".RDS", sep = "")) #RDS files online pvalueData <- readRDS(paste("data/DB_pvalue_ShARP-LM/", modifiedTissuename, "_", variable, ".RDS", sep = "")) pvalueData <- pvalueData[pvalueData$gene == gene,] pvalueData <- pvalueData[, -1] } pvalueData }) # coefs linear model per gene, fit ShARP-LM per gene in entire age range, per condition fit_abline <- reactive({ gene <- input$gene variable <- input$variable_Gene_Alteration tissue <- input$tissue validate(need(!is.null(tissue) & tissue != "" & tissue != "All tissues", "")) modifiedTissuename <- gsub("-", "_", tissue) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) if (tissue %in% c("Ovary", "Uterus", "Vagina", "Prostate", "Fallopian Tube", "Testis") & variable %in% c("Gender", "Int_Age_Gender")) { result <- NULL } else { #RDS files online result <- readRDS(paste("data/DB_pvalue_ShARP-LM_EntireAgeRange_abline/", modifiedTissuename, "_", variable, ".RDS", sep = "")) #result <- result[result$gene == gene,] result <- result[, -c(4)] } result }) # _2 because it is for the tissue tab, alteration has a different id fit_abline_2 <- reactive({ gene <- selectedGene() variable <- input$variable_model_2 tissue <- input$tissue_2 validate(need(!is.null(tissue) & tissue != "" & tissue != "All tissues", "")) modifiedTissuename <- gsub("-", "_", tissue) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) if (tissue %in% c("Ovary", "Uterus", "Vagina", "Prostate", "Fallopian Tube", "Testis") & variable %in% c("Gender", "Int_Age_Gender")) { result <- NULL } else { #RDS files online result <- readRDS(paste("data/DB_pvalue_ShARP-LM_EntireAgeRange_abline/", modifiedTissuename, "_", variable, ".RDS", sep = "")) #result <- result[result$gene == gene,] result <- result[, -c(4)] } result }) #significance and t value for a single gene, tissue and variable Sig_Mag_Gene_perTissueVariable <- reactive({ gene <- input$gene variable <- input$variable_Gene_Alteration tissue <- input$tissue validate(need(!is.null(tissue) & tissue != "" & tissue != "All tissues", "")) modifiedTissuename <- gsub("-", "_", tissue) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) if (tissue %in% c("Ovary", "Uterus", "Vagina", "Prostate", "Fallopian Tube", "Testis") & variable %in% c("Gender", "Int_Age_Gender")) { result <- NULL } else { #RDS files online result <- readRDS(paste("data/DB_pvalue_ShARP-LM_EntireAgeRange/", modifiedTissuename, "_", variable, ".RDS", sep = "")) #result <- result[result$gene == gene,] result <- result[, -c(4)] } result }) #significance and t value for a single gene, tissue and variable # _2 because it is for the tissue tab, alteration has a different id Sig_Mag_Gene_perTissueVariable_2 <- reactive({ gene <- selectedGene() variable <- input$variable_model_2 tissue <- input$tissue_2 validate(need(!is.null(tissue) & tissue != "" & tissue != "All tissues", "")) modifiedTissuename <- gsub("-", "_", tissue) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) if (tissue %in% c("Ovary", "Uterus", "Vagina", "Prostate", "Fallopian Tube", "Testis") & variable %in% c("Gender", "Int_Age_Gender")) { result <- NULL } else { #RDS files online result <- readRDS(paste("data/DB_pvalue_ShARP-LM_EntireAgeRange/", modifiedTissuename, "_", variable, ".RDS", sep = "")) #result <- result[result$gene == gene,] result <- result[, -c(4)] } result }) #p gather significance for all genes given a tissue and a variable p <- reactive({ validate(need(input$tissue_2 != "All tissues" & input$tissue_2 != "", "")) if (input$tissue_2 %in% c("Ovary", "Uterus", "Vagina", "Prostate", "Fallopian Tube", "Testis") & input$variable_model_2 %in% c("Gender", "Int_Age_Gender")) { p <- NULL } else { modifiedTissuename <- gsub("-", "_", input$tissue_2) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) # #SQL database # p <- dbGetQuery(DBconnection3, paste("SELECT * FROM", paste0(modifiedTissuename, "_", input$variable_model_2))) # #RDS files local # p <- readRDS(paste("/genedata/home/arthur/Documents/GTEx/shiftingLM_genes/shiny_app/RDS files/DB_pvalue_ShARP-LM/", # modifiedTissuename, "_", input$variable_model_2, ".RDS", sep = "")) #RDS files online p <- readRDS(paste("data/DB_pvalue_ShARP-LM/", modifiedTissuename, "_", input$variable_model_2, ".RDS", sep = "")) rownames(p) <- p$gene p <- p[,-1] } p }) peak <- readRDS("data/peaks_plot_2.RDS") #to know the FDR for each peak for FDRvsAge AgeWavesList <- readRDS("data/FDR_Interpolation_Tissue.RDS") geneList <- readRDS("data/DT_NbTissuePerGene.RDS") donorCondition <- readRDS("data/donorCondition.RDS") conditionID <- readRDS("data/conditionID.RDS") technicalCondition <- readRDS("data/technicalCondition.RDS") Cluster_Reactome <- readRDS("data/Cluster_Reactome.RDS") Cluster_Reactome_affiliation <- readRDS("data/Reactome_cluster_Affiliation.RDS") moduleInfo <- readRDS("data/moduleInfo_Corrected_Atlas_v4.RDS") # color2 <- c("#8DD3C7", "#FFFFB3", "#FB8072", "#80B1D3", "#FDB462", "#B3DE69", "#FCCDE5", "#D9D9D9", "#BC80BD", "#CCEBC5", "#FFED6F", # "#7FC97F", "#BEAED4", "#FDC086", "#E6AB02", "#386CB0", "#A6761D", "#F0027F", "#BF5B17", "#666666", "#1B9E77", "#D95F02", # "#7570B3", "#E7298A", "#66A61E", "#FFFF99", "#BEBADA") # #Import of the gene information # DBconnection <- dbConnect(RSQLite::SQLite(), # dbname = "DB_GeneExpressionV2.db") geneData <- reactive({ gene <- as.character(input$gene) gene <- gsub("-", "_", gene) # '-' creates issues when calling database so '-' were replaced by "_" in the database's names #gene <- gsub("\\.", "_", gene) # '.' creates issues when calling database so '-' were replaced by "_" in the database's names # #SQL databases # a <- dbGetQuery(DBconnection, paste("SELECT * FROM", gene, sep = " ")) #RDS files local # a <- readRDS(paste("/genedata/home/arthur/Documents/GTEx/shiftingLM_genes/shiny_app/RDS files/DB_GeneExpressionV2/", # gene, ".RDS", sep = "")) #RDS files online a <- readRDS(paste("data/DB_GeneExpression_correctGeneSymbol/", gene, ".RDS", sep = "")) a }) #Database for the peak enrichment data # DBconnection2 <- dbConnect(RSQLite::SQLite(), # dbname = "DB_PeakEnrichment.db") # GENE SECTION ------------------------------------------------------------ ##SIDEBAR #Update gene List and tissue List observe({ updatePickerInput(session, "gene", choices = as.character(geneList$gene)[order(as.character(geneList$gene))], selected = "CDKN2A") }) observe({ gene <- as.character(req(input$gene)) #Keep the selected tissue if the new gene is expressed in it #Otherwise, put the heatmpa wil all tissues if (input$tissue %in% as.character(geneList$tissue[[match(gene, geneList$gene)]])) { selected <- input$tissue } else { selected <- "All tissues" } updatePickerInput(session, "tissue", choices = c("All tissues", as.character(geneList$tissue[[match(gene, geneList$gene)]])[order(as.character(geneList$tissue[[match(gene, geneList$gene)]]))]), selected = selected) updateAwesomeRadio(session, "coloredBy", choices = list("All" = "none", "Sex" = "Sex"), selected = "none", inline = T, checkbox = TRUE) updateAwesomeRadio(session, "shapedBy", choices = list("All" = "none", "Condition*" = "Condition"), selected = "none", inline = T, checkbox = TRUE) }) #Update condition list output$shapedByCondition <- renderUI({ condition <- colnames(donorCondition)[-1][order(colnames(donorCondition)[-1])] subtext <- conditionID$ID[match(condition, conditionID$description)] pickerInput("condition", "Select:", choices = condition, choicesOpt = list(subtext = subtext), options = list(`live-search` = TRUE)) }) #table Kruskal-Wallis test when condition is checked output$KruskalWallisCondition <- DT::renderDataTable({ tissue <- input$tissue #when a new gene is selected, geneData is updated sooner than input$tissue generating an error message validate(need(nrow(geneData()[geneData()$tissue == input$tissue, ]) != 0, "")) #allow to hide the error message tmp <- geneData()[geneData()$tissue == tissue,] temp <- data.frame(SAMPID = tmp$samp_id, expression = tmp$expression) temp <- cbind(temp, donorCondition[match(temp$SAMPID, donorCondition$SAMPID), -1]) tmp <- data.frame() for (i in 3:ncol(temp)) { if (length(temp$expression[temp[,i] %in% c(0,1)])!=0 & length(unique(temp[,i][temp[,i] %in% c(0,1)])) == 2) { tmp <- rbind(tmp, data.frame(condition = colnames(temp)[i], pvalue = kruskal.test(temp$expression[temp[,i] %in% c(0,1)], temp[,i][temp[,i] %in% c(0,1)])$p.value)) } } tmp$padj <- p.adjust(tmp$pvalue, method = "BH") tmp$conditionID <- conditionID$ID[match(tmp$condition, conditionID$description)] tmp$pvalue <- round(tmp$pvalue, 4) tmp$padj <- round(tmp$padj, 4) tmp <- tmp[order(tmp$padj),] condition <- ifelse(identical(as.character(input$shapedBy) == "Condition" & !is.na(input$condition), logical(0)) | as.character(input$shapedBy) == "none", "none", as.character(input$condition)) validate(need(condition %in% colnames(donorCondition), "")) condition <- conditionID$ID[match(condition, conditionID$description)] DT::datatable(tmp[, c("conditionID", "pvalue", "padj", "condition")], escape = FALSE, selection = list(mode = "none"), colnames = c("Condition ID", "p-value", "adjusted p-value", "condition"), rownames = FALSE, extensions = c("Scroller", "Buttons"), options = list( dom = 'Bfrtip', buttons = c('copy', 'csv', 'excel'), deferRender = TRUE, scrollY = 400, scroller = TRUE, scrollX = TRUE, rowCallback = JS( "function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {", "var full_text = aData[3];", "$('td:eq(0)', nRow).attr('title', full_text);", "}" ), columnDefs = list( list(visible = FALSE, targets = c(3)), list(className = 'dt-center', targets = 1:3) ) ) ) # #Not working with rowCallback # %>% DT::formatStyle("conditionID", 'pvalue', # color = DT::styleInterval(cuts = c(0.05), values = c('tomato', 'black')) # ) %>% DT::formatStyle("conditionID", 'padj', # fontWeight = DT::styleInterval(cuts = c(0.05), values = c('bold', 'normal')) # ) %>% DT::formatStyle( # "conditionID", target = 'row', backgroundColor = DT::styleEqual(levels = condition, values = "yellow") # ) }) ##GLOBAL HEATMAP #Profile output$Heatmap_LoessGEvsAge <- renderHighchart({ gene <- input$gene # Images not working # title <- paste(gene, " ", # "<a href='https://www.ncbi.nlm.nih.gov/gene/?term=", gene, "' target='_blank'> <img src='NCBI.png' title='NCBI' height='30px' style='padding-bottom:5px;'/></a>", # "<a href='http://www.genecards.org/cgi-bin/carddisp.pl?gene=", gene, "' target='_blank'> <img src='geneCards.png' title='GeneCards' height='30px' style='padding-bottom:5px;'/></a>", # sep = "") title <- paste(gene, " ", "<a href='https://www.ncbi.nlm.nih.gov/gene/?term=", gene, "' target='_blank'>NCBI</a>", " | ", "<a href='http://www.genecards.org/cgi-bin/carddisp.pl?gene=", gene, "' target='_blank'>GeneCards</a>", sep = "") #The gene list is loaded faster that the tissue list. In the meantime, an error message appears since no tissue is selcted validate(need(input$tissue != "", "")) #avoid the error message g <- Heatmap_LoessGEvsAge(geneData()) g %>% hc_title(text = title, useHTML = T) %>% hc_exporting(enabled = T, filename = paste("voyAGEr_Profile_", gene, "_acrossTissues"), buttons = list(contextButton = list(align = "left", symbolStrokeWidth = 4, symbolSize = 20, symbolStroke = '#4D4D4D', symbol = "menu"))) }) #Alterations output$Heatmap_signficanceAlterationsvsAge <- renderHighchart({ gene <- input$gene variable <- input$variable_Gene_Alteration variable <- ifelse(variable == "Age", "Age", ifelse(variable == "Gender", "Sex", "Age&Sex")) # title <- paste(gene, " ", # "<a href='https://www.ncbi.nlm.nih.gov/gene/?term=", gene, "' target='_blank'> <img src='NCBI.png' title='NCBI' height='30px' style='padding-bottom:5px;'/></a>", # "<a href='http://www.genecards.org/cgi-bin/carddisp.pl?gene=", gene, "' target='_blank'> <img src='geneCards.png' title='GeneCards' height='30px' style='padding-bottom:5px;'/></a>", # sep = "") title <- paste(gene, " ", "<a href='https://www.ncbi.nlm.nih.gov/gene/?term=", gene, "' target='_blank'>NCBI</a>", " | ", "<a href='http://www.genecards.org/cgi-bin/carddisp.pl?gene=", gene, "' target='_blank'>GeneCards</a>", sep = "") validate(need(input$tissue != "", "")) #avoid the error message g <- Heatmap_signficanceAlterationsvsAge(p_Alterations()) g %>% hc_title(text = title, useHTML = T) %>% hc_exporting(enabled = T, filename = paste("voyAGEr_Alteration_", gene, "_across_", variable, sep = ''), buttons = list(contextButton = list(align = "left", symbolStrokeWidth = 4, symbolSize = 20, symbolStroke = '#4D4D4D', symbol = "menu"))) }) ##GENE-SPECIFIC #PROFILE #Scatter plot output$scatterGEvsAge <- renderHighchart({ gene <- as.character(input$gene) tissue <- as.character(input$tissue) colored <- input$coloredBy geneInfo <- geneList$info[match(gene, geneList$gene)] condition <- ifelse(identical(as.character(input$shapedBy) == "Condition" & !is.na(input$condition), logical(0)) | as.character(input$shapedBy) == "none", "none", as.character(input$condition)) #when a new gene is selected, geneData is updated sooner than input$tissue generating an error message validate(need(nrow(geneData()[geneData()$tissue == input$tissue, ]) != 0, "")) #allow to hide the error message #Title woth logo linking to genecards and NCBI websites # title <- paste(gene, " ", # "<a href='https://www.ncbi.nlm.nih.gov/gene/?term=", gene, "' target='_blank'> <img src='NCBI.png' title='NCBI' height='30px' style='padding-bottom:5px;'/></a>", # "<a href='http://www.genecards.org/cgi-bin/carddisp.pl?gene=", gene, "' target='_blank'> <img src='geneCards.png' title='GeneCards' height='30px' style='padding-bottom:5px;'/></a>", # sep = "") title <- paste(gene, " ", "<a href='https://www.ncbi.nlm.nih.gov/gene/?term=", gene, "' target='_blank'>NCBI</a>", " | ", "<a href='http://www.genecards.org/cgi-bin/carddisp.pl?gene=", gene, "' target='_blank'>GeneCards</a>", sep = "") g <- scatter_GEvsAge(geneData(), tissue, colored = colored, shaped = condition, donorCondition = donorCondition, gene = gene, geneInfo = geneInfo) g %>% hc_title(text = title, useHTML = T) %>% hc_exporting(enabled = T, filename = paste("voyAGEr_Profile_", gene, "_", tissue, sep = ''), buttons = list(contextButton = list(align = "left", symbolStrokeWidth = 4, symbolSize = 20, symbolStroke = '#4D4D4D', symbol = "menu"))) }) #Data table gene expression and donor information output$geneExpression <- DT::renderDataTable({ gene <- as.character(input$gene) #gene <- gsub("-", "_", gene) # '-' creates issues when calling database so '-' were replaced by "_" in the database's names #gene <- gsub("\\.", "_", gene) # '.' creates issues when calling database so '-' were replaced by "_" in the database's names tissue <- as.character(input$tissue) ymin <- ifelse(input$Selectedymin == "reset", input$Selectedymin, as.numeric(input$Selectedymin)) ymax <- ifelse(input$Selectedymax == "reset", input$Selectedymax, as.numeric(input$Selectedymax)) xmin <- ifelse(input$Selectedxmin == "reset", input$Selectedxmin, as.numeric(input$Selectedxmin)) xmax <- ifelse(input$Selectedxmax == "reset", input$Selectedxmax, as.numeric(input$Selectedxmax)) selectedPoint <- ifelse(is.null(input$ClickedStatus), "select", input$ClickedStatus) #selectedPoint <- "select" #remove possiblity of choosing a single point #To add this option #1. uncomment the previous selectedPoint #2. assign the value TRUE to allowPointSelect in the scatter_GEvsAge function #3. uncomment the events = list(click = ClickFunction) in the scatter_GEvsAge function indexPoint <- input$ClickedIndex + 1 #JS starts counting at 0 condition <- ifelse(identical(as.character(input$shapedBy) == "Condition" & !is.na(input$condition), logical(0)) | as.character(input$shapedBy) == "none", "none", as.character(input$condition)) #when a new gene is selected, geneData is updated sooner than input$tissue generating an error message validate(need(nrow(geneData()[geneData()$tissue == input$tissue, ]) != 0, "")) #allow to hide the error message if (condition == "none") { datatable_donorInfo(geneData(), tissue, selectedPoint, xmin, xmax, ymin, ymax, indexPoint, donorCondition = donorCondition, conditionID) } else { datatable_donorInfo(geneData(), tissue, selectedPoint, xmin, xmax, ymin, ymax, indexPoint, donorCondition = donorCondition, conditionID) %>% DT::formatStyle(condition, backgroundColor = "lightsalmon") } }) #Table downloading #Preparation of the table to download output$geneExpressionDownload <- DT::renderDataTable({ tissue <- as.character(input$tissue) gene <- input$gene tmp <- geneData() tmp <- tmp[tmp$tissue == tissue,] tmp$sex[tmp$sex == 1] <- "Male" tmp$sex[tmp$sex == 2] <- "Female" #Change age format to give an interval and not the exact age tmp$age <- as.character(cut(tmp$age, breaks = seq(20,70, by = 5), include.lowest = T)) #Add and rename condition temp <- donorCondition[match(tmp$samp_id, donorCondition$SAMPID), -1] temp[is.na(temp)] <- "Unknown" temp[temp == 96] <- "Unknown" temp[temp == 97] <- "Unknown" temp[temp == 99] <- "Unknown" temp[temp == 1] <- "Positive" temp[temp == 0] <- "Negative" tmp <- tmp[, c("samp_id", "age", "expression", "sex")] colnames(tmp) <- c("GTEx sample ID", "Age (years)", "Gene Expression (log(CPM))", "Sex of the donor") tmp <- cbind(tmp, temp) rownames(tmp) <- 1:nrow(tmp) filename <- paste("voyAGEr_GEdata_", gene, "_", tissue, sep = '') DT::datatable(tmp, escape = F, options = list(dom = "B", pageLength = nrow(tmp), buttons = list(list(extend='copy', filename = filename), list(extend='csv', filename = filename), list(extend='excel', filename= filename)), columnDefs = list(list(visible=FALSE, targets = 0:ncol(tmp))), headerCallback = JS( "function( thead, data, start, end, display ) { $(thead).closest('thead').find('th').each(function(){ $(this).css('color', 'red').css('border','none'); }); }" ), initComplete = JS( "function(settings) { var table = settings.oInstance.api(); $(table.table().node()).removeClass('no-footer'); }")), extensions = "Buttons" ) }) #ALTERATIONS output$Line_signficanceAlterationsvsAge <- renderHighchart({ #when a new gene is selected, geneData is updated sooner than input$tissue generating an error message validate(need(nrow(geneData()[geneData()$tissue == input$tissue, ]) != 0, "")) #allow to hide the error message gene <- input$gene variable <- input$variable_Gene_Alteration tissue <- input$tissue validate(need(!is.null(tissue) & tissue != "" & tissue != "All tissues", "")) pvalueData <- p_Alteration_gene() statsAllAges <- Sig_Mag_Gene_perTissueVariable()[Sig_Mag_Gene_perTissueVariable()$gene==gene,] ablineAllAges <- fit_abline()[fit_abline()$gene==gene,] # title <- paste(gene, " ", # "<a href='https://www.ncbi.nlm.nih.gov/gene/?term=", gene, "' target='_blank'> <img src='NCBI.png' title='NCBI' height='30px' style='padding-bottom:5px;'/></a>", # "<a href='http://www.genecards.org/cgi-bin/carddisp.pl?gene=", gene, "' target='_blank'> <img src='geneCards.png' title='GeneCards' height='30px' style='padding-bottom:5px;'/></a>", # sep = "") title <- paste(gene, " ", "<a href='https://www.ncbi.nlm.nih.gov/gene/?term=", gene, "' target='_blank'>NCBI</a>", " | ", "<a href='http://www.genecards.org/cgi-bin/carddisp.pl?gene=", gene, "' target='_blank'>GeneCards</a>", sep = "") validate(need(!is.null(pvalueData), "No possible analysis for this alteration in this tissue")) variable <- ifelse(variable == "Age", "Age", ifelse(variable == "Gender", "Sex", "Age&Sex")) #change name for download filename g <- Line_signficanceAlterationsvsAge(gene, pvalueData, geneData = geneData(), allAges = statsAllAges, abline=ablineAllAges, tissue=tissue, coloredBy = variable) %>% hc_title(text = title, useHTML = T) %>% hc_exporting(enabled = T, filename = paste("voyAGEr_Alteration_", gene, "_across_", variable, "_", tissue, sep = ''), buttons = list(contextButton = list(align = "left", symbolStrokeWidth = 4, symbolSize = 20, symbolStroke = '#4D4D4D', symbol = "menu"))) }) # TISSUE SECTION ---------------------------------------------------------- ##GLOBAL HEATMAP output$AgeWavesOrganism <- renderHighchart({ variable <- input$variable_model_2 updatePickerInput(session, inputId = "tissue_2", choices = c("All tissues", rownames(AgeWavesList[[variable]])[order(rownames(AgeWavesList[[variable]]))]), selected = "All tissues") g <- Heatmap_log10FDRvsAge(variable = variable, AgeWaves = AgeWavesList) variable <- ifelse(variable == "Age", "Age", ifelse(variable == "Gender", "Sex", "Age&Sex")) #change name for download filename g %>% hc_exporting(enabled = T, filename = paste("voyAGEr_Alteration_across_", variable, sep = ''), buttons = list(contextButton = list(align = "left", symbolStrokeWidth = 4, symbolSize = 20, symbolStroke = '#4D4D4D', symbol = "menu"))) }) ##TISSUE_SPECIFIC PEAKS #Histogram distribution samples for chosen tissue output$Histogram_DistributionSample <- renderHighchart({ tissue <- input$tissue_2 # #SQL database # gene <- dbGetQuery(DBconnection, paste("SELECT * FROM", "PGD", sep = " ")) #gene PGD chosen since expressed in all tisssue # #RDS files # gene <- readRDS(paste("/genedata/home/arthur/Documents/GTEx/shiftingLM_genes/shiny_app/RDS files/DB_GeneExpressionV2/", # "PGD", ".RDS", sep = "")) #RDS files online gene <- readRDS(paste("data/DB_GeneExpression_correctGeneSymbol/", "PGD", ".RDS", sep = "")) validate(need(tissue != "" & tissue != "All tissues", "")) Histogram_DistributionSample(tissue, gene) }) #% significance gene altered = f(age) output$SigvsAge <- renderHighchart({ variable <- input$variable_model_2 tissue <- input$tissue_2 validate(need(tissue != "All tissues" & tissue != "", "")) validate(need(nrow(peak[peak$tissue == tissue & peak$variable == variable,]) != 0, "No analysis for this tissue and variable")) g <- Line_sigGenesvsAge(tissue, variable, peak) variable <- ifelse(variable == "Age", "Age", ifelse(variable == "Gender", "Sex", "Age&Sex")) #change name for download filename g %>% hc_exporting(enabled = T, filename = paste("voyAGEr_%genesAltered_across_", variable, "_", tissue, sep = ''), buttons = list(contextButton = list(align = "right", symbolStrokeWidth = 4, symbolSize = 20, symbolStroke = '#4D4D4D', symbol = "menu"))) }) #Data table of the gene differential expression signgificance output$genePeakTable <- DT::renderDataTable(server = FALSE,{ validate(need(!is.null(input$peakClicked), "")) # A peak must be chosen tissue <- input$tissue_2 variable <- input$variable_model_2 peakClicked <- input$peakClicked validate(need(!is.na(match(peakClicked, colnames(p()))), "")) # Matching column between age and peak must be found (avoid error when change tissue) validate(need(input$peakClickedVariable == variable, "")) #When a peak is clicked and the variable is changed, enable to remove the table while no peak is selected from the new polot tmp <- data.frame(gene = as.character(rownames(p())), pvalue = round(p()[, match(peakClicked, colnames(p()))], 6)) tmp <- tmp[order(tmp$pvalue),] rownames(tmp) <- 1:nrow(tmp) tmp$Info <- paste(paste0("<a href='http://www.genecards.org/cgi-bin/carddisp.pl?gene=", tmp$gene,"' target='_blank'>", "GeneCards", "</a>"), paste0("<a href='https://www.ncbi.nlm.nih.gov/gene/?term=", tmp$gene,"' target='_blank'>", "NCBI", "</a>"), sep = ", ") filename <- paste("DEG_across_", variable, "_", tissue, "_", peakClicked, "yo", sep = "") DT::datatable(tmp, escape = F, caption = "Significance for gene expression alteration", selection = "single", #only one row selected at a time #filter = "top", #can filter the results per column options = list(deferRender = FALSE, scrollY = 600, scroller = TRUE, scollX = T, dom = "Bfti", buttons = list(list(extend='copy', filename = filename, exportOptions = list(modifier = list(page = "all"))), list(extend='csv', filename = filename, exportOptions = list(modifier = list(page = "all"))), list(extend='excel', filename= filename, exportOptions = list(modifier = list(page = "all"))))), colnames = c("Gene", "p-value", "Info"), rownames = T, extensions = c("Scroller", "Buttons") ) }) #Name of the selected gene based on the chosen peak selectedGene <- reactive({ peakClicked <- input$peakClicked indexRowClicked <- input$genePeakTable_rows_selected validate(need(!is.na(match(peakClicked, colnames(p()))), "")) tmp <- data.frame(gene = as.character(rownames(p())), pvalue = round(p()[, match(peakClicked, colnames(p()))], 6)) tmp <- tmp[order(tmp$pvalue),] gene <- as.character(tmp$gene[indexRowClicked]) gene <- ifelse(!is.character(gene), NULL, gene) }) #Import of the gene information for the chosen gene in Tissue tab geneData_Tissue <- reactive({ gene <- selectedGene() gene <- gsub("-", "_", gene) # to match way the data was stored # #SQL database # a <- dbGetQuery(DBconnection, paste("SELECT * FROM", gene, sep = " ")) #RDS files local # a <- readRDS(paste("/genedata/home/arthur/Documents/GTEx/shiftingLM_genes/shiny_app/RDS files/DB_GeneExpressionV2/", # gene, ".RDS", sep = "")) #RDS file onlibe a <- readRDS(paste("data/DB_GeneExpression_correctGeneSymbol/", gene, ".RDS", sep = "")) a }) #Plot of the Lm pvalues over age output$Line_pvaluevsAge <- renderHighchart({ validate(need(nrow(peak[peak$tissue == input$tissue_2 & peak$variable == input$variable_model_2,]) != 0, "")) validate(need((input$peakClickedState == 'hover' || input$peakClickedState == '') & input$variable_model_2 == input$peakClickedVariable, "Select a peak")) validate(need(!is.na(selectedGene()), "Select a gene")) validate(need(input$peakClickedVariable == input$variable_model_2, "")) #When a peak is clicked and the variable is changed, enable to remove the plot while no peak is selected from the new polot tissue <- input$tissue_2 gene <- selectedGene() pvalueData <- p() coloredBy <- input$variable_model_2 geneInfo <- geneList$info[match(gene, geneList$gene)] variable <- input$variable_model_2 variable <- ifelse(variable == "Age", "Age", ifelse(variable == "Gender", "Sex", "Age&Sex")) #change name for download filename statsAllAges <- Sig_Mag_Gene_perTissueVariable_2()[Sig_Mag_Gene_perTissueVariable_2()$gene==gene,] ablineAllAges <- fit_abline_2()[fit_abline_2()$gene==gene,] g <- Line_pvaluevsAge(gene = gene, pvalueData = pvalueData, geneData = geneData_Tissue(), allAges = statsAllAges, abline=ablineAllAges, tissue = tissue, coloredBy = coloredBy) %>% hc_title(text = gene) #%>% #hc_subtitle(text = geneInfo) g %>% hc_exporting(enabled = T, filename = paste("voyAGEr_Alteration_across_", variable, "_", gene, "_", tissue, sep = ''), buttons = list(contextButton = list(align = "left", symbolStrokeWidth = 4, symbolSize = 20, symbolStroke = '#4D4D4D', symbol = "menu"))) }) ##TISSUE_SPECIFIC ENRICHMENT output$pathwaySpecific <- DT::renderDataTable({ tissue <- input$tissue_2 variable <- input$variable_model_2 #Call to the databse modifiedTissuename <- gsub("-", "_", tissue) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) # #SQL database # enrich <- dbGetQuery(DBconnection2, paste("SELECT * FROM", modifiedTissuename, sep = " ")) #RDS file local # enrich <- readRDS(paste("/genedata/home/arthur/Documents/GTEx/shiftingLM_genes/shiny_app/RDS files/DB_PeakEnrichment.db/", # modifiedTissuename, ".RDS", sep = "")) #RDS files online enrich <- readRDS(paste("data/DB_PeakEnrichment.db/", modifiedTissuename, ".RDS", sep = "")) pathway <- unique(enrich$pathway[enrich$variable == variable]) pathway <- pathway[order(as.character(pathway))] DT::datatable(as.data.frame(gsub("REACTOME_", "", pathway)), escape = F, colnames = c(""), options = list(deferRender = TRUE, scrollY = 400, scroller = TRUE, scollX = T, rowCallback = JS( "function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {", "var full_text = aData[0]", "$('td:eq(0)', nRow).attr('title', full_text);", "}")), selection = list(mode = "multiple", selected = 1), rownames = F, extensions = "Scroller" ) }) pathwaySelected <- reactive({ tissue <- input$tissue_2 variable <- input$variable_model_2 #Call to the databse modifiedTissuename <- gsub("-", "_", tissue) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) # #SQl database # enrich <- dbGetQuery(DBconnection2, paste("SELECT * FROM", modifiedTissuename, sep = " ")) # #RDS file local # enrich <- readRDS(paste("/genedata/home/arthur/Documents/GTEx/shiftingLM_genes/shiny_app/RDS files/DB_PeakEnrichment.db/", # modifiedTissuename, ".RDS", sep = "")) #RDS files onlibe enrich <- readRDS(paste("data/DB_PeakEnrichment.db/", modifiedTissuename, ".RDS", sep = "")) pathway <- unique(enrich$pathway[enrich$variable == variable]) pathway <- pathway[order(as.character(pathway))] pathway[input$pathwaySpecific_rows_selected] }) #Pathway-specific NES = f(age) output$EnrichmentAllOrSpecific <- renderUI({ tagList( awesomeRadio(inputId = "EnrichmentAllOrSpecific", label = "Pathway", inline = T, choices = c("All pathways", "Select:"), checkbox = T), conditionalPanel(condition = "input.EnrichmentAllOrSpecific == 'Select:'", div(DT::dataTableOutput("pathwaySpecific"), style = "font-size: 70%; width: 100%",server = F) ) ) }) #Heatmap fo the NES for a given tissue adn variable output$Heatmap_NESAgevsPathway <- renderCombineWidgets({ tissue <- input$tissue_2 variable <- input$variable_model_2 pathway <- input$EnrichmentAllOrSpecific #Call to the databse modifiedTissuename <- gsub("-", "_", tissue) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) # #SQL databasle # enrich <- dbGetQuery(DBconnection2, paste("SELECT * FROM", modifiedTissuename, sep = " ")) # #RDs file local # enrich <- readRDS(paste("/genedata/home/arthur/Documents/GTEx/shiftingLM_genes/shiny_app/RDS files/DB_PeakEnrichment.db/", # modifiedTissuename, ".RDS", sep = "")) #RDS files online enrich <- readRDS(paste("data/DB_PeakEnrichment.db/", modifiedTissuename, ".RDS", sep = "")) SigPeak <- peak[peak$tissue == tissue & peak$variable == variable, ] validate(need(!is.null(pathway), "")) #Which patwhay tp show if (pathway == "Select:") { validate(need(length(pathwaySelected())!=0, "Choose pathway(s) of interest")) } if (pathway == "All pathways") { pathway <- TRUE } else { enrich <- enrich[enrich$pathway %in% pathwaySelected(), ] pathway <- FALSE } validate(need(length(which(SigPeak$sig == "sig")) != 0, "No significant peak or analysis done for this tissue and variable")) if (pathway == TRUE) { validate(need(length(enrich$pathway[which(enrich$padj <= 0.05 & enrich$age %in% SigPeak$age[SigPeak$sig == "sig"])]) != 0 , "No significant enrichment")) } g <- Heatmap_NESAgevsPathway(peak = peak, tissue = tissue, variable = variable, enrichment = enrich, Cluster_Reactome = Cluster_Reactome, ALL = pathway) variable <- ifelse(variable == "Age", "Age", ifelse(variable == "Gender", "Sex", "Age&Sex")) #change name for download filename g }) #family presentation output$Heatmap_family <- renderHighchart({ #To be linked with the enrichment heatmap, the family presentation only occurs when the heatmap is shown tissue <- input$tissue_2 variable <- input$variable_model_2 #Call to the databse modifiedTissuename <- gsub("-", "_", tissue) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) # #SQL database # enrich <- dbGetQuery(DBconnection2, paste("SELECT * FROM", modifiedTissuename, sep = " ")) # #RDS file local # enrich <- readRDS(paste("/genedata/home/arthur/Documents/GTEx/shiftingLM_genes/shiny_app/RDS files/DB_PeakEnrichment.db/", # modifiedTissuename, ".RDS", sep = "")) #RDS files online enrich <- readRDS(paste("data/DB_PeakEnrichment.db/", modifiedTissuename, ".RDS", sep = "")) SigPeak <- peak[peak$tissue == tissue & peak$variable == variable, ] validate(need(length(which(SigPeak$sig == "sig")) != 0, "")) validate(need(length(enrich$pathway[which(enrich$padj <= 0.05 & enrich$age %in% SigPeak$age[SigPeak$sig == "sig"])]) != 0, "")) Heatmap_family(Cluster_Reactome) }) output$wordcloud_family <- renderHighchart({ #To be linked with the enrichment heatmap, the family presentation only occurs when the heatmap is shown tissue <- input$tissue_2 variable <- input$variable_model_2 #Call to the databse modifiedTissuename <- gsub("-", "_", tissue) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) # #SQL database # enrich <- dbGetQuery(DBconnection2, paste("SELECT * FROM", modifiedTissuename, sep = " ")) #RDS file local # enrich <- readRDS(paste("/genedata/home/arthur/Documents/GTEx/shiftingLM_genes/shiny_app/RDS files/DB_PeakEnrichment.db/", # modifiedTissuename, ".RDS", sep = "")) #RDS files online enrich <- readRDS(paste("data/DB_PeakEnrichment.db/", modifiedTissuename, ".RDS", sep = "")) SigPeak <- peak[peak$tissue == tissue & peak$variable == variable, ] validate(need(length(which(SigPeak$sig == "sig")) != 0, "")) validate(need(length(enrich$pathway[which(enrich$padj <= 0.05 & enrich$age %in% SigPeak$age[SigPeak$sig == "sig"])]) != 0, "")) validate(need(!is.null(input$familyClicked), "Select a family")) wordcloud_family(Cluster_Reactome_affiliation, family = input$familyClicked) %>% hc_exporting(enabled = T, filename = paste("voyAGEr_WordCloud_family-", input$familyClicked, sep = ''), buttons = list(contextButton = list(align = "left", symbolStrokeWidth = 4, symbolSize = 20, symbolStroke = '#4D4D4D', symbol = "menu"))) }) output$listPathway_family <- DT::renderDataTable({ #To be linked with the enrichment heatmap, the family presentation only occurs when the heatmap is shown tissue <- input$tissue_2 variable <- input$variable_model_2 #Call to the databse modifiedTissuename <- gsub("-", "_", tissue) modifiedTissuename <- gsub(" ", "", modifiedTissuename) modifiedTissuename <- gsub("\\(", "", modifiedTissuename) modifiedTissuename <- gsub("\\)", "", modifiedTissuename) # #SQL database # enrich <- dbGetQuery(DBconnection2, paste("SELECT * FROM", modifiedTissuename, sep = " ")) #RDS file local # enrich <- readRDS(paste("/genedata/home/arthur/Documents/GTEx/shiftingLM_genes/shiny_app/RDS files/DB_PeakEnrichment.db/", # modifiedTissuename, ".RDS", sep = "")) #RDS files online enrich <- readRDS(paste("data/DB_PeakEnrichment.db/", modifiedTissuename, ".RDS", sep = "")) SigPeak <- peak[peak$tissue == tissue & peak$variable == variable, ] validate(need(length(which(SigPeak$sig == "sig")) != 0, "")) validate(need(length(enrich$pathway[which(enrich$padj <= 0.05 & enrich$age %in% SigPeak$age[SigPeak$sig == "sig"])]) != 0, "")) validate(need(!is.null(input$familyClicked), "Select a family")) # tmp <- rbind(data.frame(pathway = Cluster_Reactome_affiliation[[input$familyClicked]][!is.na(Cluster_Reactome_affiliation[[input$familyClicked]][,1]),1]), # data.frame(pathway = Cluster_Reactome_affiliation[[input$familyClicked]][!is.na(Cluster_Reactome_affiliation[[input$familyClicked]][,2]),2])) tmp <- as.data.frame(as.matrix(c(Cluster_Reactome_affiliation[[input$familyClicked]]$REACTOME.pathways,Cluster_Reactome_affiliation[[input$familyClicked]]$KEGG.GO.pathways),ncol=2)) filename <- paste("voyAGEr_WordCloud_family-", input$familyClicked, sep = '') |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |