diff --git a/DESCRIPTION b/DESCRIPTION index 33cd790..b332a41 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -15,7 +15,7 @@ Description: This package contains precomputed data including comparisons in License: AGPL (>= 3) Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.1 +RoxygenNote: 7.3.1 Depends: R (>= 2.10) LazyData: true diff --git a/R/data.R b/R/data.R index 4ace068..e0c8556 100644 --- a/R/data.R +++ b/R/data.R @@ -10,3 +10,6 @@ #' The results from the analysis across Human Protein Atlas' tissue aggregated #' data. "hpa_tissues" + +#' The results from the analysis on CMap data. +"cmap" \ No newline at end of file diff --git a/R/server.R b/R/server.R index a7e2a14..c39826e 100644 --- a/R/server.R +++ b/R/server.R @@ -9,6 +9,8 @@ server <- function(custom_dataset = NULL) { ubigen::hpa_tissues } else if (input$dataset == "gtex_all") { ubigen::gtex_all + } else if (input$dataset == "cmap") { + ubigen::cmap } else { custom_dataset } diff --git a/R/ui.R b/R/ui.R index 4bbfcd1..d9152c8 100644 --- a/R/ui.R +++ b/R/ui.R @@ -26,7 +26,8 @@ ui <- function(custom_dataset = NULL) { choices <- list( "GTEx (across tissues and conditions)" = "gtex_all", "GTEx (across tissues)" = "gtex_tissues", - "Human Protein Atlas (across tissues)" = "hpa_tissues" + "Human Protein Atlas (across tissues)" = "hpa_tissues", + "CMap" = "cmap" ) if (!is.null(custom_dataset)) { diff --git a/data/cmap.rda b/data/cmap.rda new file mode 100644 index 0000000..5d3eea8 Binary files /dev/null and b/data/cmap.rda differ diff --git a/man/cmap.Rd b/man/cmap.Rd new file mode 100644 index 0000000..1588ec0 --- /dev/null +++ b/man/cmap.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{cmap} +\alias{cmap} +\title{The results from the analysis on CMap data.} +\format{ +An object of class \code{data.table} (inherits from \code{data.frame}) with 12382 rows and 17 columns. +} +\usage{ +cmap +} +\description{ +The results from the analysis on CMap data. +} +\keyword{datasets} diff --git a/scripts/cmap.R b/scripts/cmap.R new file mode 100644 index 0000000..5abeca2 --- /dev/null +++ b/scripts/cmap.R @@ -0,0 +1,33 @@ +library(data.table) +library(gprofiler2) +library(here) + +i_am("scripts/cmap.R") + +# Source: custom +load(here("scripts", "input", "CMap_20180808.RData")) + +data <- CMap$"HT_HG-U133A" +rm(CMap) + +transcripts <- dimnames(data)$transcripts +genes <- gconvert( + transcripts, + numeric_ns = "ENTREZGENE_ACC", + mthreshold = 1, + filter_na = FALSE +)$target +dimnames(data)[[1]] <- genes + +d <- as.data.table(data) +d <- na.omit(d) +d <- d[data == "logMean", .(transcripts, drugs, value)] + +setnames( + d, + c("transcripts", "drugs", "value"), + c("gene", "sample", "expression") +) + +cmap <- ubigen::analyze(d) +usethis::use_data(cmap, overwrite = TRUE) \ No newline at end of file