swh:1:snp:0c004a03453a29b80f921a24433f7e780b9ceb53
Raw File
Tip revision: 86a00a4283730af08ece8128e9cc940845d0222d authored by Nitesh Turaga on 02 May 2019, 15:54:11 UTC
bump x.y.z versions to even y prior to creation of RELEASE_3_9 branch
Tip revision: 86a00a4
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