https://github.com/ctlab/phantasus
Revision 0c8535c6edce1969ae0141c62ba2571ac08590fe authored by Vladislav Kamenev on 07 December 2018, 15:05:41 UTC, committed by Vladislav Kamenev on 25 December 2018, 16:46:55 UTC
1 parent c22ce42
Raw File
Tip revision: 0c8535c6edce1969ae0141c62ba2571ac08590fe authored by Vladislav Kamenev on 07 December 2018, 15:05:41 UTC
Update JS
Tip revision: 0c8535c
shinyGAM.R
#' Constructs data frame with gene annotations and submits it into Shiny GAM web-server
#' @param es Expression set object
#' @return URL for Shiny GAM
#' @importFrom utils write.table
shinyGAMAnalysis <- function(es) {
    de <- fData(es)

    deFile <- tempfile()
    write.table(de, deFile, sep="\t", row.names=FALSE, col.names=TRUE)

    # :ToDo: deal with bad certificates and remove ssl_verifypeer option
    r <- httr::POST(url="https://artyomovlab.wustl.edu/upload",
               body=readBin(deFile, what="raw", n=20e6),
               httr::config(ssl_verifypeer = FALSE))
    httr::stop_for_status(r)
    key <- httr::content(r, as="text", encoding="UTF-8")

    shinyGAMUrl <- sprintf("https://artyomovlab.wustl.edu/shiny/gam/?geneDE_key=%s", key)
    return(jsonlite::toJSON(shinyGAMUrl))
}
back to top