Add CMap dataset

This commit is contained in:
Elias Projahn 2024-03-14 19:40:25 +01:00
parent 375c5b27ba
commit 6ef80483d2
7 changed files with 57 additions and 2 deletions

View file

@ -15,7 +15,7 @@ Description: This package contains precomputed data including comparisons in
License: AGPL (>= 3) License: AGPL (>= 3)
Encoding: UTF-8 Encoding: UTF-8
Roxygen: list(markdown = TRUE) Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1 RoxygenNote: 7.3.1
Depends: Depends:
R (>= 2.10) R (>= 2.10)
LazyData: true LazyData: true

View file

@ -10,3 +10,6 @@
#' The results from the analysis across Human Protein Atlas' tissue aggregated #' The results from the analysis across Human Protein Atlas' tissue aggregated
#' data. #' data.
"hpa_tissues" "hpa_tissues"
#' The results from the analysis on CMap data.
"cmap"

View file

@ -9,6 +9,8 @@ server <- function(custom_dataset = NULL) {
ubigen::hpa_tissues ubigen::hpa_tissues
} else if (input$dataset == "gtex_all") { } else if (input$dataset == "gtex_all") {
ubigen::gtex_all ubigen::gtex_all
} else if (input$dataset == "cmap") {
ubigen::cmap
} else { } else {
custom_dataset custom_dataset
} }

3
R/ui.R
View file

@ -26,7 +26,8 @@ ui <- function(custom_dataset = NULL) {
choices <- list( choices <- list(
"GTEx (across tissues and conditions)" = "gtex_all", "GTEx (across tissues and conditions)" = "gtex_all",
"GTEx (across tissues)" = "gtex_tissues", "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)) { if (!is.null(custom_dataset)) {

BIN
data/cmap.rda Normal file

Binary file not shown.

16
man/cmap.Rd Normal file
View file

@ -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}

33
scripts/cmap.R Normal file
View file

@ -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)