From ExperimentHub to gypsum

knitr::opts_chunk$set(error=FALSE, message=FALSE)

Pulling assets from ExperimentHub.

library(ExperimentHub)
hub <- ExperimentHub()
prefix <- "celldex/immgen/"
norm.hub <- hub[hub$rdatapath==paste0(prefix, "1.0.0/logcounts.rds")]
stopifnot(nrow(norm.hub) == 1L)
norm <- norm.hub[[1]]
str(norm)
coldata.hub <- hub[hub$rdatapath==paste0(prefix, "1.0.0/coldata.rds")]
stopifnot(nrow(coldata.hub) == 1L)
coldata <- coldata.hub[[1]]
coldata

Attaching ontology mappings.

path <- system.file("mapping", "immgen.tsv", package="celldex", mustWork=TRUE)
src <- read.delim(path, header=FALSE, stringsAsFactors=FALSE)

m <- match(coldata$label.fine, src[,1])
stopifnot(all(!is.na(m))) # sanity check

matched <- src[m, 2]
matched[matched==""] <- NA_character_
coldata$label.ont <- matched
coldata

Assembling some metadata.

meta <- list(
    title="Mouse microarray expression from the Immunologic Genome Project",
    description=paste(c(
        "Log-normalized expression values of 830 microarray samples generated by the Immunologic Genome Project (ImmGen, http://www.immgen.org) from pure populations of murine immune cells.",
        "The samples were processed and normalized as described in Aran, Looney and Liu et al. (2019),",
        "i.e., CEL files from the Gene Expression Omnibus (GSE15907 and GSE37448) were processed using RMA normalization on probe-level data.",
        "This dataset consists of 20 broad cell types (`label.main`) and 253 finely resolved cell subtypes (`label.fine`).",
        "The subtypes have also been mapped to the Cell Ontology (`label.ont`)."
    ), collapse="\n"),
    taxonomy_id="10090",
    genome=character(0), # dunno, it doesn't say.
    sources=list(
        list(provider="PubMed", id="18800157"),
        list(provider="GEO", id="GSE15907"),
        list(provider="GEO", id="GSE37448"),
        list(provider="PubMed", id="30643263"),
        list(provider="GitHub", id="dviraran/SingleR", version="adc4a0e4d5cfa79db18f3821f51a02cbd6484710"),
        list(provider="ExperimentHub", id=norm.hub$ah_id),
        list(provider="ExperimentHub", id=coldata.hub$ah_id)
    ),
    maintainer_name="Friederike Dündar",
    maintainer_email="frd2007@med.cornell.edu"
)

Saving it to disk.

library(celldex)
path <- "2024-02-26_output"
saveReference(norm, coldata, path, meta)


LTLA/celldex documentation built on April 29, 2024, 4:34 p.m.