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

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)